-
Notifications
You must be signed in to change notification settings - Fork 30
163 lines (136 loc) · 4.91 KB
/
pki-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
162
163
name: PKI Tests
on: [push, pull_request]
jobs:
init:
name: Initialization
uses: ./.github/workflows/init.yml
secrets: inherit
build:
name: Waiting for build
needs: init
runs-on: ubuntu-latest
steps:
- name: Wait for build
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Building JSS'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
if: github.event_name == 'push'
- name: Wait for build
uses: lewagon/[email protected]
with:
ref: ${{ github.event.pull_request.head.sha }}
check-name: 'Building JSS'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
if: github.event_name == 'pull_request'
pki-build-test:
name: Building PKI
needs: [init, build]
runs-on: ubuntu-latest
env:
SHARED: /tmp/workdir/jss
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Retrieve jss-runner image
uses: actions/cache@v3
with:
key: jss-runner-${{ github.sha }}
path: jss-runner.tar
- name: Load jss-runner image
run: docker load --input jss-runner.tar
- name: Run container
run: |
IMAGE=jss-runner \
NAME=pki \
HOSTNAME=pki.example.com \
tests/bin/runner-init.sh
- name: Import Tomcat JSS packages
run: |
docker pull quay.io/dogtagpki/tomcatjss-dist:7.7
docker create --name=tomcatjss-dist quay.io/dogtagpki/tomcatjss-dist:7.7
docker cp tomcatjss-dist:/root/RPMS/. /tmp/RPMS/
docker rm -f tomcatjss-dist
- name: Import LDAP SDK packages
run: |
docker pull quay.io/dogtagpki/ldapjdk-dist:4.23
docker create --name=ldapjdk-dist quay.io/dogtagpki/ldapjdk-dist:4.23
docker cp ldapjdk-dist:/root/RPMS/. /tmp/RPMS/
docker rm -f ldapjdk-dist
- name: Import IDM Console Framework packages
run: |
docker pull quay.io/dogtagpki/idm-console-framework-dist:1.3
docker create --name=idm-console-framework-dist quay.io/dogtagpki/idm-console-framework-dist:1.3
docker cp idm-console-framework-dist:/root/RPMS/. /tmp/RPMS/
docker rm -f idm-console-framework-dist
- name: Install build dependencies
run: |
docker cp /tmp/RPMS/. pki:/root/RPMS/
docker exec pki bash -c "dnf localinstall -y /root/RPMS/*"
docker exec pki dnf install -y git rpm-build
docker exec pki git clone \
-b v10.13 \
--single-branch \
https://github.com/dogtagpki/pki
docker exec pki dnf build-dep -y --spec pki/pki.spec
- name: Build and install PKI
run: |
docker exec pki pki/build.sh rpm
docker exec pki bash -c "dnf install -y /root/build/pki/RPMS/*.rpm"
ca-test:
name: Testing CA
needs: [init, build]
runs-on: ubuntu-latest
env:
SHARED: /tmp/workdir/jss
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Retrieve jss-runner image
uses: actions/cache@v3
with:
key: jss-runner-${{ github.sha }}
path: jss-runner.tar
- name: Load jss-runner image
run: docker load --input jss-runner.tar
- name: Run container
run: |
IMAGE=jss-runner \
NAME=pki \
HOSTNAME=pki.example.com \
tests/bin/runner-init.sh
- name: Install DS and PKI packages
run: docker exec pki dnf install -y 389-ds-base pki-ca
- name: Install DS
run: docker exec pki ${SHARED}/tests/bin/ds-create.sh
- name: Install CA
run: docker exec pki pkispawn -f /usr/share/pki/server/examples/installation/ca.cfg -s CA -v
- name: Run PKI healthcheck
run: docker exec pki pki-healthcheck --debug
- name: Verify CA admin
run: |
docker exec pki pki-server cert-export ca_signing --cert-file ca_signing.crt
docker exec pki pki client-cert-import ca_signing --ca-cert ca_signing.crt
docker exec pki pki client-cert-import \
--pkcs12 /root/.dogtag/pki-tomcat/ca_admin_cert.p12 \
--pkcs12-password-file /root/.dogtag/pki-tomcat/ca/pkcs12_password.conf
docker exec pki pki -n caadmin ca-user-show caadmin
- name: Gather artifacts
if: always()
run: |
tests/bin/ds-artifacts-save.sh pki
tests/bin/pki-artifacts-save.sh pki
- name: Remove CA
run: docker exec pki pkidestroy -i pki-tomcat -s CA -v
- name: Remove DS
run: docker exec pki ${SHARED}/tests/bin/ds-remove.sh
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v3
with:
name: ca
path: |
/tmp/artifacts/pki