Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit 23b67d4

Browse files
committed
Better handling of environment variables in circle
1 parent 8c0e4d9 commit 23b67d4

6 files changed

Lines changed: 6 additions & 18 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ jobs:
55
image: circleci/classic:latest
66
steps:
77
- checkout
8-
- run: "./.circleci/init-env.sh > tests/env.sh"
98
- run: "./integrationTest.sh"
109
unit:
1110
docker:

.circleci/init-env.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

integrationTest.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ set +u
77
if [ -z "$CIRCLECI" ]; then
88
go test ./... 2>&1 | grep -v 'no test files'
99
fi
10-
set -u
1110

12-
if [[ -f "tests/env.sh" ]]; then
13-
echo "env.sh file already exists, skipping configuring new accounts..."
11+
if [[ -f "tests/env.sh" ]] || [ -z "$CIRCLECI" ]; then
12+
echo "env.sh already configured, skipping configuring new accounts..."
1413
else
1514
python3 tests/configure_accounts.py
1615
fi
17-
16+
set -u
1817

1918
# Some colors for pretty output
2019
RED='\033[0;31m'

tests/bot-entrypoint.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ IFS=$'\n\t'
77
touch /shared/.keep
88

99
# Generate the env files that will be used for tests
10-
source tests/env.sh
1110
mkdir -p tests/generated-env
1211
ls tests/envFiles/ | xargs -I {} -- bash -c 'cat tests/envFiles/{} | envsubst > tests/generated-env/{}'
1312

tests/docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ services:
99
environment:
1010
- BOT_PAPERKEY
1111
- BOT_USERNAME
12+
- SUBTEAM
1213
volumes:
1314
- app-volume:/shared/
1415
user: root

tests/envFiles/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
The files in this directory are env files used to run the CA bot. The files are filled in based on
2-
the values of environment variables `SUBTEAM`, `BOT_USERNAME`, and `BOT_PAPERKEY` from tests/env.sh.
2+
the values of environment variables `SUBTEAM`, `BOT_USERNAME`, and `BOT_PAPERKEY`. When running
3+
locally, these environment variables are stored in tests/env.sh.

0 commit comments

Comments
 (0)