#!/usr/bin/env bash # shellcheck disable=SC1091,SC2015 [[ "$0" == /* ]] && typeset -r PRG=$0 || typeset -r PRG=$PWD/$0 BINDIR=$(dirname "$PRG") typeset -r BINDIR source "${BINDIR}/lib/logging.sh" TARGET=$1 if [ -z "$TARGET" ]; then log::fatal "No target specified on command line" fi log::debug "Starting gate open for Ul11u4SRU" log::debug "Target: \"${TARGET}\"" JENKINS_TOKEN='1154eb0158729a7d326c1db13e7dca0cea' JENKINS_SERVER='http://mrshughes.us.oracle.com/jenkins/' JOB_URL="${JENKINS_SERVER}/job/Solaris_11/job/11.4/job/userland-sru/job/userland-sru-gate-open-11.4/buildWithParameters" log::info "Using '${JOB_URL}'" curl -X POST "${JOB_URL}" \ --user "pnyc:${JENKINS_TOKEN}" \ --data-urlencode "Build_Label=${TARGET}" \ --data-urlencode "hguser=petr.nyc@oracle.com" \ --data-urlencode "dryrun=false" \ --data-urlencode "verbose=true" \ --data-urlencode "debug=true" \ --data-urlencode "scriptdir=./solaris/userland/sru/" \ --data-urlencode "do_gate_open=true" log::info "The job will be started here:" log::info " ${JOB_URL%%buildWith*}"