diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cf9e71a..cb240cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,10 +112,27 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Get build-type + shell: bash + working-directory: ${{ matrix.image }} + run: | + echo "build_type=$($(git rev-parse --show-toplevel)/bin/build_type.sh)" >> $GITHUB_ENV + echo "::debug::This is a debug message" + - name: Get run-lint-stage shell: bash working-directory: ${{ matrix.image }} run: | - echo "needs.changes.outputs.images=${{ needs.changes.outputs.images }}" - pwd - ls \ No newline at end of file + echo "run-lint-stage=$($(git rev-parse --show-toplevel)/bin/run-lint-stage.sh)" >> $GITHUB_ENV + + - name: Get run-test-stage + shell: bash + working-directory: ${{ matrix.image }} + run: | + echo "run-test-stage=$($(git rev-parse --show-toplevel)/bin/run-test-stage.sh)" >> $GITHUB_ENV + + - name: Get test-entrypoint + shell: bash + working-directory: ${{ matrix.image }} + run: | + echo "test-entrypoint=$($(git rev-parse --show-toplevel)/bin/test-entrypoint.sh)" >> $GITHUB_ENV \ No newline at end of file diff --git a/bin/build-type.sh b/bin/build-type.sh new file mode 100755 index 0000000..2ce864f --- /dev/null +++ b/bin/build-type.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +set -eu -o pipefail + +json_data="$(docker buildx bake --print 2>/dev/null)" +first_build_target=$(echo "$json_data" | jq -r '.target | to_entries[0].value') +if echo "$first_build_target" | jq -e '.labels."dev.polymathrobotics.container-build-publish-action.build-type"' > /dev/null; then + build_type=$(echo "$first_build_target" | jq -r '.labels."dev.polymathrobotics.container-build-publish-action.build-type"') + echo "$build_type" +else + echo "hosted" +fi diff --git a/couchdb/docker-bake.hcl b/couchdb/docker-bake.hcl index 05357e7..0c80c9e 100644 --- a/couchdb/docker-bake.hcl +++ b/couchdb/docker-bake.hcl @@ -1,5 +1,5 @@ variable "TAG_PREFIX" { - default = "docker.io/polymathrobotics/couchdb" + default = "docker.io/polymathrobotics/couchdb" } variable "VERSION" {