Skip to content

Commit 6f0bba4

Browse files
feat: add support for Alpine packages updates
1 parent 4016b4e commit 6f0bba4

18 files changed

Lines changed: 204 additions & 546 deletions

.github/workflows/reusable-auto-pull-request-create.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,16 +138,12 @@ jobs:
138138
echo "EOF"
139139
} >> "$GITHUB_OUTPUT"
140140
141-
- name: Resolve CST image
141+
- name: Get test image ref
142142
id: cst-image
143143
if: steps.cst-configs.outputs.has_tests == 'true'
144144
run: |
145-
if task --list | grep -q "docker:image:test:ref"; then
146-
IMAGE_REF="$(task docker:image:test:ref)"
147-
else
148-
VERSION="$(task version:get)"
149-
IMAGE_REF="devopsinfra/${{ github.event.repository.name }}:${VERSION}-test"
150-
fi
145+
VERSION="$(task version:get)"
146+
IMAGE_REF="devopsinfra/${{ github.event.repository.name }}:${VERSION}-test"
151147
echo "image=$IMAGE_REF" >> "$GITHUB_OUTPUT"
152148
153149
- name: Run container structure tests

.github/workflows/reusable-cron-dependency-update.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,13 @@ jobs:
145145
echo "EOF"
146146
} >> "$GITHUB_OUTPUT"
147147
148-
- name: Resolve CST image
148+
- name: Get test image ref
149149
id: cst-image
150150
if: (inputs.profile == 'actions' || inputs.profile == 'dockerized') && steps.cst-configs.outputs.has_tests == 'true'
151151
continue-on-error: true
152152
run: |
153-
if task --list | grep -q "docker:image:test:ref"; then
154-
IMAGE_REF="$(task docker:image:test:ref)"
155-
else
156-
VERSION="$(task version:get)"
157-
IMAGE_REF="devopsinfra/${{ github.event.repository.name }}:${VERSION}-test"
158-
fi
153+
VERSION="$(task version:get)"
154+
IMAGE_REF="devopsinfra/${{ github.event.repository.name }}:${VERSION}-test"
159155
echo "image=$IMAGE_REF" >> "$GITHUB_OUTPUT"
160156
161157
- name: Run container structure tests

.github/workflows/reusable-manual-release-create.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,14 @@ jobs:
119119
echo "EOF"
120120
} >> "$GITHUB_OUTPUT"
121121
122-
- name: Resolve CST image
122+
- name: Get test image ref
123123
id: cst-image
124124
if: ${{ inputs.build-and-push-only && (inputs.profile == 'actions' || inputs.profile == 'dockerized') && steps.cst-configs.outputs.has_tests == 'true' }}
125125
env:
126126
VERSION_SUFFIX: ''
127127
run: |
128-
if task --list | grep -q "docker:image:test:ref"; then
129-
IMAGE_REF="$(task docker:image:test:ref)"
130-
else
131-
VERSION="$(task version:get)"
132-
IMAGE_REF="devopsinfra/${{ github.event.repository.name }}:${VERSION}"
133-
fi
128+
VERSION="$(task version:get)"
129+
IMAGE_REF="devopsinfra/${{ github.event.repository.name }}:${VERSION}"
134130
echo "image=$IMAGE_REF" >> "$GITHUB_OUTPUT"
135131
136132
- name: Run container structure tests

Taskfile.cicd.yml

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,6 @@ tasks:
110110
exit $rc
111111
fi
112112
113-
version:get:
114-
desc: Get current version
115-
cmds:
116-
- echo "{{.VERSION}}"
117-
118113
dependency:update:
119114
desc: Check main dependency not covered by dependabot
120115
cmds:
@@ -281,42 +276,7 @@ tasks:
281276
- git config user.name "github-actions[bot]"
282277
- git config user.email "github-actions[bot]@users.noreply.github.com"
283278

