Skip to content

Commit

Permalink
Fix issues with args (#199)
Browse files Browse the repository at this point in the history
* Readd buildkit variable and test

* Test with buildkit false

* Use = for secret argument

* Update interpreter

* Add extra dockerfile with secret mounting

* Update docker image to debug

* Remove interpreter custom

* Remove env

* Update dockerfile

* Use a different executor

* Update executor

* Use another executor

* Use another executor

* Use another executor

* Update default version for docker executor

* Rever useless change
  • Loading branch information
marboledacci authored Oct 18, 2024
1 parent 3b79d67 commit c0716ce
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
18 changes: 16 additions & 2 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ promotion_requires: &promotion_requires
publish-docker-multiple-tags,
publish-docker-env-var-image-param,
test-pull,
integration-test-secret-args,
test-install-docker-tools-docker-latest,
test-install-docker-tools-docker-old,
test-install-docker-tools-macos-latest,
Expand Down Expand Up @@ -232,6 +233,18 @@ jobs:
image: ccitest/docker-orb-test
tag: $CIRCLE_BUILD_NUM-$CIRCLE_SHA1
extra_build_args: --build-arg COMMIT_HASH=$CIRCLE_SHA1
integration-test-secret-args:
executor: docker/docker
steps:
- checkout
- setup_remote_docker
- run: echo 'export COMPOSER_AUTH=SECRET_VALUE' >> $BASH_ENV
- docker/build:
dockerfile: test5.Dockerfile
image: ccitest/docker-orb-test-secret
tag: $CIRCLE_BUILD_NUM-$CIRCLE_SHA1
# use-buildkit: true
extra_build_args: "--secret id=COMPOSER_AUTH,env=COMPOSER_AUTH --progress=plain --no-cache"
test-build-bash-substitution:
docker:
- image: cimg/base:current
Expand Down Expand Up @@ -317,6 +330,7 @@ workflows:
test-deploy:
jobs:
- build-multispace-args
- integration-test-secret-args
- docker/hadolint:
name: hadolint
ignore-rules: DL4005,DL3008,DL3009,DL3015,DL3059
Expand Down Expand Up @@ -509,7 +523,7 @@ workflows:
name: publish-docker-save-cache
executor: machine-latest
context: cimg-docker-image-building
dockerfile: test4.Dockerfile
dockerfile: test2.Dockerfile
image: ccitest/docker-orb-test
tag: $CIRCLE_SHA1
cache_to: ccitest/docker-orb-test:cache-big,ccitest/docker-orb-test:cache2-big
Expand All @@ -528,7 +542,7 @@ workflows:
- publish-docker-save-cache
executor: machine-latest
context: cimg-docker-image-building
dockerfile: test4.Dockerfile
dockerfile: test2.Dockerfile
image: ccitest/docker-orb-test
tag: $CIRCLE_SHA1
cache_from: ccitest/docker-orb-test:cache-big
Expand Down
4 changes: 4 additions & 0 deletions src/commands/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ steps:
treat-warnings-as-errors: <<parameters.treat-warnings-as-errors>>
dockerfile: <<parameters.path>>/<<parameters.dockerfile>>
debug: <<parameters.debug>>
- when:
condition: <<parameters.use-buildkit>>
steps:
- run: echo 'export DOCKER_BUILDKIT=1' >> $BASH_ENV

- when:
condition: <<parameters.attach-at>>
Expand Down
2 changes: 1 addition & 1 deletion src/executors/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ parameters:

tag:
type: string
default: "3.6"
default: "3.8"
description: Image tag

docker:
Expand Down
6 changes: 6 additions & 0 deletions test5.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#syntax=docker/dockerfile:1
FROM composer:latest

WORKDIR /var/www/html

RUN --mount=type=secret,id=COMPOSER_AUTH,env=COMPOSER_AUTH,required echo $COMPOSER_AUTH

0 comments on commit c0716ce

Please sign in to comment.