Skip to content

Commit 560b1e0

Browse files
authored
Merge pull request #390 from myoung34/add_dir_test
Add runner dir test output to goss
2 parents a8e2276 + c69304a commit 560b1e0

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,20 @@ The test file expects the image to test as an environment variable `GH_RUNNER_IM
8787

8888
To test:
8989
```
90+
$ # need to set minimum vars for the goss test interpolation
91+
$ echo "os: ubuntu" >goss_vars.yaml
92+
$ echo "oscodename: focal >>goss_vars.yaml
93+
$ echo "arch: x86_64" >>goss_vars.yaml
9094
$ docker build -t my-base-test -f Dockerfile.base .
9195
$ # Run the base test from Dockerfile.base on the current git HEAD
92-
$ GH_RUNNER_IMAGE="my-base-test" GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true \
96+
$ GH_RUNNER_IMAGE="my-base-test" GOSS_VARS=goss_vars.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true \
9397
${GH_RUNNER_IMAGE} \
9498
10
9599
$ # Use the base image in your final
96100
$ sed -i.bak 's/^FROM.*/FROM my-base-test/g' Dockerfile
97101
$ docker build -t my-full-test -f Dockerfile .
98102
$ # Run the full test from Dockerfile.base on the current git HEAD
99-
$ GH_RUNNER_IMAGE="my-full-test" GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
103+
$ GH_RUNNER_IMAGE="my-full-test" GOSS_VARS=goss_vars.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
100104
-e DEBUG_ONLY=true \
101105
-e RUNNER_NAME=huzzah \
102106
-e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \

goss_full.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ command:
66
- ""
77
- "Disable automatic registration: true"
88
- "Random runner suffix: true"
9+
- "Runner workdir: /tmp/a"
910
- "Runner name: huzzah"
1011
- "Labels: blue,green"
1112
- "Runner Group: wat"

0 commit comments

Comments
 (0)