284-
sync:all:
285-
desc: Sync all common files
286-
cmds:
287-
- task sync:configs
288-
- task sync:ignores
289-
- task sync:taskfiles
290-
291-
sync:configs:
292-
desc: Sync configuration files with devops-infra/.github
293-
cmds:
294-
- |
295-
echo "▶️ Syncing configuration files from devops-infra/.github..."
296-
curl -fsSL {{.CONFIGS_BASE_URL}}/.editorconfig -o ./.editorconfig
297-
curl -fsSL {{.CONFIGS_BASE_URL}}/.pre-commit-config.yaml -o ./.pre-commit-config.yaml
298-
curl -fsSL {{.CONFIGS_BASE_URL}}/.shellcheckrc -o ./.shellcheckrc
299-
curl -fsSL {{.CONFIGS_BASE_URL}}/.yamllint.yml -o ./.yamllint.yml
300-
git add .editorconfig .pre-commit-config.yaml .shellcheckrc .yamllint.yml
301-
echo "✅ Synced configuration files"
302-
303-
sync:ignores:
304-
desc: Sync ignore files with devops-infra/.github
305-
cmds:
306-
- |
307-
echo "▶️ Syncing ignore files from devops-infra/.github..."
308-
curl -fsSL {{.CONFIGS_BASE_URL}}/.gitignore -o ./.gitignore
309-
git add .gitignore
310-
echo "✅ Synced ignore files"
311-
312-
sync:taskfiles:
313-
desc: Sync Taskfiles with devops-infra/.github
279+
version:get:
280+
desc: Get current version
314281
cmds:
315-
- |
316-
echo "▶️ Syncing Taskfiles from devops-infra/.github..."
317-
curl -fsSL {{.TASKFILES_BASE_URL}}/Taskfile.yml -o ./Taskfile.yml
318-
curl -fsSL {{.TASKFILES_BASE_URL}}/Taskfile.cicd.yml -o ./Taskfile.cicd.yml
319-
curl -fsSL {{.TASKFILES_BASE_URL}}/Taskfile.scripts.yml -o ./Taskfile.scripts.yml
320-
curl -fsSL {{.TASKFILES_BASE_URL}}/Taskfile.variables.yml -o ./Taskfile.variables.yml
321-
git add Taskfile*.yml
322-
echo "✅ Synced Taskfiles"
282+
- echo "{{.VERSION}}"

Taskfile.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ includes:
1111
taskfile: ./Taskfile.cicd.yml
1212
flatten: true
1313

14-
1514
tasks:
1615
default:
1716
desc: List tasks

templates/actions/configs/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
*
33

44
# Include
5+
!alpine-packages.txt
56
!Dockerfile
67
!LICENSE
78
!README.md
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bash~=5.3

templates/actions/taskfiles/Taskfile.cicd.yml

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,6 @@ tasks:
9090
exit $rc
9191
fi
9292
93-
version:get:
94-
desc: Get current version
95-
cmds:
96-
- echo "{{.VERSION}}"
97-
9893
dependency:update:
9994
desc: Check main dependency not covered by dependabot
10095
cmds:
@@ -272,44 +267,7 @@ tasks:
272267
- git config user.name "github-actions[bot]"
273268
- git config user.email "github-actions[bot]@users.noreply.github.com"
274269

