Skip to content

Commit 3ea7a66

Browse files
committed
tmp
Signed-off-by: Oleksii Kurinnyi <[email protected]>
1 parent d358f23 commit 3ea7a66

File tree

5 files changed

+118
-24
lines changed

5 files changed

+118
-24
lines changed

.github/workflows/pr-check-ubi10.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ jobs:
2727
steps:
2828
- name: Checkout
2929
uses: actions/checkout@v4
30+
- name: Debug Registry Configuration
31+
run: |
32+
echo "🔍 Registry Configuration Debug:"
33+
echo "Repository Variable (vars.REGISTRY): '${{ vars.REGISTRY }}'"
34+
echo "Resolved REGISTRY env var: '${{ env.REGISTRY }}'"
35+
echo "GitHub Repository: ${{ github.repository }}"
36+
echo "Repository Owner: ${{ github.repository_owner }}"
37+
if [ "${{ vars.REGISTRY }}" != "" ]; then
38+
echo "✅ Using custom registry from repository variable"
39+
else
40+
echo "⚠️ Using fallback registry (no custom REGISTRY variable set)"
41+
fi
3042
- name: Set arch environment variable
3143
run: |
3244
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then

.github/workflows/pr-check.yaml

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ jobs:
2727
steps:
2828
- name: Checkout
2929
uses: actions/checkout@v4
30+
- name: Debug Registry Configuration
31+
run: |
32+
echo "🔍 Registry Configuration Debug:"
33+
echo "Repository Variable (vars.REGISTRY): '${{ vars.REGISTRY }}'"
34+
echo "Resolved REGISTRY env var: '${{ env.REGISTRY }}'"
35+
echo "GitHub Repository: ${{ github.repository }}"
36+
echo "Repository Owner: ${{ github.repository_owner }}"
37+
if [ "${{ vars.REGISTRY }}" != "" ]; then
38+
echo "✅ Using custom registry from repository variable"
39+
else
40+
echo "⚠️ Using fallback registry (no custom REGISTRY variable set)"
41+
fi
3042
- name: Set arch environment variable
3143
run: |
3244
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then
@@ -72,6 +84,13 @@ jobs:
7284
fi
7385
- name: Checkout
7486
uses: actions/checkout@v4
87+
- name: Debug Registry Configuration (UDI)
88+
run: |
89+
echo "🔍 UDI Registry Configuration Debug:"
90+
echo "Repository Variable (vars.REGISTRY): '${{ vars.REGISTRY }}'"
91+
echo "Resolved REGISTRY env var: '${{ env.REGISTRY }}'"
92+
echo "GitHub Repository: ${{ github.repository }}"
93+
echo "Target registry for UDI: ${{ env.REGISTRY }}/universal-developer-image"
7594
- name: Free runner space
7695
run: sudo rm -rf /usr/local/lib/android
7796
- name: Cleanup docker images
@@ -101,34 +120,54 @@ jobs:
101120
cd universal/ubi9 && docker buildx build \
102121
--platform linux/${{env.arch}} \
103122
--progress=plain \
104-
--push \
105123
-t ${{ env.REGISTRY }}/universal-developer-image:${{env.arch}}-pr-${{github.event.number}} .
124+
# TODO: Re-enable --push once repository permissions are fixed
125+
echo "Built but not pushed due to permission issues"
126+
127+
# TODO: Re-enable this job once repository permissions are fixed
128+
# publish-udi:
129+
# name: Publish udi
130+
# runs-on: ubuntu-22.04
131+
# needs: build-udi
132+
# steps:
133+
# - name: Login to Registry
134+
# uses: docker/login-action@v3
135+
# with:
136+
# registry: ${{ env.REGISTRY }}
137+
# username: ${{ secrets.QUAY_USERNAME }}
138+
# password: ${{ secrets.QUAY_PASSWORD }}
139+
# - name: publish
140+
# run: |
141+
# docker manifest create ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \
142+
# --amend ${{ env.REGISTRY }}/universal-developer-image:amd64-pr-${{github.event.number}} \
143+
# --amend ${{ env.REGISTRY }}/universal-developer-image:arm64-pr-${{github.event.number}}
144+
#
145+
# docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \
146+
# ${{ env.REGISTRY }}/universal-developer-image:amd64-pr-${{github.event.number}} \
147+
# --os linux --arch amd64
148+
# docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \
149+
# ${{ env.REGISTRY }}/universal-developer-image:arm64-pr-${{github.event.number}} \
150+
# --os linux --arch arm64
151+
#
152+
# docker manifest push ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}}
153+
# - name: 'Comment PR'
154+
# uses: actions/github-script@v7
155+
# with:
156+
# script: |
157+
# const { repo: { owner, repo } } = context;
158+
# await github.rest.issues.createComment({
159+
# issue_number: ${{github.event.number}},
160+
# owner: context.repo.owner,
161+
# repo: context.repo.repo,
162+
# body: `Pull Request images published ✨\n\nUDI: [${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}}](https://${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}})`
163+
# })
106164

