Skip to content

Commit d35f429

Browse files
committed
chore: use json file instead of environment or repo variables
Signed-off-by: Jonathan Gonzalez V. <[email protected]>
1 parent b0e26dd commit d35f429

File tree

4 files changed

+31
-14
lines changed

4 files changed

+31
-14
lines changed

.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/build-commitfest.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ on:
1111
description: "ID of the Patch"
1212
required: false
1313
default: ""
14+
major_version:
15+
description: "PostgreSQL major version to build against to"
16+
required: false
17+
default: ""
1418

1519
# set up environment variables to be used across all the jobs
1620
env:
1721
REGISTRY: "ghcr.io/${{ github.repository_owner }}/postgresql-trunk"
18-
TAG: "${{ vars.PG_MAJOR }}-commitfest-master"
1922
BRANCH: "master"
2023

2124
defaults:
@@ -32,20 +35,24 @@ jobs:
3235
packages: write
3336
outputs:
3437
tag: ${{ env.TAG }}
35-
steps:
36-
- name: Set common environment variables
37-
uses: c-py/action-dotenv-to-setenv@v5
38-
with:
39-
env-file: .env
4038

39+
steps:
4140
- name: Checkout Code
4241
uses: actions/checkout@v4
4342

43+
- name: Set PostgreSQL Major version
44+
run: |
45+
majorVersion="${{ github.event.inputs.major_version }}"
46+
if [[ -z "${majorVersion}" ]]; then
47+
majorVersion=`cat pg_major.json | jq -r '.pg_major'`
48+
fi
49+
echo "PG_MAJOR=${majorVersion}" >> $GITHUB_ENV
50+
4451
- name: Set commitfest branch and tag
4552
if: github.event.inputs.commitfest_id != '' && github.event.inputs.patch_id != ''
4653
run: |
4754
BRANCH="commitfest/${{ github.event.inputs.commitfest_id }}/${{ github.event.inputs.patch_id }}"
48-
TAG="${{ vars.PG_MAJOR }}-${BRANCH////-}"
55+
TAG="${{ env.PG_MAJOR }}-${BRANCH////-}"
4956
echo "TAG=${TAG}" >> $GITHUB_ENV
5057
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
5158

.github/workflows/continuous-delivery.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ env:
1515
KIND_VERSION: "v0.23.0"
1616
K8S_VERSION: "v1.30.2"
1717
REGISTRY: "ghcr.io/${{ github.repository_owner }}/postgresql-trunk"
18-
TAG: "${{ vars.PG_MAJOR }}-devel"
1918

2019
defaults:
2120
run:
@@ -33,6 +32,18 @@ jobs:
3332
POSTGRES_IMG: ${{ steps.set-env.outputs.POSTGRES_IMG }}
3433
E2E_PRE_ROLLING_UPDATE_IMG: ${{ steps.set-env.outputs.E2E_PRE_ROLLING_UPDATE_IMG }}
3534
steps:
35+
- name: Checkout Code
36+
uses: actions/checkout@v4
37+
38+
- name: Set PostgreSQL Major version
39+
run: |
40+
majorVersion="${{ github.event.inputs.major_version }}"
41+
if [[ -z "${majorVersion}" ]]; then
42+
majorVersion=`cat pg_major.json | jq -r '.pg_major'`
43+
fi
44+
echo "PG_MAJOR=${majorVersion}" >> $GITHUB_ENV
45+
echo "TAG=${majorVersion}-devel" >> $GITHUB_ENV
46+
3647
- name: Set Global Env Vars
3748
id: set-env
3849
run: |
@@ -43,9 +54,6 @@ jobs:
4354
echo "POSTGRES_IMG=${postgres_img}" >> $GITHUB_OUTPUT
4455
echo "E2E_PRE_ROLLING_UPDATE_IMG=${e2e_pre_rolling_update_image}" >> $GITHUB_OUTPUT
4556
46-
- name: Checkout Code
47-
uses: actions/checkout@v4
48-
4957
- name: Log in to the GitHub Container registry
5058
uses: docker/login-action@v3
5159
with:
@@ -160,9 +168,9 @@ jobs:
160168
if: (always() && !cancelled())
161169
env:
162170
RUNNER: "local"
163-
POSTGRES_VERSION: "${{ vars.PG_MAJOR }}"
171+
POSTGRES_VERSION: "${{ env.PG_MAJOR }}"
164172
RUN_ID: "${{ github.run_id }}"
165-
MATRIX: "${{ env.ID }}-${{ env.POSTGRES_KIND }}-${{ vars.PG_MAJOR }}"
173+
MATRIX: "${{ env.ID }}-${{ env.POSTGRES_KIND }}-${{ env.PG_MAJOR }}"
166174
REPOSITORY: "${{ github.repository }}"
167175
BRANCH_NAME: "${GITHUB_REF#refs/heads/}"
168176
GIT_REF: "${{ github.ref_name }}"

pg_major.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"pg_major": 17
3+
}

0 commit comments

Comments
 (0)