275-
sync:all:
276-
desc: Sync all common files
277-
cmds:
278-
- task sync:configs
279-
- task sync:ignores
280-
- task sync:taskfiles
281-
282-
sync:configs:
283-
desc: Sync configuration files with devops-infra/.github
284-
cmds:
285-
- |
286-
echo "▶️ Syncing configuration files from devops-infra/.github..."
287-
curl -fsSL {{.CONFIGS_BASE_URL}}/.editorconfig -o ./.editorconfig
288-
curl -fsSL {{.CONFIGS_BASE_URL}}/.hadolint.yaml -o ./.hadolint.yaml
289-
curl -fsSL {{.CONFIGS_BASE_URL}}/.pre-commit-config.yaml -o ./.pre-commit-config.yaml
290-
curl -fsSL {{.CONFIGS_BASE_URL}}/.shellcheckrc -o ./.shellcheckrc
291-
curl -fsSL {{.CONFIGS_BASE_URL}}/.yamllint.yml -o ./.yamllint.yml
292-
git add .editorconfig .hadolint.yaml .pre-commit-config.yaml .shellcheckrc .yamllint.yml
293-
echo "✅ Synced configuration files"
294-
295-
sync:ignores:
296-
desc: Sync ignore files with devops-infra/.github
297-
cmds:
298-
- |
299-
echo "▶️ Syncing ignore files from devops-infra/.github..."
300-
curl -fsSL {{.CONFIGS_BASE_URL}}/.gitignore -o ./.gitignore
301-
curl -fsSL {{.CONFIGS_BASE_URL}}/.dockerignore -o ./.dockerignore
302-
git add .gitignore .dockerignore
303-
echo "✅ Synced ignore files"
304-
305-
sync:taskfiles:
306-
desc: Sync Taskfiles with devops-infra/.github
270+
version:get:
271+
desc: Get current version
307272
cmds:
308-
- |
309-
echo "▶️ Syncing Taskfiles from devops-infra/.github..."
310-
curl -fsSL {{.TASKFILES_BASE_URL}}/Taskfile.yml -o ./Taskfile.yml
311-
curl -fsSL {{.TASKFILES_BASE_URL}}/Taskfile.cicd.yml -o ./Taskfile.cicd.yml
312-
curl -fsSL {{.TASKFILES_BASE_URL}}/Taskfile.docker.yml -o ./Taskfile.docker.yml
313-
curl -fsSL {{.TASKFILES_BASE_URL}}/Taskfile.variables.yml -o ./Taskfile.variables.yml
314-
git add Taskfile*.yml
315-
echo "✅ Synced Taskfiles"
273+
- echo "{{.VERSION}}"

templates/actions/taskfiles/Taskfile.docker.yml

Lines changed: 0 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -3,136 +3,3 @@ version: '3'
33
silent: true
44

