Skip to content

Commit bcf1764

Browse files
authored
Merge branch 'master' into feature/64952-mark-closed-positions-planning
2 parents abb858f + 6244adb commit bcf1764

File tree

121 files changed

+2390
-741
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2390
-741
lines changed

.github/workflows/build-manual.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ jobs:
3535
environment: ${{ inputs.environment }}
3636
project_name: ${{ inputs.project_name }}
3737
push: ${{ inputs.push }}
38-
registry: harbor.puzzle.ch
39-
registry_url: harbor.puzzle.ch/pitc-ruby-public/ptime/int/rails
4038
secrets:
4139
PUZZLE_REGISTRY_USERNAME: ${{ secrets.PUZZLE_REGISTRY_USERNAME }}
4240
PUZZLE_REGISTRY_TOKEN: ${{ secrets.PUZZLE_REGISTRY_TOKEN }}

.github/workflows/reusable-build.yaml

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: 'Reusable: Build and push image'
2+
name: "Reusable: Build and push image"
33

44
"on":
55
workflow_call:
@@ -17,32 +17,56 @@ name: 'Reusable: Build and push image'
1717
type: boolean
1818
default: false
1919
registry:
20-
description: 'FQDN of the registry'
20+
description: "FQDN of the registry"
2121
type: string
22-
required: true
22+
required: false
23+
default: ""
2324
registry_url:
24-
description: 'URL to push image to'
25+
description: "URL to push image to"
2526
type: string
2627
required: false
27-
default: 'harbor.puzzle.ch/pitc-ruby-public/ptime/int/rails'
28+
default: ""
2829

2930
secrets:
3031
PUZZLE_REGISTRY_USERNAME:
31-
description: 'Needed for the registry login'
32+
description: "Needed for the registry login"
3233
required: true
3334
PUZZLE_REGISTRY_TOKEN:
34-
description: 'Needed for the registry login'
35+
description: "Needed for the registry login"
3536
required: true
3637

3738
jobs:
3839
build:
3940
environment: ${{ inputs.environment }}
40-
runs-on: 'ubuntu-latest'
41+
runs-on: "ubuntu-latest"
42+
43+
env:
44+
BUILD_REGISTRY: ${{ inputs.registry || vars.REGISTRY }}
45+
BUILD_REGISTRY_URL: ${{ inputs.registry_url || vars.REGISTRY_URL }}
46+
4147
steps:
48+
- name: Input Validation
49+
run: |
50+
exit_code=0
51+
52+
if [ -z "${BUILD_REGISTRY}" ]; then
53+
echo "::error title=Configuration Error::BUILD_REGISTRY is empty."
54+
echo "Please ensure 'registry' input is set or 'REGISTRY' variable is configured in the ${{ inputs.environment }} environment."
55+
exit_code=1
56+
fi
57+
58+
if [ -z "${BUILD_REGISTRY_URL}" ]; then
59+
echo "::error title=Configuration Error::BUILD_REGISTRY_URL is empty."
60+
echo "Please ensure 'registry_url' input is set or 'REGISTRY_URL' variable is configured in the ${{ inputs.environment }} environment."
61+
exit_code=1
62+
fi
63+
64+
exit "${exit_code}"
65+
4266
- uses: docker/setup-buildx-action@v3
4367
- uses: docker/login-action@v3
4468
with:
45-
registry: ${{ inputs.registry }}
69+
registry: ${{ env.BUILD_REGISTRY }}
4670
username: ${{ secrets.PUZZLE_REGISTRY_USERNAME }}
4771
password: ${{ secrets.PUZZLE_REGISTRY_TOKEN }}
4872
- uses: docker/build-push-action@v4
@@ -55,9 +79,8 @@ jobs:
5579
GITHUB_SHA=${{ github.sha }}
5680
target: app
5781
tags: |
58-
${{ inputs.registry_url }}:latest
59-
${{ inputs.registry_url }}:${{ github.sha }}
82+
${{ env.BUILD_REGISTRY_URL }}:latest
83+
${{ env.BUILD_REGISTRY_URL }}:git-${{ github.sha }}
6084
push: ${{ inputs.push }}
6185
cache-from: type=gha
6286
cache-to: type=gha,mode=max
63-
...

0 commit comments

Comments
 (0)