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