1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2024-12-27 04:35:25 +00:00

Forward GitHub token to docker build if it exists

This commit is contained in:
Asher 2019-08-19 17:02:02 -05:00
parent ce3b7dfb1e
commit e53d6bce68
No known key found for this signature in database
GPG Key ID: D63C1EF81242354A

View File

@ -5,6 +5,7 @@ set -euo pipefail
function docker-build() {
local target="${TARGET:-}"
local image="codercom/nbin-${target}"
local token="${GITHUB_TOKEN:-}"
if [[ "${target}" == "linux" ]] ; then
image="codercom/nbin-centos"
fi
@ -26,7 +27,7 @@ function docker-build() {
local command="${1}" ; shift
local args="'${vscodeVersion}' '${codeServerVersion}' '${target}'"
docker exec "${containerId}" \
bash -c "cd /src && CI=true yarn ${command} ${args}"
bash -c "cd /src && CI=true GITHUB_TOKEN=${token} yarn ${command} ${args}"
}
docker cp ./. "${containerId}":/src