File tree Expand file tree Collapse file tree 8 files changed +74
-9
lines changed Expand file tree Collapse file tree 8 files changed +74
-9
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 88# the command line. I.e. we can set things without having to tweak values files
99EXTRA_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
1923TARGET_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
2327UUID_FILE ?= ~/.config/validated-patterns/pattern-uuid
2428UUID_HELM_OPTS ?=
@@ -111,7 +115,7 @@ secrets-backend-none: ## Edits values files to remove secrets manager + ESO
111115.PHONY : load-iib
112116load-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; \
Original file line number Diff line number Diff line change 2323
2424PATTERN_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"
Original file line number Diff line number Diff line change @@ -13,4 +13,6 @@ PATTERNPATH=$(dirname "${COMMONPATH}")
1313
1414PATTERN_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"
Original file line number Diff line number Diff line change 6464# if we are using podman machine then we do not bind mount anything (for now!)
6565REMOTE_PODMAN=$( podman system connection list -q | wc -l)
6666if [ $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 \
Original file line number Diff line number Diff line change @@ -14,4 +14,6 @@ PATTERNPATH=$(dirname "${COMMONPATH}")
1414PATTERN_NAME=${1:- $(basename " ` pwd` " )}
1515SECRETS_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"
Original file line number Diff line number Diff line change @@ -25,4 +25,6 @@ if [ -z ${TASK} ]; then
2525 exit 1
2626fi
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"
Original file line number Diff line number Diff line change @@ -13,4 +13,6 @@ SCRIPTPATH=$(dirname "${SCRIPT}")
1313COMMONPATH=$( dirname " ${SCRIPTPATH} " )
1414PATTERNPATH=$( 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"
You can’t perform that action at this time.
0 commit comments