Skip to content

Commit

Permalink
Add flag for specifying build type - hosted or local
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorific committed Nov 24, 2024
1 parent 238a50e commit 7bd7452
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
12 changes: 12 additions & 0 deletions bin/build-type.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion couchdb/docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variable "TAG_PREFIX" {
default = "docker.io/polymathrobotics/couchdb"
default = "docker.io/polymathrobotics/couchdb"
}

variable "VERSION" {
Expand Down

0 comments on commit 7bd7452

Please sign in to comment.