Skip to content

Instantly share code, notes, and snippets.

@sayadi
Created July 31, 2019 21:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sayadi/1d27149e3b09849ac1a291383f026f6a to your computer and use it in GitHub Desktop.
Save sayadi/1d27149e3b09849ac1a291383f026f6a to your computer and use it in GitHub Desktop.
version: 2
general:
branches:
only:
- dev
- staging
- prod
jobs:
build:
docker:
- image: spotify/alpine
steps:
- run:
name: Trigger the Build Job
command: |
printf "Setting up variables"# TODO Don't forget to put in your own values
ORGANIZATION=your_organization_name
PROJECT=your_project_name
BRANCH=$CIRCLE_BRANCH# BRANCH=desired_branch
printf "Triggering a(n) $PROJECT build on the $BRANCH branch\n\n"
BUILD_INFO=$(curl -X POST -H -d \
"{}" \
"https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/tree/$CIRCLE_BRANCH?circle-token=$CIRCLE_TOKEN")
printf "\n\nBuild triggered\n\n"printf "Follow the progress of the build on \nhttps://circleci.com/gh/$ORGANIZATION/$PROJECT/tree/$CIRCLE_BRANCH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment