-
Notifications
You must be signed in to change notification settings - Fork 139
161 lines (138 loc) · 4.71 KB
/
acme-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: ACME Tests
on: [push, pull_request]
env:
BASE_IMAGE: ${{ vars.BASE_IMAGE || 'registry.fedoraproject.org/fedora:latest' }}
COPR_REPO: ${{ vars.COPR_REPO || '@pki/master' }}
jobs:
build:
name: Building ACME images
runs-on: ubuntu-latest
env:
NAMESPACE: ${{ vars.REGISTRY_NAMESPACE || 'dogtagpki' }}
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Update Dockerfile
run: |
# update registry namespace
sed -i "s/quay.io\/dogtagpki\//quay.io\/$NAMESPACE\//g" Dockerfile
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
id: cache-buildx
uses: actions/cache@v4
with:
key: buildx-${{ hashFiles('pki.spec') }}
path: /tmp/.buildx-cache
- name: Build pki-deps image
uses: docker/build-push-action@v5
with:
context: .
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
COPR_REPO=${{ env.COPR_REPO }}
tags: pki-deps
target: pki-deps
cache-to: type=local,dest=/tmp/.buildx-cache
if: steps.cache-buildx.outputs.cache-hit != 'true'
- name: Build pki-builder-deps image
uses: docker/build-push-action@v5
with:
context: .
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
COPR_REPO=${{ env.COPR_REPO }}
tags: pki-builder-deps
target: pki-builder-deps
cache-to: type=local,dest=/tmp/.buildx-cache
if: steps.cache-buildx.outputs.cache-hit != 'true'
- name: Build pki-runner image
uses: docker/build-push-action@v5
with:
context: .
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
COPR_REPO=${{ env.COPR_REPO }}
BUILD_OPTS=--with-pkgs=base,server,ca,acme --without-test
tags: pki-runner
target: pki-runner
cache-from: type=local,src=/tmp/.buildx-cache
outputs: type=docker
- name: Build pki-acme image
uses: docker/build-push-action@v5
with:
context: .
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
COPR_REPO=${{ env.COPR_REPO }}
BUILD_OPTS=--with-pkgs=base,server,ca,acme --without-test
tags: pki-acme
target: pki-acme
cache-from: type=local,src=/tmp/.buildx-cache
outputs: type=docker
- name: Save ACME images
run: |
docker images
docker save -o acme-images.tar pki-runner pki-acme
- name: Store ACME images
uses: actions/cache@v4
with:
key: acme-images-${{ github.sha }}
path: acme-images.tar
acme-basic-test:
name: Basic ACME
needs: build
uses: ./.github/workflows/acme-basic-test.yml
acme-separate-test:
name: ACME on separate instance
needs: build
uses: ./.github/workflows/acme-separate-test.yml
acme-existing-nssdb-test:
name: ACME with existing NSS database
needs: build
uses: ./.github/workflows/acme-existing-nssdb-test.yml
acme-switchover-test:
name: ACME server switchover
needs: build
uses: ./.github/workflows/acme-switchover-test.yml
acme-container-test:
name: ACME container
needs: build
uses: ./.github/workflows/acme-container-test.yml
acme-postgresql-test:
name: ACME with postgresql back-end
needs: build
uses: ./.github/workflows/acme-postgresql-test.yml
publish:
if: github.event_name == 'push' && github.ref_name == 'master'
name: Publishing ACME images
needs: build
runs-on: ubuntu-latest
env:
NAMESPACE: ${{ vars.REGISTRY_NAMESPACE || github.repository_owner }}
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: vars.REGISTRY == 'ghcr.io'
- name: Log in to other container registry
uses: docker/login-action@v3
with:
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
if: vars.REGISTRY != 'ghcr.io'
- name: Retrieve ACME images
uses: actions/cache@v4
with:
key: acme-images-${{ github.sha }}
path: acme-images.tar
- name: Load ACME images
run: docker load --input acme-images.tar
- name: Publish pki-acme image
run: |
docker tag pki-acme ${{ vars.REGISTRY }}/$NAMESPACE/pki-acme:latest
docker push ${{ vars.REGISTRY }}/$NAMESPACE/pki-acme:latest