Skip to content

Commit

Permalink
fix: docker build/invocation for test runners
Browse files Browse the repository at this point in the history
  • Loading branch information
benmcclelland committed Sep 25, 2024
1 parent 034a820 commit d8c172d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/docker-bats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker Image
run: |
mv tests/.env.docker.default tests/.env.docker
mv tests/.secrets.default tests/.secrets
docker build --build-arg="GO_LIBRARY=go1.23.1.linux-amd64.tar.gz" \
--build-arg="AWS_CLI=awscli-exe-linux-x86_64.zip" --build-arg="MC_FOLDER=linux-amd64" \
--progress=plain -f tests/Dockerfile_test_bats -t bats_test .
- name: Set up Docker Compose
run: sudo apt-get install -y docker-compose
mv tests/.env.docker.default .env.docker
mv tests/.secrets.default .secrets
docker build \
--build-arg="GO_LIBRARY=go1.23.1.linux-amd64.tar.gz" \
--build-arg="AWS_CLI=awscli-exe-linux-x86_64.zip" \
--build-arg="MC_FOLDER=linux-amd64" \
--progress=plain \
-f tests/Dockerfile_test_bats \
.
- name: Run Docker Container
run: docker-compose -f tests/docker-compose-bats.yml up --exit-code-from s3api_np_only s3api_np_only
run: docker compose \
-f tests/docker-compose-bats.yml \
--project-directory . \
up --exit-code-from s3api_np_only s3api_np_only
2 changes: 1 addition & 1 deletion tests/Dockerfile_direct
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RUN git clone https://github.com/bats-core/bats-core.git && \

USER tester
RUN mkdir -p /home/tester/tests
COPY --chown=tester:tester . /home/tester/tests
COPY --chown=tester:tester . /home/tester

# add bats support libraries
RUN git clone https://github.com/bats-core/bats-support.git && rm -rf /home/tester/tests/bats-support && mv bats-support /home/tester/tests
Expand Down
6 changes: 0 additions & 6 deletions tests/docker-compose-bats.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
services:
no_certs:
build:
context: ../
dockerfile: tests/Dockerfile_test_bats
args:
- CONFIG_FILE=tests/.env.nocerts
static_buckets:
build:
context: ../
dockerfile: tests/Dockerfile_test_bats
args:
- CONFIG_FILE=tests/.env.static
posix_backend:
build:
context: ../
dockerfile: tests/Dockerfile_test_bats
args:
- CONFIG_FILE=tests/.env.default
image: bats_test
s3_backend:
build:
context: ../
dockerfile: tests/Dockerfile_test_bats
args:
- CONFIG_FILE=tests/.env.s3
- SECRETS_FILE=tests/.secrets.s3
s3api_np_only:
build:
context: ../
dockerfile: tests/Dockerfile_test_bats
args:
- CONFIG_FILE=tests/.env.default
image: bats_test
command: ["s3api-non-policy"]
direct:
build:
context: ../
dockerfile: tests/Dockerfile_direct
volumes:
- ./.env.direct:/home/tester/tests/.env.direct
Expand Down

0 comments on commit d8c172d

Please sign in to comment.