parent
eb9d882449
commit
f13f3c71c7
3 changed files with 123 additions and 0 deletions
@ -0,0 +1,41 @@ |
|||||||
|
#!/usr/bin/env bash |
||||||
|
|
||||||
|
# exec &> >(tee -a "${SYSLOG}") |
||||||
|
# exec &> >(tee -a "${APPLOG}") |
||||||
|
|
||||||
|
trap 'exit 1' HUP INT QUIT TERM |
||||||
|
|
||||||
|
log::prefix() { |
||||||
|
date=$(gdate '+%Y-%m-%d %H:%M:%S,%3N') |
||||||
|
printf '%s %s\n' "${date}" "${*}" |
||||||
|
} |
||||||
|
|
||||||
|
log::notice() { |
||||||
|
log::info "==> ${*}" |
||||||
|
} |
||||||
|
|
||||||
|
log::info() { |
||||||
|
log::prefix "INFO ${*}" |
||||||
|
} |
||||||
|
|
||||||
|
log::debug() { |
||||||
|
log::prefix "DEBUG ${*}" |
||||||
|
} |
||||||
|
|
||||||
|
log::warning() { |
||||||
|
log::prefix "WARNING ${*}" |
||||||
|
} |
||||||
|
|
||||||
|
log::error() { |
||||||
|
log::prefix "ERROR ${*}" >&2 |
||||||
|
} |
||||||
|
|
||||||
|
log::fatal() { |
||||||
|
reason='Unknown or not specified' |
||||||
|
if [ "$1" ]; then |
||||||
|
reason=$1 |
||||||
|
fi |
||||||
|
log::error "Fatal error. Reason: ${reason}" |
||||||
|
kill -s TERM $$ |
||||||
|
} |
||||||
|
|
||||||
@ -0,0 +1,41 @@ |
|||||||
|
#!/usr/bin/env bash |
||||||
|
|
||||||
|
source lib/logging.sh |
||||||
|
|
||||||
|
TARGET=$1 |
||||||
|
|
||||||
|
|
||||||
|
if [ -z "$TARGET" ]; |
||||||
|
then |
||||||
|
log::fatal "No target specified on command line" |
||||||
|
fi |
||||||
|
|
||||||
|
log::info"Starting build for for Ul11u4SRU" |
||||||
|
log::info "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-build-11.4/buildWithParameters" |
||||||
|
|
||||||
|
log::info "Using '${JOB_URL}'" |
||||||
|
|
||||||
|
set -x |
||||||
|
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_check_sru_cbe=true" \ |
||||||
|
--data-urlencode "prepare_work_area=true" \ |
||||||
|
--data-urlencode "do_build=true" \ |
||||||
|
--data-urlencode "prepare_delivery=true" \ |
||||||
|
--data-urlencode "create_escrow=true" \ |
||||||
|
--data-urlencode "create_foss=true" \ |
||||||
|
--data-urlencode "delivery=true" |
||||||
|
|
||||||
|
log::info "The job will be started here:" |
||||||
|
log::info " ${JOB_URL%%buildWith*}" |
||||||
@ -0,0 +1,41 @@ |
|||||||
|
#!/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*}" |
||||||
Loading…
Reference in new issue