Automatically push releases to GCS (#1318)
This commit is contained in:
parent
e270f7da1b
commit
3ee6b0ff0b
2 changed files with 64 additions and 0 deletions
40
.drone.yml
40
.drone.yml
|
@ -66,6 +66,16 @@ steps:
|
|||
when:
|
||||
event: tag
|
||||
|
||||
- name: publish:gcs
|
||||
image: plugins/gcs
|
||||
settings:
|
||||
source: gcs_bucket
|
||||
target: codesrv-ci.cdr.sh/
|
||||
token:
|
||||
from_secret: gcs-token
|
||||
when:
|
||||
event: tag
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
|
@ -120,6 +130,16 @@ steps:
|
|||
when:
|
||||
event: tag
|
||||
|
||||
- name: publish:gcs
|
||||
image: plugins/gcs
|
||||
settings:
|
||||
source: gcs_bucket
|
||||
target: codesrv-ci.cdr.sh/
|
||||
token:
|
||||
from_secret: gcs-token
|
||||
when:
|
||||
event: tag
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
|
@ -188,6 +208,16 @@ steps:
|
|||
when:
|
||||
event: tag
|
||||
|
||||
- name: publish:gcs
|
||||
image: plugins/gcs
|
||||
settings:
|
||||
source: gcs_bucket
|
||||
target: codesrv-ci.cdr.sh/
|
||||
token:
|
||||
from_secret: gcs-token
|
||||
when:
|
||||
event: tag
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
|
@ -242,6 +272,16 @@ steps:
|
|||
when:
|
||||
event: tag
|
||||
|
||||
- name: publish:gcs
|
||||
image: plugins/gcs
|
||||
settings:
|
||||
source: gcs_bucket
|
||||
target: codesrv-ci.cdr.sh/
|
||||
token:
|
||||
from_secret: gcs-token
|
||||
when:
|
||||
event: tag
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
|
|
|
@ -3,6 +3,19 @@
|
|||
|
||||
set -euo pipefail
|
||||
|
||||
function target() {
|
||||
local os=$(uname | tr '[:upper:]' '[:lower:]')
|
||||
if [[ "$os" == "linux" ]]; then
|
||||
# Using the same strategy to detect Alpine as build.ts.
|
||||
local ldd_output=$(ldd --version 2>&1 || true)
|
||||
if echo "$ldd_output" | grep -iq musl; then
|
||||
os="alpine"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "${os}-$(uname -m)"
|
||||
}
|
||||
|
||||
function main() {
|
||||
cd "$(dirname "${0}")/.."
|
||||
|
||||
|
@ -44,6 +57,17 @@ function main() {
|
|||
if [[ -n ${BINARY:-} ]] ; then
|
||||
mv binaries/code-server*-vsc* binaries/code-server
|
||||
fi
|
||||
|
||||
# Prepare GCS bucket directory on release.
|
||||
if [[ -n ${DRONE_TAG:-} || -n ${TRAVIS_TAG:-} ]] ; then
|
||||
local gcp_dir="gcs_bucket/releases/$code_server_version/$(target)"
|
||||
|
||||
mkdir -p "$gcp_dir"
|
||||
mv binaries/code-server*-vsc* "$gcp_dir"
|
||||
if [[ "$(target)" == "linux-x86_64" ]] ; then
|
||||
mv binaries/code-server*-vsc* "gcs_bucket/latest-linux"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
|
Loading…
Reference in a new issue