|
2 | 2 |
|
3 | 3 | {% include 'header.j2' %} |
4 | 4 |
|
5 | | -# make sure this script runs at the repo root |
6 | | -cd "$(dirname "$(realpath -e "$0")")"/../../.. |
7 | | - |
8 | 5 | set -mveuo pipefail |
9 | 6 |
|
10 | | -if [ "${GITHUB_REF##refs/heads/}" = "${GITHUB_REF}" ] |
11 | | -then |
12 | | - BRANCH_BUILD=0 |
13 | | -else |
14 | | - BRANCH_BUILD=1 |
15 | | - BRANCH="${GITHUB_REF##refs/heads/}" |
16 | | -fi |
17 | | -if [ "${GITHUB_REF##refs/tags/}" = "${GITHUB_REF}" ] |
18 | | -then |
19 | | - TAG_BUILD=0 |
20 | | -else |
21 | | - TAG_BUILD=1 |
22 | | - BRANCH="${GITHUB_REF##refs/tags/}" |
23 | | -fi |
| 7 | +# make sure this script runs at the repo root |
| 8 | +cd "$(dirname "$(realpath -e "$0")")"/../../.. |
24 | 9 |
|
25 | | -COMMIT_MSG=$(git log --format=%B --no-merges -1) |
26 | | -export COMMIT_MSG |
| 10 | +export PRE_BEFORE_INSTALL=$PWD/.github/workflows/scripts/pre_before_install.sh |
| 11 | +export POST_BEFORE_INSTALL=$PWD/.github/workflows/scripts/post_before_install.sh |
27 | 12 |
|
28 | 13 | {% if setup_py -%} |
29 | 14 | COMPONENT_VERSION=$(sed -ne "s/\s*version.*=.*['\"]\(.*\)['\"][\s,]*/\1/p" setup.py) |
30 | 15 | {%- else -%} |
31 | 16 | COMPONENT_VERSION=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])") |
32 | 17 | {%- endif %} |
33 | 18 |
|
| 19 | +# Compose ansible container definition. |
34 | 20 | mkdir .ci/ansible/vars || true |
35 | 21 | echo "---" > .ci/ansible/vars/main.yaml |
36 | 22 | echo "legacy_component_name: {{ plugin_name | snake }}" >> .ci/ansible/vars/main.yaml |
37 | 23 | echo "component_name: {{ plugin_app_label }}" >> .ci/ansible/vars/main.yaml |
38 | 24 | echo "component_version: '${COMPONENT_VERSION}'" >> .ci/ansible/vars/main.yaml |
39 | 25 |
|
40 | | -export PRE_BEFORE_INSTALL=$PWD/.github/workflows/scripts/pre_before_install.sh |
41 | | -export POST_BEFORE_INSTALL=$PWD/.github/workflows/scripts/post_before_install.sh |
42 | | - |
43 | 26 | if [ -f $PRE_BEFORE_INSTALL ]; then |
44 | 27 | source $PRE_BEFORE_INSTALL |
45 | 28 | fi |
46 | 29 |
|
47 | | -if [ "$GITHUB_EVENT_NAME" = "pull_request" ] || [ "${BRANCH_BUILD}" = "1" -a "${BRANCH}" != "{{ plugin_default_branch }}" ] |
48 | | -then |
49 | | - echo $COMMIT_MSG | sed -n -e 's/.*CI Base Image:\s*\([-_/[:alnum:]]*:[-_[:alnum:]]*\).*/ci_base: "\1"/p' >> .ci/ansible/vars/main.yaml |
50 | | -fi |
51 | | - |
| 30 | +if [[ "$TEST" = "s3" ]]; then |
52 | 31 | for i in {1..3} |
53 | 32 | do |
54 | 33 | ansible-galaxy collection install "amazon.aws:8.1.0" && s=0 && break || s=$? && sleep 3 |
|
58 | 37 | echo "Failed to install amazon.aws" |
59 | 38 | exit $s |
60 | 39 | fi |
| 40 | +fi |
61 | 41 |
|
62 | 42 | if [[ "$TEST" = "pulp" ]]; then |
63 | 43 | python3 .ci/scripts/calc_constraints.py -u {% if setup_py -%} requirements.txt {% else -%} pyproject.toml {% endif -%} > upperbounds_constraints.txt |
|
0 commit comments