Use CI dockerfile for pushing Docker image

This commit is contained in:
Asher 2020-01-14 15:11:12 -06:00
parent 174cb2f8a9
commit 57425377e5
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A
3 changed files with 23 additions and 9 deletions

View File

@ -50,12 +50,14 @@ steps:
event: tag event: tag
- name: publish:docker - name: publish:docker
image: banzaicloud/drone-kaniko image: plugins/docker
settings: settings:
username: username:
from_secret: docker_user from_secret: docker_user
password: password:
from_secret: docker_password from_secret: docker_password
repo: codercom/code-server
dockerfile: scripts/ci.dockerfile
tags: tags:
- latest - latest
- v2 - v2
@ -170,17 +172,19 @@ steps:
event: tag event: tag
- name: publish:docker - name: publish:docker
image: banzaicloud/drone-kaniko image: plugins/docker
settings: settings:
username: username:
from_secret: docker_user from_secret: docker_user
password: password:
from_secret: docker_password from_secret: docker_password
repo: codercom/code-server
dockerfile: scripts/ci.dockerfile
tags: tags:
- arm64 - arm64
- ${DRONE_TAG}-arm64 - ${DRONE_TAG}-arm64
build_args: build_args:
- tag=$DRONE_TAG - tag=${DRONE_TAG}
when: when:
event: tag event: tag
@ -289,17 +293,19 @@ steps:
event: tag event: tag
- name: publish:docker - name: publish:docker
image: banzaicloud/drone-kaniko image: plugins/docker
settings: settings:
username: username:
from_secret: docker_user from_secret: docker_user
password: password:
from_secret: docker_password from_secret: docker_password
repo: codercom/code-server
dockerfile: scripts/ci.dockerfile
tags: tags:
- arm - arm
- ${DRONE_TAG}-arm - ${DRONE_TAG}-arm
build_args: build_args:
- tag=$DRONE_TAG - tag=${DRONE_TAG}
when: when:
event: tag event: tag

View File

@ -12,7 +12,6 @@ COPY . .
RUN yarn \ RUN yarn \
&& DRONE_TAG="$tag" MINIFY=true BINARY=true GITHUB_TOKEN="$githubToken" ./scripts/ci.bash \ && 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/build \
&& rm -r /src/source && rm -r /src/source

View File

@ -21,7 +21,7 @@ function main() {
mv "vscode-$vscode_version-source" "source/vscode-$vscode_version-source" mv "vscode-$vscode_version-source" "source/vscode-$vscode_version-source"
fi 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 if [[ -n ${DRONE_TAG:-} || -n ${TRAVIS_TAG:-} ]] ; then
export MINIFY="true" export MINIFY="true"
export PACKAGE="true" export PACKAGE="true"
@ -32,8 +32,17 @@ function main() {
} }
run-yarn build run-yarn build
[[ -n ${PACKAGE:-} || -n ${BINARY:-} ]] && run-yarn binary if [[ -n ${PACKAGE:-} || -n ${BINARY:-} ]] ; then
[[ -n ${PACKAGE:-} ]] && run-yarn package 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 "$@" main "$@"