Skip to content

Commit 3dca888

Browse files
author
Forest Hoffman
committed
Pass CI env vars to docker image
1 parent b9a7c84 commit 3dca888

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

code-server-e2e.dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,7 @@ RUN echo "deb http://ftp.de.debian.org/debian buster main" >> /etc/apt/sources.l
4545

4646
# Ensure that yarn is installed.
4747
RUN npm i -g yarn@1.12.3 npx
48+
49+
# Copy CI environment variables, if they exist.
50+
ARG env_vars
51+
RUN if [ "$env_vars" != "" ]; then echo $env_vars | base64 -d >> ~/.bashrc; fi

test/scripts/test.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ imageID=`docker images -q code-server-e2e`
1919
# `--rebuild` flag is provided. Alternatively, the image can be
2020
# rebuilt by manually running `yarn build:docker`.
2121
if [[ "$imageID" == "" ]] || [[ "$1" == "--rebuild" ]]; then
22-
yarn build:docker
22+
if [[ "$TRAVIS_OS_NAME" != "" ]]; then
23+
vars=$(env | grep TRAVIS | awk -F'=' '{ printf "export %s=\"%s\"\n", $1, $2 }' | base64 --wrap=0)
24+
yarn build:docker --build-arg env_vars="$vars"
25+
else
26+
yarn build:docker
27+
fi
2328
fi
2429
yarn test:docker

0 commit comments

Comments
 (0)