From faffb3faec0c17d2efce99db28b2142e5fe9d296 Mon Sep 17 00:00:00 2001 From: dgtown Date: Thu, 1 Feb 2024 15:55:07 -0500 Subject: [PATCH 1/4] test --- .github/workflows/release_services.yaml | 59 ++++++++++++++++++++ services/job_sidecar_container/job_killer.sh | 1 + 2 files changed, 60 insertions(+) create mode 100644 .github/workflows/release_services.yaml diff --git a/.github/workflows/release_services.yaml b/.github/workflows/release_services.yaml new file mode 100644 index 0000000000..c9cd6bbe31 --- /dev/null +++ b/.github/workflows/release_services.yaml @@ -0,0 +1,59 @@ +--- +name: build + +on: + push: + branches: + - main + pull_request: + branches: + - "*" + +permissions: + contents: read + packages: write + +jobs: + build-image: + strategy: + matrix: + apps: + - name: job_sidecar_container + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v4 + - name: Get changed files in the docs folder + id: changed-files-specific + uses: tj-actions/changed-files@v40.2.0 + with: + files: services/${{ matrix.apps.name }}/** + - name: Set up QEMU + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Package Registry + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Set Github tag + if: steps.changed-files-specific.outputs.any_changed == 'true' + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Build and push + if: steps.changed-files-specific.outputs.any_changed == 'true' + uses: docker/build-push-action@v5 + env: + DOCKER_BUILDKIT: 1 + with: + context: services/${{ matrix.apps.name }} + platforms: linux/amd64,linux/arm64 + push: github.ref == 'refs/heads/main' + tags: | + ghcr.io/porter-dev/${{ matrix.apps.name }}:${{ steps.vars.outputs.sha_short }} + ghcr.io/porter-dev/${{ matrix.apps.name }}:latest diff --git a/services/job_sidecar_container/job_killer.sh b/services/job_sidecar_container/job_killer.sh index bc005b32e1..58181b0d5d 100644 --- a/services/job_sidecar_container/job_killer.sh +++ b/services/job_sidecar_container/job_killer.sh @@ -2,6 +2,7 @@ # Usage: job_killer.sh [-c]? [grace_period_seconds] [process_pattern] [sidecar]? # +# # This script waits for a termination signal and gracefully terminates another process before exiting. # # Attempts to gracefully kill a process by sending SIGTERM to the first process that matches From 54186bc5dd716a4ebdd818ba6614cbcf55b85122 Mon Sep 17 00:00:00 2001 From: dgtown Date: Thu, 1 Feb 2024 15:57:53 -0500 Subject: [PATCH 2/4] test --- .github/workflows/release_services.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release_services.yaml b/.github/workflows/release_services.yaml index c9cd6bbe31..13667a2b3c 100644 --- a/.github/workflows/release_services.yaml +++ b/.github/workflows/release_services.yaml @@ -53,7 +53,7 @@ jobs: with: context: services/${{ matrix.apps.name }} platforms: linux/amd64,linux/arm64 - push: github.ref == 'refs/heads/main' + push: true tags: | ghcr.io/porter-dev/${{ matrix.apps.name }}:${{ steps.vars.outputs.sha_short }} ghcr.io/porter-dev/${{ matrix.apps.name }}:latest From f33170f53294fad0d4b5a3adf9cdbfe1f95da809 Mon Sep 17 00:00:00 2001 From: dgtown Date: Thu, 1 Feb 2024 16:08:03 -0500 Subject: [PATCH 3/4] build job sidecar in amd and arm --- .github/workflows/release_services.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release_services.yaml b/.github/workflows/release_services.yaml index 13667a2b3c..00f1e69c7e 100644 --- a/.github/workflows/release_services.yaml +++ b/.github/workflows/release_services.yaml @@ -1,5 +1,5 @@ --- -name: build +name: release_services on: push: @@ -53,7 +53,7 @@ jobs: with: context: services/${{ matrix.apps.name }} platforms: linux/amd64,linux/arm64 - push: true + push: github.ref == 'refs/heads/master' tags: | ghcr.io/porter-dev/${{ matrix.apps.name }}:${{ steps.vars.outputs.sha_short }} ghcr.io/porter-dev/${{ matrix.apps.name }}:latest From d661e0d14803c2d96a654c77e15e85b533f900c5 Mon Sep 17 00:00:00 2001 From: dgtown Date: Thu, 1 Feb 2024 16:09:11 -0500 Subject: [PATCH 4/4] trigger only on main branch push --- .github/workflows/release_services.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release_services.yaml b/.github/workflows/release_services.yaml index 00f1e69c7e..d602e43f09 100644 --- a/.github/workflows/release_services.yaml +++ b/.github/workflows/release_services.yaml @@ -5,9 +5,6 @@ on: push: branches: - main - pull_request: - branches: - - "*" permissions: contents: read