Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 1 | --- |
| 2 | - job-template: |
| 3 | # Job template for python verify jobs |
| 4 | # |
Jessica Wagantall | a0b80c6 | 2017-12-21 12:10:19 -0800 | [diff] [blame] | 5 | # The purpose of this job template is to run: |
| 6 | # 1. tox |
| 7 | # |
| 8 | # This job supports subprojects. |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 9 | # |
| 10 | # Required Variables: |
| 11 | # branch: git branch (eg. stable/lithium or master) |
| 12 | # Optional Variables: |
| 13 | # path: directory containing the project's tox.ini relative to |
| 14 | # the workspace. The default is the project root. |
| 15 | # pattern: ant file-path pattern relative to the workspace used to |
| 16 | # trigger the job |
| 17 | |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 18 | name: "{project-name}-{stream}-{subproject}-verify-python" |
| 19 | path: "$WORKSPACE" |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 20 | |
| 21 | project-type: freestyle |
| 22 | concurrent: true |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 23 | node: "{build-node}" |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 24 | |
Andrew Grimberg | 94ef33d | 2017-01-31 05:16:56 -0800 | [diff] [blame] | 25 | properties: |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 26 | - infra-properties: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 27 | build-days-to-keep: "{build-days-to-keep}" |
Andrew Grimberg | 94ef33d | 2017-01-31 05:16:56 -0800 | [diff] [blame] | 28 | |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 29 | parameters: |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 30 | - infra-parameters: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 31 | project: "{project}" |
| 32 | branch: "{branch}" |
| 33 | refspec: "refs/heads/{branch}" |
| 34 | artifacts: "{archive-artifacts}" |
Andrew Grimberg | dcdce33 | 2017-02-24 11:27:09 -0800 | [diff] [blame] | 35 | - maven-exec: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 36 | maven-version: "{maven-version}" |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 37 | |
| 38 | scm: |
| 39 | - gerrit-trigger-scm: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 40 | refspec: "$GERRIT_REFSPEC" |
| 41 | choosing-strategy: "gerrit" |
| 42 | submodule-recursive: "{submodule-recursive}" |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 43 | |
| 44 | wrappers: |
Andrew Grimberg | 4307a1c | 2017-03-16 13:00:00 -0700 | [diff] [blame] | 45 | - infra-wrappers: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 46 | build-timeout: "{build-timeout}" |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 47 | |
| 48 | triggers: |
Andrew Grimberg | 94ef33d | 2017-01-31 05:16:56 -0800 | [diff] [blame] | 49 | - gerrit-trigger-patch-submitted: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 50 | server: "{server-name}" |
| 51 | project: "{project}" |
| 52 | branch: "{branch}" |
| 53 | files: "{pattern}" |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 54 | |
| 55 | builders: |
Jessica Wagantall | 05ae7da | 2018-10-22 17:32:33 -0700 | [diff] [blame] | 56 | - lf-infra-pre-build |
Andrew Grimberg | d5410d1 | 2017-02-10 10:44:11 -0800 | [diff] [blame] | 57 | - provide-maven-settings: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 58 | global-settings-file: "global-settings" |
| 59 | settings-file: "{mvn-settings}" |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 60 | - shell: | |
Andrew Grimberg | 673c963 | 2017-02-16 06:21:00 -0800 | [diff] [blame] | 61 | #!/bin/bash |
Matthew Watkins | 1a16d1d | 2022-12-06 10:37:59 +0000 | [diff] [blame] | 62 | # shellcheck disable=SC1090 |
| 63 | source ~/lf-env.sh |
| 64 | |
| 65 | lf-activate-venv --python python3.8 --venv-file /tmp/.toxenv \ |
Matthew Watkins | aeea34a | 2023-04-26 11:44:01 +0100 | [diff] [blame] | 66 | tox virtualenv argparse webtest |
Matthew Watkins | 1a16d1d | 2022-12-06 10:37:59 +0000 | [diff] [blame] | 67 | |
| 68 | if [[ -d /opt/pyenv ]]; then |
| 69 | echo "---> Setting up pyenv" |
| 70 | export PYENV_ROOT="/opt/pyenv" |
| 71 | export PATH="$PYENV_ROOT/bin:$PATH" |
| 72 | PYTHONPATH="$(pwd)" |
| 73 | export PYTHONPATH |
| 74 | export TOX_TESTENV_PASSENV=PYTHONPATH |
| 75 | fi |
| 76 | |
Matthew Watkins | d2ad472 | 2023-01-24 10:21:32 +0000 | [diff] [blame] | 77 | python -m pip install --upgrade pip |
Matthew Watkins | d2ad472 | 2023-01-24 10:21:32 +0000 | [diff] [blame] | 78 | |
Matthew Watkins | 1a16d1d | 2022-12-06 10:37:59 +0000 | [diff] [blame] | 79 | # Useful debugging |
| 80 | python --version |
Matthew Watkins | d2ad472 | 2023-01-24 10:21:32 +0000 | [diff] [blame] | 81 | python -m pip freeze |
Matthew Watkins | 1a16d1d | 2022-12-06 10:37:59 +0000 | [diff] [blame] | 82 | tox --version |
| 83 | |
Matthew Watkins | d2ad472 | 2023-01-24 10:21:32 +0000 | [diff] [blame] | 84 | cd $WORKSPACE/{path} |
Andrew Grimberg | ebc710a | 2017-01-30 12:59:38 -0800 | [diff] [blame] | 85 | tox |
| 86 | |
Andrew Grimberg | 4ecb8f2 | 2017-04-06 13:57:46 -0700 | [diff] [blame] | 87 | publishers: |
Jessica Wagantall | 2a6a380 | 2021-01-14 12:19:17 -0800 | [diff] [blame] | 88 | - lf-infra-publish |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 89 | |
| 90 | - job-template: |
Jessica Wagantall | a0b80c6 | 2017-12-21 12:10:19 -0800 | [diff] [blame] | 91 | # Job template for docker daily jobs for 3 SCMs |
| 92 | # |
| 93 | # The purpose of this job template is to run: |
| 94 | # 1. inject a version properties file |
| 95 | # 2. login into the docker registry |
| 96 | # 4. run a specified shell script |
| 97 | # |
| 98 | # Required Variables: |
| 99 | # branch: git branch (eg. stable/lithium or master) |
| 100 | |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 101 | name: "{project-name}-{stream}-3scm-docker-shell-daily" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 102 | project-type: freestyle |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 103 | node: "queue-docker-4c-4g" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 104 | |
| 105 | properties: |
| 106 | - infra-properties: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 107 | build-days-to-keep: "{build-days-to-keep}" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 108 | |
| 109 | parameters: |
| 110 | - infra-parameters: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 111 | project: "{project}" |
| 112 | branch: "{branch}" |
| 113 | refspec: "refs/heads/{branch}" |
| 114 | artifacts: "{archive-artifacts}" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 115 | - maven-exec: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 116 | maven-version: "{maven-version}" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 117 | scm: |
| 118 | - gerrit-trigger-scm: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 119 | refspec: "" |
| 120 | choosing-strategy: "default" |
| 121 | submodule-recursive: "{submodule-recursive}" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 122 | |
| 123 | wrappers: |
gwu | adeda5a | 2018-07-17 14:12:09 -0700 | [diff] [blame] | 124 | - infra-wrappers-docker-build: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 125 | build-timeout: "{build-timeout}" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 126 | |
| 127 | triggers: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 128 | - timed: "H */4 * * *" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 129 | - gerrit-trigger-release-manually: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 130 | server: "{server-name}" |
| 131 | project: "{project}" |
| 132 | branch: "{branch}" |
Gary Wu | 601a2ff | 2018-07-30 17:50:12 -0700 | [diff] [blame] | 133 | - gerrit-trigger-patch-merged: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 134 | server: "{server-name}" |
| 135 | project: "{project}" |
| 136 | branch: "{branch}" |
| 137 | files: "**" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 138 | |
| 139 | builders: |
Jessica Wagantall | 05ae7da | 2018-10-22 17:32:33 -0700 | [diff] [blame] | 140 | - lf-infra-pre-build |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 141 | - provide-maven-settings: |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 142 | global-settings-file: "global-settings" |
| 143 | settings-file: "{mvn-settings}" |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 144 | - inject: |
| 145 | properties-file: version.properties |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 146 | - docker-login |
Andrew Grimberg | c1f3caf | 2023-05-03 09:25:07 -0700 | [diff] [blame] | 147 | - shell: "{script}" |
Jessica Wagantall | 2a6a380 | 2021-01-14 12:19:17 -0800 | [diff] [blame] | 148 | |
Jerry Flood | ffab4f7 | 2017-05-02 16:00:03 -0400 | [diff] [blame] | 149 | publishers: |
Jessica Wagantall | 2a6a380 | 2021-01-14 12:19:17 -0800 | [diff] [blame] | 150 | - lf-infra-publish |