mirror of https://github.com/coder/code-server.git
Add docker image pushing
This commit is contained in:
parent
1a54f6b7ef
commit
1a91588c42
12
.travis.yml
12
.travis.yml
|
@ -12,20 +12,26 @@ jobs:
|
||||||
|
|
||||||
- stage: Release
|
- stage: Release
|
||||||
name: Linux Release
|
name: Linux Release
|
||||||
script: travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
|
script:
|
||||||
|
- travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
|
||||||
|
- ./ci/release-image/push.sh
|
||||||
- name: Linux ARM64 Release
|
- name: Linux ARM64 Release
|
||||||
script: travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
|
script:
|
||||||
|
- travis_wait 60 ./ci/image/run.sh "yarn && yarn vscode && ci/release.sh"
|
||||||
|
- ./ci/release-image/push.sh
|
||||||
arch: arm64
|
arch: arm64
|
||||||
- name: MacOS Release
|
- name: MacOS Release
|
||||||
os: osx
|
os: osx
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js: 12
|
node_js: 12
|
||||||
script: yarn && yarn vscode && travis_wait 60 ci/release.sh
|
script: yarn && yarn vscode && travis_wait 60 ci/release.sh
|
||||||
|
- name: Docker Release
|
||||||
|
script: ./ci/release-image/push.sh
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- name: Code
|
- name: Code
|
||||||
- name: Release
|
- name: Release
|
||||||
if: $TRAVIS_TAG != ""
|
if: env(TRAVIS_TAG) IS present
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
- provider: releases
|
- provider: releases
|
||||||
|
|
|
@ -4,6 +4,8 @@ set -euo pipefail
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
cd "$(dirname "$0")/../.."
|
cd "$(dirname "$0")/../.."
|
||||||
|
|
||||||
|
docker build ci/image
|
||||||
imageTag="$(docker build -q ci/image)"
|
imageTag="$(docker build -q ci/image)"
|
||||||
docker run -t --rm -e CI -e GITHUB_TOKEN -v "$(yarn cache dir):/usr/local/share/.cache/yarn/v6" -v "$PWD:/repo" -w /repo "$imageTag" "$*"
|
docker run -t --rm -e CI -e GITHUB_TOKEN -v "$(yarn cache dir):/usr/local/share/.cache/yarn/v6" -v "$PWD:/repo" -w /repo "$imageTag" "$*"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
code-server*.tar.gz
|
|
|
@ -3,7 +3,7 @@ FROM debian:10
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install -y curl
|
RUN apt-get install -y curl
|
||||||
|
|
||||||
COPY code-server*.tar.gz /tmp
|
COPY release/code-server*.tar.gz /tmp
|
||||||
RUN cd /tmp && tar -xzf code-server*.tar.gz && \
|
RUN cd /tmp && tar -xzf code-server*.tar.gz && \
|
||||||
cp code-server*/code-server /usr/local/bin/code-server
|
cp code-server*/code-server /usr/local/bin/code-server
|
||||||
RUN rm -rf /tmp/*
|
RUN rm -rf /tmp/*
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
main() {
|
||||||
|
cd "$(dirname "$0")/../.."
|
||||||
|
|
||||||
|
if [[ ${CI:-} ]]; then
|
||||||
|
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
|
||||||
|
fi
|
||||||
|
|
||||||
|
imageTag="codercom/code-server:$VERSION"
|
||||||
|
latest="codercom/code-server:latest"
|
||||||
|
if [[ $TRAVIS_CPU_ARCH == "arm64" ]]; then
|
||||||
|
imageTag+="-arm64"
|
||||||
|
latest="codercom/code-server:arm64"
|
||||||
|
fi
|
||||||
|
docker build -t "$imageTag" -t "$latest" -f ./ci/release-image/Dockerfile
|
||||||
|
docker push codercom/code-server
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
Loading…
Reference in New Issue