-
Notifications
You must be signed in to change notification settings - Fork 55
79 lines (72 loc) · 2.71 KB
/
pr_build_images.yaml
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
name: Build OCI Images
on:
- pull_request
env:
COLORTERM: 'yes'
TERM: 'xterm-256color'
PYTEST_ADDOPTS: '--color=yes'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# by default, it uses a depth of 1
# this fetches all history so that we can read each commit
fetch-depth: 0
- uses: actions/setup-python@v4
- name: Check commit message
if: github.event_name == 'pull_request'
env:
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
run: |
echo ::group::REQUESTS
pip install pygithub
echo ::endgroup::
for sha in $(curl $GITHUB_CONTEXT | jq '.[].sha' | sed 's/"//g')
do
python .ci/scripts/validate_commit_message.py $sha
VALUE=$?
if [ "$VALUE" -gt 0 ]; then
exit $VALUE
fi
done
shell: bash
build:
runs-on: ubuntu-latest
needs: lint
strategy:
fail-fast: false
matrix:
include:
- test_image: pulp-galaxy-ng
tag: "4.6"
- test_image: pulp
tag: "3.21"
- test_image: pulp-galaxy-ng
tag: "4.6-https"
- test_image: pulp
tag: "3.21-https"
steps:
- uses: actions/checkout@v4
- name: Set https build args
if: contains(fromJSON('["4.6-https", "3.21-https"]'), matrix.tag)
run: |
echo "BUILD_ARG=--build-arg SCHEME=https" >> $GITHUB_ENV
echo "TEST_ARG=https" >> $GITHUB_ENV
- name: Build the images
run: |
wget https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-x86_64.tar.xz
wget https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-noarch.tar.xz
wget https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-symlinks-arch.tar.xz
wget https://github.com/just-containers/s6-overlay/releases/download/v3.1.2.1/s6-overlay-symlinks-noarch.tar.xz
unxz s6-overlay*.tar.xz
gzip s6-overlay*.tar
LOCATION="${{ matrix.test_image }}"
docker build --file s6_images/pulp_ci_centos/Containerfile --tag pulp/pulp-ci-centos:${{ matrix.tag }} . ${{ env.BUILD_ARG }}
docker build --file "s6_images/${LOCATION//-/_}/Containerfile" --tag pulp/${{ matrix.test_image }}:${{ matrix.tag }} . --build-arg FROM_TAG=${{ matrix.tag }}
- name: Test the images
run: s6_images/assets/test.sh "pulp/${{ matrix.test_image }}:${{ matrix.tag }}" ${{ env.TEST_ARG }}
- name: Display log on error
if: failure()
run: docker logs pulp