Skip to content

Commit 3e2fb83

Browse files
committed
update ci workflow to push to both quay repos
1 parent f602b30 commit 3e2fb83

5 files changed

Lines changed: 116 additions & 14 deletions

File tree

.github/workflows/container-test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
22
name: "Container build and test"
3-
on: [push, pull_request]
3+
4+
on:
5+
pull_request:
6+
branches: ["main"]
7+
8+
permissions: read-all
49

510
jobs:
611
podman-build:
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
name: Docker build and push to quay
3+
permissions: read-all
4+
5+
on:
6+
push:
7+
branches: ['main']
8+
tags: ['v*.*.*']
9+
10+
env:
11+
REGISTRY: quay.io
12+
13+
jobs:
14+
build-container-and-push:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
image:
19+
- name: hybridcloudpatterns/utility-container
20+
username_secret: LEGACY_QUAY_USERNAME
21+
password_secret: LEGACY_QUAY_PASSWORD
22+
- name: validatedpatterns/utility-container
23+
username_secret: QUAY_USERNAME
24+
password_secret: QUAY_PASSWORD
25+
permissions:
26+
contents: read
27+
packages: write
28+
# This is used to complete the identity challenge
29+
# with sigstore/fulcio when running outside of PRs.
30+
id-token: write
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v5
35+
36+
- name: Set up QEMU
37+
uses: docker/setup-qemu-action@v3
38+
39+
# Install the cosign tool
40+
# https://github.com/sigstore/cosign-installer
41+
- name: Install cosign
42+
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
43+
with:
44+
cosign-release: 'v2.2.4'
45+
46+
# Set up BuildKit Docker container builder to be able to build
47+
# multi-platform images and export cache
48+
# https://github.com/docker/setup-buildx-action
49+
- name: Set up Docker Buildx
50+
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
51+
52+
# Login against a Docker registry
53+
# https://github.com/docker/login-action
54+
- name: Log into registry ${{ env.REGISTRY }}
55+
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
56+
with:
57+
registry: ${{ env.REGISTRY }}
58+
username: ${{ secrets[matrix.image.username_secret] }}
59+
password: ${{ secrets[matrix.image.password_secret] }}
60+
61+
# Extract metadata (tags, labels) for Docker
62+
# https://github.com/docker/metadata-action
63+
- name: Extract Docker metadata
64+
id: meta
65+
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
66+
with:
67+
images: ${{ env.REGISTRY }}/${{ matrix.image.name }}
68+
69+
# Build and push Docker image with Buildx
70+
# https://github.com/docker/build-push-action
71+
- name: Build and push Docker image
72+
id: build-and-push
73+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
74+
with:
75+
context: .
76+
file: Containerfile
77+
platforms: linux/amd64,linux/arm64
78+
push: true
79+
tags: ${{ steps.meta.outputs.tags }}
80+
labels: ${{ steps.meta.outputs.labels }}
81+
cache-from: type=gha
82+
cache-to: type=gha,mode=max
83+
84+
# Sign the resulting Docker image digest.
85+
# This will only write to the public Rekor transparency log when the Docker
86+
# repository is public to avoid leaking data. If you would like to publish
87+
# transparency data even for private images, pass --force to cosign below.
88+
# https://github.com/sigstore/cosign
89+
- name: Sign the published Docker image
90+
env:
91+
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
92+
TAGS: ${{ steps.meta.outputs.tags }}
93+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
94+
# This step uses the identity token to provision an ephemeral certificate
95+
# against the sigstore community Fulcio instance.
96+
run: echo "${TAGS}" | xargs -I "{}" cosign sign --yes "{}@${DIGEST}"

.github/workflows/superlinter.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
22
name: Super linter
33

4-
on: [push, pull_request]
4+
on:
5+
pull_request:
6+
branches: ["main"]
57

68
jobs:
79
build:

Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ TAG ?= latest
33
CONTAINER ?= $(NAME):$(TAG)
44

