Skip to content

Commit 12663ee

Browse files
committed
Merge remote-tracking branch 'common-upstream/main' into common-automatic-update
2 parents d504514 + 5315266 commit 12663ee

File tree

8 files changed

+74
-9
lines changed

8 files changed

+74
-9
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Run Bash Script on Multiple Distributions
2+
3+
on:
4+
push:
5+
paths:
6+
- "scripts/**"
7+
- "Makefile"
8+
branches:
9+
- main
10+
pull_request:
11+
paths:
12+
- "scripts/**"
13+
- "Makefile"
14+
15+
jobs:
16+
run-script:
17+
name: Run Bash Script
18+
strategy:
19+
matrix:
20+
# Fedora is not an option yet
21+
os: [ubuntu-latest, ubuntu-22.04]
22+
runs-on: ${{ matrix.os }}
23+
24+
steps:
25+
- name: Checkout Repository
26+
uses: actions/checkout@v4
27+
28+
- name: Install Podman on Ubuntu
29+
if: contains(matrix.os, 'ubuntu')
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y podman
33+
34+
# Currently we do not do MacOSX as it is not free, maybe in the future
35+
# - name: Install Podman on macOS
36+
# if: contains(matrix.os, 'macos')
37+
# run: |
38+
# brew install podman
39+
# podman machine init
40+
# podman machine start
41+
42+
- name: Verify Podman Installation
43+
run: podman --version
44+
45+
- name: Run pattern.sh script
46+
run: |
47+
export TARGET_BRANCH=main
48+
./scripts/pattern-util.sh make validate-origin

common/Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ endif
88
# the command line. I.e. we can set things without having to tweak values files
99
EXTRA_HELM_OPTS ?=
1010

11+
# This variable can be set in order to pass additional ansible-playbook arguments from the
12+
# the command line. I.e. we can set -vvv for more verbose logging
13+
EXTRA_PLAYBOOK_OPTS ?=
14+
1115
# INDEX_IMAGES=registry-proxy.engineering.redhat.com/rh-osbs/iib:394248
1216
# or
1317
# INDEX_IMAGES=registry-proxy.engineering.redhat.com/rh-osbs/iib:394248,registry-proxy.engineering.redhat.com/rh-osbs/iib:394249
@@ -18,7 +22,7 @@ TARGET_ORIGIN ?= origin
1822
# This is because we expect to use tokens for repo authentication as opposed to SSH keys
1923
TARGET_REPO=$(shell git ls-remote --get-url --symref $(TARGET_ORIGIN) | sed -e 's/.*URL:[[:space:]]*//' -e 's%^git@%%' -e 's%^https://%%' -e 's%:%/%' -e 's%^%https://%')
2024
# git branch --show-current is also available as of git 2.22, but we will use this for compatibility
21-
TARGET_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
25+
TARGET_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
2226

2327
UUID_FILE ?= ~/.config/validated-patterns/pattern-uuid
2428
UUID_HELM_OPTS ?=
@@ -111,7 +115,7 @@ secrets-backend-none: ## Edits values files to remove secrets manager + ESO
111115
.PHONY: load-iib
112116
load-iib: ## CI target to install Index Image Bundles
113117
@set -e; if [ x$(INDEX_IMAGES) != x ]; then \
114-
ansible-playbook rhvp.cluster_utils.iib_ci; \
118+
ansible-playbook $(EXTRA_PLAYBOOK_OPTS) rhvp.cluster_utils.iib_ci; \
115119
else \
116120
echo "No INDEX_IMAGES defined. Bailing out"; \
117121
exit 1; \

common/scripts/display-secrets-info.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ fi
2323

2424
PATTERN_NAME=$(basename "`pwd`")
2525

26-
ansible-playbook -e pattern_name="${PATTERN_NAME}" -e pattern_dir="${PATTERNPATH}" -e secrets_backing_store="${SECRETS_BACKING_STORE}" -e override_no_log=false "rhvp.cluster_utils.display_secrets_info"
26+
EXTRA_PLAYBOOK_OPTS="${EXTRA_PLAYBOOK_OPTS:-}"
27+
28+
ansible-playbook -e pattern_name="${PATTERN_NAME}" -e pattern_dir="${PATTERNPATH}" -e secrets_backing_store="${SECRETS_BACKING_STORE}" -e hide_sensitive_output=false ${EXTRA_PLAYBOOK_OPTS} "rhvp.cluster_utils.display_secrets_info"

common/scripts/load-k8s-secrets.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ PATTERNPATH=$(dirname "${COMMONPATH}")
1313

