Skip to content

Commit 50ac513

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

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-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 export $env_vars; env; fi

test/scripts/test.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ 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+
yarn build:docker --build-arg env_vars="$(echo $(env | grep TRAVIS | awk -F'=' '{ printf $1"="$2" " }'))"
24+
else
25+
yarn build:docker
26+
fi
2327
fi
2428
yarn test:docker

0 commit comments

Comments
 (0)