55
REGISTRY ?= localhost
6-
UPLOADREGISTRY ?= quay.io/hybridcloudpatterns
6+
UPLOADREGISTRY ?= quay.io/validatedpatterns
77
TESTCOMMAND := "set -e; echo '* Helm: '; helm version; \
88
echo '* ArgoCD: '; argocd version --client ; \
99
echo '* Tekton: '; tkn version ; \
@@ -161,7 +161,7 @@ super-linter: ## Runs super linter locally
161161
ghcr.io/super-linter/super-linter:slim-v8
162162

163163
.PHONY: upload
164-
upload: ## Uploads the container to quay.io/hybridcloudpatterns/${CONTAINER}
164+
upload: ## Uploads the container to quay.io/validatedpatterns/${CONTAINER}
165165
@echo "Uploading the ${REGISTRY}/${CONTAINER} container to ${UPLOADREGISTRY}/${CONTAINER}"
166166
buildah manifest push --all "${REGISTRY}/${CONTAINER}" "docker://${UPLOADREGISTRY}/${CONTAINER}"
167167

@@ -200,4 +200,3 @@ cluster-stop: ## Stops the hosted-cluster machines
200200
-v ${HOME}:${HOME} \
201201
-v ${HOME}/.aws:/pattern-home/.aws \
202202
"${REGISTRY}/${CONTAINER}" python3 /usr/local/bin/stop-instances.py -f ${CLUSTER}
203-

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Validated Pattern Utility Container
1+
# Validated Patterns Utility Container
22

3-
[![Quay Repository](https://img.shields.io/badge/Quay.io-utility--container-blue?logo=quay)](https://quay.io/repository/hybridcloudpatterns/utility-container)
3+
[![Quay Repository](https://img.shields.io/badge/Quay.io-utility--container-blue?logo=quay)](https://quay.io/repository/validatedpatterns/utility-container)
44

55
A utility container for simplified execution of imperative commands in each of the Validated Patterns.
66

@@ -17,12 +17,12 @@ This container provides a pre-configured environment with all the necessary tool
1717
|ansible-runner |pip |2.4.1 |
1818
|ansible.utils |collection|6.0.0 |
1919
|argocd |binary |v2.9.7+fbb6b20|
20-
|awscli |pip |1.42.18 |
20+
|awscli |pip |1.42.20 |
2121
|awx.awx |collection|24.6.1 |
2222
|awxkit |pip |24.6.1 |
2323
|azure-cli |pip |2.76.0 |
24-
|boto3 |pip |1.40.18 |
25-
|botocore |pip |1.40.18 |
24+
|boto3 |pip |1.40.20 |
25+
|botocore |pip |1.40.20 |
2626
|community.general |collection|11.2.1 |
2727
|community.okd |collection|5.0.0 |
2828
|gcloud |pip |0.18.3 |
@@ -57,7 +57,7 @@ This container provides a pre-configured environment with all the necessary tool
5757
### Pull the Image
5858

5959
```bash
60-
podman pull quay.io/hybridcloudpatterns/utility-container:latest
60+
podman pull quay.io/validatedpatterns/utility-container:latest
6161
```
6262

6363
### Examples
@@ -70,7 +70,7 @@ podman run --rm -it --net=host \
7070
-v ${HOME}:/pattern \
7171
-v ${HOME}:${HOME} \
7272
-w $(pwd) \
73-
quay.io/hybridcloudpatterns/utility-container:latest sh
73+
quay.io/validatedpatterns/utility-container:latest sh
7474
```
7575

7676
**Execute an Ansible playbook**
@@ -81,7 +81,7 @@ podman run --rm -it --net=host \
8181
-v ${HOME}:/pattern \
8282
-v ${HOME}:${HOME} \
8383
-w $(pwd) \
84-
quay.io/hybridcloudpatterns/utility-container:latest \
84+
quay.io/validatedpatterns/utility-container:latest \
8585
ansible-playbook <playbook>.yml
8686
```
8787

@@ -93,7 +93,7 @@ podman run --rm -it --net=host \
9393
-v ${HOME}:/pattern \
9494
-v ${HOME}:${HOME} \
9595
-w $(pwd) \
96-
quay.io/hybridcloudpatterns/utility-container:latest \
96+
quay.io/validatedpatterns/utility-container:latest \
9797
oc get nodes
9898
```
9999

0 commit comments

Comments
 (0)