From 57425377e5964e8d062ff79a4c8db4b507268b0c Mon Sep 17 00:00:00 2001 From: Asher Date: Tue, 14 Jan 2020 15:11:12 -0600 Subject: [PATCH] Use CI dockerfile for pushing Docker image --- .drone.yml | 16 +++++++++++----- Dockerfile | 1 - scripts/ci.bash | 15 ++++++++++++--- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8e6e6f19..1b1330bb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -50,12 +50,14 @@ steps: event: tag - name: publish:docker - image: banzaicloud/drone-kaniko + image: plugins/docker settings: username: from_secret: docker_user password: from_secret: docker_password + repo: codercom/code-server + dockerfile: scripts/ci.dockerfile tags: - latest - v2 @@ -170,17 +172,19 @@ steps: event: tag - name: publish:docker - image: banzaicloud/drone-kaniko + image: plugins/docker settings: username: from_secret: docker_user password: from_secret: docker_password + repo: codercom/code-server + dockerfile: scripts/ci.dockerfile tags: - arm64 - ${DRONE_TAG}-arm64 build_args: - - tag=$DRONE_TAG + - tag=${DRONE_TAG} when: event: tag @@ -289,17 +293,19 @@ steps: event: tag - name: publish:docker - image: banzaicloud/drone-kaniko + image: plugins/docker settings: username: from_secret: docker_user password: from_secret: docker_password + repo: codercom/code-server + dockerfile: scripts/ci.dockerfile tags: - arm - ${DRONE_TAG}-arm build_args: - - tag=$DRONE_TAG + - tag=${DRONE_TAG} when: event: tag diff --git a/Dockerfile b/Dockerfile index 8e3a238d..03026566 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,6 @@ COPY . . RUN yarn \ && DRONE_TAG="$tag" MINIFY=true BINARY=true GITHUB_TOKEN="$githubToken" ./scripts/ci.bash \ - && mv /src/binaries/* /src/binaries/code-server \ && rm -r /src/build \ && rm -r /src/source diff --git a/scripts/ci.bash b/scripts/ci.bash index a9413d56..4eb6b313 100755 --- a/scripts/ci.bash +++ b/scripts/ci.bash @@ -21,7 +21,7 @@ function main() { mv "vscode-$vscode_version-source" "source/vscode-$vscode_version-source" fi - # Only minify and package on tags since that's when releases are pushed. + # Always minify and package on tags since that's when releases are pushed. if [[ -n ${DRONE_TAG:-} || -n ${TRAVIS_TAG:-} ]] ; then export MINIFY="true" export PACKAGE="true" @@ -32,8 +32,17 @@ function main() { } run-yarn build - [[ -n ${PACKAGE:-} || -n ${BINARY:-} ]] && run-yarn binary - [[ -n ${PACKAGE:-} ]] && run-yarn package + if [[ -n ${PACKAGE:-} || -n ${BINARY:-} ]] ; then + run-yarn binary + fi + if [[ -n ${PACKAGE:-} ]] ; then + run-yarn package + fi + + # In this case provide a plainly named "code-server" binary. + if [[ -n ${BINARY:-} ]] ; then + mv binaries/code-server*-vsc* binaries/code-server + fi } main "$@"