Skip to content

Instantly share code, notes, and snippets.

Avatar
👻
DevOps

Abderrazak BOUADMA abderrazak-bouadma

👻
DevOps
  • Kyriba
  • Paris
View GitHub Profile
@abderrazak-bouadma
abderrazak-bouadma / jenkins-api-start-and-monitor-a-build
Last active Jan 16, 2018 — forked from dapplebeforedawn/jenkins-api-start-and-monitor-a-build
Start a job with the Jenkins API and monitor it's console output
View jenkins-api-start-and-monitor-a-build
#! /usr/bin/env bash
JENKINS_URL="localhost:8080"
JOB_NAME="YourJobName
USER_NAME="api"
USER_TOKEN="f6706YOURUSERTOKENd2c51"
QUEUE_URL=$(curl --silent "http://${JENKINS_URL}/job/${JOB_NAME}/build" \
--user "${USER_NAME}:${USER_TOKEN}" \
--data "token=${JOB_TOKEN}" -XPOST \