From fc832b580b884c57510f275cb2a407a2afe477c7 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Fri, 21 Oct 2022 22:16:51 -0400 Subject: [PATCH] tests: test that build-arg works as expected Closes #5388 --- tests/apps/dockerfile/Dockerfile | 3 +++ tests/unit/docker-options.bats | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/tests/apps/dockerfile/Dockerfile b/tests/apps/dockerfile/Dockerfile index a7e312a9d..d868d777e 100644 --- a/tests/apps/dockerfile/Dockerfile +++ b/tests/apps/dockerfile/Dockerfile @@ -10,4 +10,7 @@ COPY . /var/www/html WORKDIR /var/www/html RUN npm install +ARG GITHUB_TOKEN=latest +RUN echo "TOKEN is: $GITHUB_TOKEN" + CMD npm start diff --git a/tests/unit/docker-options.bats b/tests/unit/docker-options.bats index 3b4a40acb..ca0d350ff 100644 --- a/tests/unit/docker-options.bats +++ b/tests/unit/docker-options.bats @@ -360,3 +360,13 @@ teardown() { echo "status: $status" assert_success } + +@test "(docker-options) build arguments" { + run /bin/bash -c "dokku docker-options:add $TEST_APP build '--build-arg GITHUB_TOKEN=\"hello\"'" + + run deploy_app dockerfile + echo "output: $output" + echo "status: $status" + assert_success + assert_output_contains "TOKEN is: hello" +}