1414
PATTERN_NAME=${1:-$(basename "`pwd`")}
1515

16-
ansible-playbook -e pattern_name="${PATTERN_NAME}" -e pattern_dir="${PATTERNPATH}" "rhvp.cluster_utils.k8s_secrets"
16+
EXTRA_PLAYBOOK_OPTS="${EXTRA_PLAYBOOK_OPTS:-}"
17+
18+
ansible-playbook -e pattern_name="${PATTERN_NAME}" -e pattern_dir="${PATTERNPATH}" ${EXTRA_PLAYBOOK_OPTS} "rhvp.cluster_utils.k8s_secrets"

common/scripts/pattern-util.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ fi
6464
# if we are using podman machine then we do not bind mount anything (for now!)
6565
REMOTE_PODMAN=$(podman system connection list -q | wc -l)
6666
if [ $REMOTE_PODMAN -eq 0 ]; then # If we are not using podman machine we check the hosts folders
67-
# Use /etc/pki by default and try a couple of fallbacks if it does not exist
68-
if [ -d /etc/pki ]; then
67+
# We check /etc/pki/tls because on ubuntu /etc/pki/fwupd sometimes
68+
# exists but not /etc/pki/tls and we do not want to bind mount in such a case
69+
# as it would find no certificates at all.
70+
if [ -d /etc/pki/tls ]; then
6971
PKI_HOST_MOUNT_ARGS="-v /etc/pki:/etc/pki:ro"
7072
elif [ -d /etc/ssl ]; then
7173
PKI_HOST_MOUNT_ARGS="-v /etc/ssl:/etc/ssl:ro"
@@ -86,6 +88,7 @@ podman run -it --rm --pull=newer \
8688
-e EXTRA_PLAYBOOK_OPTS \
8789
-e TARGET_ORIGIN \
8890
-e TARGET_SITE \
91+
-e TARGET_BRANCH \
8992
-e NAME \
9093
-e TOKEN_SECRET \
9194
-e TOKEN_NAMESPACE \

common/scripts/process-secrets.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ PATTERNPATH=$(dirname "${COMMONPATH}")
1414
PATTERN_NAME=${1:-$(basename "`pwd`")}
1515
SECRETS_BACKING_STORE="$($SCRIPTPATH/determine-secretstore-backend.sh)"
1616

17-
ansible-playbook -e pattern_name="${PATTERN_NAME}" -e pattern_dir="${PATTERNPATH}" -e secrets_backing_store="${SECRETS_BACKING_STORE}" "rhvp.cluster_utils.process_secrets"
17+
EXTRA_PLAYBOOK_OPTS="${EXTRA_PLAYBOOK_OPTS:-}"
18+
19+
ansible-playbook -e pattern_name="${PATTERN_NAME}" -e pattern_dir="${PATTERNPATH}" -e secrets_backing_store="${SECRETS_BACKING_STORE}" ${EXTRA_PLAYBOOK_OPTS} "rhvp.cluster_utils.process_secrets"

common/scripts/vault-utils.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,6 @@ if [ -z ${TASK} ]; then
2525
exit 1
2626
fi
2727

28-
ansible-playbook -t "${TASK}" -e pattern_name="${PATTERN_NAME}" -e pattern_dir="${PATTERNPATH}" "rhvp.cluster_utils.vault"
28+
EXTRA_PLAYBOOK_OPTS="${EXTRA_PLAYBOOK_OPTS:-}"
29+
30+
ansible-playbook -t "${TASK}" -e pattern_name="${PATTERN_NAME}" -e pattern_dir="${PATTERNPATH}" ${EXTRA_PLAYBOOK_OPTS} "rhvp.cluster_utils.vault"

common/scripts/write-token-kubeconfig.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ SCRIPTPATH=$(dirname "${SCRIPT}")
1313
COMMONPATH=$(dirname "${SCRIPTPATH}")
1414
PATTERNPATH=$(dirname "${COMMONPATH}")
1515

16-
ansible-playbook -e pattern_dir="${PATTERNPATH}" -e kubeconfig_file="${OUTPUTFILE}" "rhvp.cluster_utils.write-token-kubeconfig"
16+
EXTRA_PLAYBOOK_OPTS="${EXTRA_PLAYBOOK_OPTS:-}"
17+
18+
ansible-playbook -e pattern_dir="${PATTERNPATH}" -e kubeconfig_file="${OUTPUTFILE}" ${EXTRA_PLAYBOOK_OPTS} "rhvp.cluster_utils.write-token-kubeconfig"

0 commit comments

Comments
 (0)