Sergey Galkin | 24ebd76 | 2020-01-14 14:36:34 +0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | set -e |
| 3 | cd "$(dirname "$0")" |
| 4 | ### Prepare |
| 5 | if [ ! -d .venv ]; then |
| 6 | echo "Can't find python virtal env, installing" |
| 7 | virtualenv -p python3 .venv |
| 8 | fi |
| 9 | if [ -z "$(./.venv/bin/pip freeze | grep jenkins-job-builder)" ]; then |
| 10 | ./.venv/bin/pip install 'jenkins-job-builder>=2.0.0.0b2' |
| 11 | fi |
| 12 | |
| 13 | ### Check ini file |
| 14 | CFG_FILE="${HOME}/.config/sre-jenkins-job-builder.ini" |
| 15 | if [ ! -f "$CFG_FILE" ]; then |
| 16 | cat << EOF |
| 17 | Can't find configuration file $CFG_FILE |
| 18 | Please create this file from this template with your user and password |
| 19 | For security reasons do not use password from LDAP and |
| 20 | use API key generated in http://sre-ci.scc.mirantis.net/user/\$USER/configure. |
| 21 | File example: |
| 22 | EOF |
| 23 | cat config/sre-jenkins-job-builder-example.ini |
| 24 | exit 1 |
| 25 | fi |
| 26 | # ./.venv/bin/jenkins-jobs --conf $CFG_FILE test ./ |
| 27 | ./.venv/bin/jenkins-jobs --conf $CFG_FILE update ./ |