Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant Dockerfile in tests #210

Merged
merged 5 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/tests/it/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

fingerprint () {
# calculate the SHA1 digest of the DER bytes of the certificate using the
Expand Down Expand Up @@ -55,7 +56,8 @@ docker compose exec spire-server ./bin/spire-server entry create \
# set ups spire agent
docker compose up spire-agent -d

docker compose build spiffe-helper
go_version=$(sed -En 's/^go[ ]+([0-9.]+).*/\1/p' ../../../go.mod)
docker compose build --build-arg go_version=$go_version spiffe-helper

# set ups and postgres-db
docker compose up postgres-db -d
Expand Down
2 changes: 1 addition & 1 deletion .github/tests/it/client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ RUN chown client:client \
/run/client/certs/root.crt

USER root
COPY --from=it-spiffe-helper /service/spiffe-helper /opt/helper/spiffe-helper
COPY --from=it-spiffe-helper /spiffe-helper /opt/helper/spiffe-helper
COPY --from=builder /service/client /opt/go-client/client
4 changes: 3 additions & 1 deletion .github/tests/it/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ services:
spiffe-helper:
build:
context: ../../../
dockerfile: ./.github/tests/it/spiffe-helper/Dockerfile
dockerfile: ./Dockerfile
args:
- go_version

postgres-db:
build: postgres
Expand Down
2 changes: 1 addition & 1 deletion .github/tests/it/go-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ RUN chown go-server:go-server \
/run/go-server/certs/root.crt

USER root
COPY --from=it-spiffe-helper /service/spiffe-helper /opt/helper/spiffe-helper
COPY --from=it-spiffe-helper /spiffe-helper /opt/helper/spiffe-helper
COPY --from=builder /service/server /opt/go-server/server
2 changes: 1 addition & 1 deletion .github/tests/it/mysql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ RUN touch /var/lib/mysql/server-cert.pem /var/lib/mysql/server-key.pem /var/lib/
RUN chmod 660 /var/lib/mysql/server-cert.pem /var/lib/mysql/server-key.pem /var/lib/mysql/ca.pem

USER root
COPY --from=it-spiffe-helper /service/spiffe-helper /opt/helper/spiffe-helper
COPY --from=it-spiffe-helper /spiffe-helper /opt/helper/spiffe-helper
2 changes: 1 addition & 1 deletion .github/tests/it/postgres/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ RUN chmod 700 /var/lib/postgresql/data
RUN initdb -D /var/lib/postgresql/data

USER root
COPY --from=it-spiffe-helper /service/spiffe-helper /opt/helper/spiffe-helper
COPY --from=it-spiffe-helper /spiffe-helper /opt/helper/spiffe-helper
4 changes: 0 additions & 4 deletions .github/tests/it/spiffe-helper/Dockerfile

This file was deleted.

7 changes: 6 additions & 1 deletion .github/workflows/pr_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,12 @@ jobs:
matrix:
tests: ${{ fromJson(needs.build-matrix.outputs.tests) }}
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Build containers
run: ./build.sh
shell: bash
Expand Down