123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- #!/bin/bash
- set -xeuo pipefail
- pip install requests
- query_github() {
- repo=$1; shift
- resource=$1; shift
- python -c "
- import sys
- import requests
- j = requests.get('https://api.github.com/repos/$repo/$resource').json()
- for q in sys.argv[1:]:
- if q.isdigit():
- q = int(q)
- j = j[q]
- print(j)" "$@"
- }
- if [ -n "${PAPR_BRANCH:-}" ]; then
- target_branch=$PAPR_BRANCH
- else
-
- target_branch=$(query_github $PAPR_REPO pulls/$PAPR_PULL_ID base ref)
- [ -n "$target_branch" ]
- fi
- git clone --branch $target_branch --single-branch https://github.com/openshift/origin
- export OPENSHIFT_IMAGE_TAG=$(git -C origin describe --abbrev=0)
- echo "Targeting OpenShift Origin $OPENSHIFT_IMAGE_TAG"
- pip install -r requirements.txt
- ansible -vvv -i .papr.inventory nodes -a 'rpm-ostree status'
- upload_journals() {
- mkdir journals
- for node in master node1 node2; do
- ssh ocp-$node 'journalctl --no-pager || true' > journals/ocp-$node.log
- done
- }
- trap upload_journals ERR
- ansible-playbook -vvv -i .papr.inventory playbooks/byo/config.yml -e "openshift_image_tag=$OPENSHIFT_IMAGE_TAG"
|