55
tasks:
6-
docker:image:test:ref:
7-
desc: Print test image reference for CST
8-
cmds:
9-
- echo "{{.DOCKER_NAME}}:{{.VERSION_FULL}}{{.VERSION_SUFFIX}}"
10-
11-
docker:login:
12-
desc: Login to hub.docker.com and ghcr.io
13-
cmds:
14-
- |
15-
set -eu
16-
docker_username='{{.DOCKER_USERNAME}}'
17-
github_username='{{.GITHUB_USERNAME}}'
18-
has_dockerhub=false
19-
has_ghcr=false
20-
21-
if [ -n "$docker_username" ] && [ -n "${DOCKER_TOKEN:-}" ]; then
22-
has_dockerhub=true
23-
fi
24-
25-
if [ -n "$github_username" ] && [ -n "${GITHUB_TOKEN:-}" ]; then
26-
has_ghcr=true
27-
fi
28-
29-
if [ "$has_dockerhub" = false ] && [ "$has_ghcr" = false ]; then
30-
echo "❌ No registry credentials provided. Set DOCKER_USERNAME/DOCKER_TOKEN or GITHUB_USERNAME/GITHUB_TOKEN."
31-
exit 1
32-
fi
33-
34-
if [ "$has_dockerhub" = true ]; then
35-
echo "Logging into Docker Hub as $docker_username"
36-
printf '%s' "${DOCKER_TOKEN}" | docker login -u "$docker_username" --password-stdin
37-
else
38-
echo "⚠️ Skipping Docker Hub login (missing DOCKER_USERNAME/DOCKER_TOKEN)"
39-
fi
40-
41-
if [ "$has_ghcr" = true ]; then
42-
echo "Logging into GHCR as $github_username"
43-
printf '%s' "${GITHUB_TOKEN}" | docker login ghcr.io -u "$github_username" --password-stdin
44-
else
45-
echo "⚠️ Skipping GHCR login (missing GITHUB_USERNAME/GITHUB_TOKEN)"
46-
fi
47-
48-
docker:cmds:
49-
desc: Show full docker build command
50-
cmds:
51-
- echo -e '{{.DOCKER_BUILD_START}} {{.DOCKER_BUILD_FINISH}}' | {{.SED}} 's/--/ \\\n --/g'
52-
53-
docker:build:
54-
desc: Build Docker image
55-
cmds:
56-
- docker buildx create --use
57-
- '{{.DOCKER_BUILD_START}} {{.DOCKER_BUILD_FINISH}}'
58-
59-
docker:build:inspect:
60-
desc: Inspect built Docker image
61-
cmds:
62-
- |
63-
image_inspect_out=$(docker image inspect {{.DOCKER_NAME}}:{{.VERSION_FULL}}{{.VERSION_SUFFIX}} | jq -r)
64-
echo -e "\nℹ️ Docker image inspect:"
65-
echo "$image_inspect_out" | jq
66-
67-
docker:push:
68-
desc: Build and push Docker images
69-
deps:
70-
- task: docker:login
71-
cmds:
72-
- docker buildx create --use
73-
- '{{.DOCKER_BUILD_START}} --push {{.DOCKER_BUILD_FINISH}}'
74-
75-
docker:push:inspect:
76-
desc: Inspect built Docker image
77-
cmds:
78-
- |
79-
set -eu
80-
image="{{.DOCKER_NAME}}:{{.VERSION_FULL}}{{.VERSION_SUFFIX}}"
81-
82-
echo -e "\nℹ️ Trying local image inspect: $image"
83-
set +e
84-
image_inspect_out=$(docker image inspect "$image" 2>/dev/null || true)
85-
rc=$?
86-
set -e
87-
88-
# Validate that docker inspect returned a non-empty array with an Id
89-
has_local=0
90-
if [ "$rc" -eq 0 ] && [ -n "$image_inspect_out" ]; then
91-
if echo "$image_inspect_out" | jq -e 'type=="array" and (length > 0) and \
92-
(.[0].Id != null and .[0].Id != "")' >/dev/null 2>&1; then
93-
has_local=1
94-
fi
95-
fi
96-
97-
if [ "$has_local" -eq 1 ]; then
98-
echo -e "\n✅ Local image found. Docker image inspect:"
99-
echo "$image_inspect_out" | jq
100-
image_sha=$(echo "$image_inspect_out" | jq -r '.[0].Id // empty')
101-
if [ -n "$image_sha" ]; then
102-
echo -e "\nℹ️ Docker manifest inspect (local):"
103-
docker manifest inspect "${image}@${image_sha}" | jq || true
104-
fi
105-
exit 0
106-
fi
107-
108-
echo -e "\nℹ️ Local image not found or inspect returned empty; inspecting remote with buildx imagetools..."
109-
set +e
110-
raw=$(docker buildx imagetools inspect --raw "$image" 2>/dev/null || true)
111-
set -e
112-
113-
if [ -z "$raw" ]; then
114-
echo "❌ Failed to inspect remote image with buildx imagetools: $image"
115-
exit 1
116-
fi
117-
118-
echo -e "\n✅ Remote manifest/index (raw):"
119-
echo "$raw" | jq
120-
121-
echo -e "\nℹ️ Attempting to pull and inspect per-platform manifests:"
122-
echo "$raw" | jq -r '.manifests[]?.digest' | while IFS= read -r digest; do
123-
if [ -z "$digest" ] || [ "$digest" = "null" ]; then
124-
continue
125-
fi
126-
ref="${image%@*}@${digest}"
127-
echo -e "\nℹ️ Pulling $ref (may fail for some registries)..."
128-
set +e
129-
docker pull "$ref" >/dev/null 2>&1 || true
130-
pulled_rc=$?
131-
set -e
132-
if [ "$pulled_rc" -eq 0 ]; then
133-
echo "ℹ️ Inspecting pulled image $ref"
134-
docker image inspect "$ref" | jq || true
135-
else
136-
echo "⚠️ Could not pull $ref; skipping image inspect"
137-
fi
138-
done

0 commit comments

Comments
 (0)