Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA: build RHEL and Amazon Linux #9266

Merged
merged 6 commits into from
Mar 2, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 35 additions & 7 deletions .github/workflows/rpm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,39 @@ on:

jobs:
rpm:
name: .rpm
name: .rpm (${{ matrix.distro.name }}, ${{ matrix.distro.release }})

strategy:
fail-fast: false
matrix:
distro:
- name: rhel
release: 8
subscription: true
- name: rhel
release: 7
subscription: true
- name: centos
release: 7
subscription: false
- name: amazon-linux
release: al2:x86_64
subscription: true
- name: fedora
release: 35
subscription: false
- name: fedora
release: 34
subscription: false
- name: sles
release: '15.3'
subscription: true
- name: sles
release: '12.5'
subscription: true
- name: opensuse
release: '15.3'
subscription: false

runs-on: ubuntu-latest

Expand All @@ -41,10 +56,10 @@ jobs:
- name: Vars
id: vars
env:
GITLAB_REGISTRY_RO_TOKEN: '${{ secrets.GITLAB_REGISTRY_RO_TOKEN }}'
GITLAB_RO_TOKEN: '${{ secrets.GITLAB_RO_TOKEN }}'
run: |
if [ '${{ matrix.distro.name }}' = sles ]; then
if [ "$(tr -d '\n' <<<"$GITLAB_REGISTRY_RO_TOKEN" |wc -c)" -eq 0 ]; then
if [ ${{ matrix.distro.subscription }} = true ]; then
if [ "$(tr -d '\n' <<<"$GITLAB_RO_TOKEN" |wc -c)" -eq 0 ]; then
echo '::set-output name=CAN_BUILD::false'
echo '::set-output name=NEED_LOGIN::false'
else
Expand All @@ -63,17 +78,30 @@ jobs:
- name: Login
if: "steps.vars.outputs.NEED_LOGIN == 'true'"
env:
GITLAB_REGISTRY_RO_TOKEN: '${{ secrets.GITLAB_REGISTRY_RO_TOKEN }}'
GITLAB_RO_TOKEN: '${{ secrets.GITLAB_RO_TOKEN }}'
run: |
docker login registry.icinga.com -u build-docker/sles --password-stdin <<<"$GITLAB_REGISTRY_RO_TOKEN"
docker login registry.icinga.com -u github-actions --password-stdin <<<"$GITLAB_RO_TOKEN"

- name: rpm-icinga2
if: "steps.vars.outputs.CAN_BUILD == 'true'"
if: "steps.vars.outputs.CAN_BUILD == 'true' && !matrix.distro.subscription"
run: |
set -exo pipefail
git clone https://git.icinga.com/packaging/rpm-icinga2.git
chmod o+w rpm-icinga2

- name: subscription-rpm-icinga2
if: "steps.vars.outputs.CAN_BUILD == 'true' && matrix.distro.subscription"
env:
GITLAB_RO_TOKEN: '${{ secrets.GITLAB_RO_TOKEN }}'
run: |
set -exo pipefail
git config --global credential.helper store
cat <<EOF >~/.git-credentials
https://github-actions:${GITLAB_RO_TOKEN}@git.icinga.com
EOF
git clone https://git.icinga.com/packaging/subscription-rpm-icinga2.git rpm-icinga2
chmod o+w rpm-icinga2

- name: Restore/backup ccache
if: "steps.vars.outputs.CAN_BUILD == 'true'"
id: ccache
Expand Down