107-
publish-udi:
108-
name: Publish udi
165+
# Temporary job to comment that UDI build was successful but not pushed
166+
comment-pr:
167+
name: Comment PR - UDI Build Status
109168
runs-on: ubuntu-22.04
110169
needs: build-udi
111170
steps:
112-
- name: Login to Registry
113-
uses: docker/login-action@v3
114-
with:
115-
registry: ${{ env.REGISTRY }}
116-
username: ${{ secrets.QUAY_USERNAME }}
117-
password: ${{ secrets.QUAY_PASSWORD }}
118-
- name: publish
119-
run: |
120-
docker manifest create ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \
121-
--amend ${{ env.REGISTRY }}/universal-developer-image:amd64-pr-${{github.event.number}} \
122-
--amend ${{ env.REGISTRY }}/universal-developer-image:arm64-pr-${{github.event.number}}
123-
124-
docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \
125-
${{ env.REGISTRY }}/universal-developer-image:amd64-pr-${{github.event.number}} \
126-
--os linux --arch amd64
127-
docker manifest annotate ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}} \
128-
${{ env.REGISTRY }}/universal-developer-image:arm64-pr-${{github.event.number}} \
129-
--os linux --arch arm64
130-
131-
docker manifest push ${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}}
132171
- name: 'Comment PR'
133172
uses: actions/github-script@v7
134173
with:
@@ -138,5 +177,5 @@ jobs:
138177
issue_number: ${{github.event.number}},
139178
owner: context.repo.owner,
140179
repo: context.repo.repo,
141-
body: `Pull Request images published ✨\n\nUDI: [${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}}](https://${{ env.REGISTRY }}/universal-developer-image:pr-${{github.event.number}})`
180+
body: `Pull Request images built successfully ✨\n\n📦 **Base Image:** Built and ready\n🔧 **UDI Image:** Built locally (not pushed due to permission issues)\n\n> Note: UDI push disabled temporarily. Check repository permissions for \`universal-developer-image\`.`
142181
})
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Example alternative approach for registry configuration
2+
# This approach uses repository ownership to determine registry
3+
4+
env:
5+
# More explicit registry determination based on repository ownership
6+
REGISTRY: ${{
7+
github.repository_owner == 'devfile' && 'quay.io/devfile' ||
8+
vars.REGISTRY ||
9+
format('ghcr.io/{0}', github.repository_owner)
10+
}}
11+
12+
# This approach:
13+
# 1. If repository owner is 'devfile' → use 'quay.io/devfile'
14+
# 2. Else if vars.REGISTRY is set → use that custom registry
15+
# 3. Else → use GitHub Container Registry with repository owner
16+
17+
# Alternative simple approach:
18+
# REGISTRY: ${{ vars.REGISTRY || format('ghcr.io/{0}', github.repository_owner) }}
19+
# This always uses the fork owner's GHCR unless vars.REGISTRY is explicitly set

.github/workflows/ubi10-build.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ jobs:
3232
steps:
3333
- name: Checkout
3434
uses: actions/checkout@v4
35+
- name: Debug Registry Configuration
36+
run: |
37+
echo "🔍 Registry Configuration Debug:"
38+
echo "Repository Variable (vars.REGISTRY): '${{ vars.REGISTRY }}'"
39+
echo "Resolved REGISTRY env var: '${{ env.REGISTRY }}'"
40+
echo "GitHub Repository: ${{ github.repository }}"
41+
echo "Repository Owner: ${{ github.repository_owner }}"
42+
if [ "${{ vars.REGISTRY }}" != "" ]; then
43+
echo "✅ Using custom registry from repository variable"
44+
else
45+
echo "⚠️ Using fallback registry (no custom REGISTRY variable set)"
46+
fi
3547
- name: Set arch environment variable
3648
run: |
3749
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then

.github/workflows/ubi9-build.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ jobs:
3333
steps:
3434
- name: Checkout
3535
uses: actions/checkout@v4
36+
- name: Debug Registry Configuration
37+
run: |
38+
echo "🔍 Registry Configuration Debug:"
39+
echo "Repository Variable (vars.REGISTRY): '${{ vars.REGISTRY }}'"
40+
echo "Resolved REGISTRY env var: '${{ env.REGISTRY }}'"
41+
echo "GitHub Repository: ${{ github.repository }}"
42+
echo "Repository Owner: ${{ github.repository_owner }}"
43+
if [ "${{ vars.REGISTRY }}" != "" ]; then
44+
echo "✅ Using custom registry from repository variable"
45+
else
46+
echo "⚠️ Using fallback registry (no custom REGISTRY variable set)"
47+
fi
3648
- name: Set arch environment variable
3749
run: |
3850
if [[ ${{matrix.runners}} == 'ubuntu-22.04' ]]; then

0 commit comments

Comments
 (0)