Ocelot-Social/scripts/trigger.sh
Robert Schäfer 0a8aadbb2d Check out a common branch through environment var
This will be useful if we trigger the build through the Travis CI API
where we can alter the environment variables in the request.
2018-12-10 00:17:34 +01:00

29 lines
613 B
Bash
Executable File

#!/usr/bin/env bash
body=$(cat<< EOF
{
"request": {
"branch":"e2e",
"message": "Triggered by \`$TRAVIS_REPO_SLUG\` on \`$TRAVIS_BRANCH\`",
"config": {
"merge_mode": "deep_merge",
"env": {
"global": {
"DOCKER_COMPOSE_VERSION":"1.23.2",
"COMMON_BRANCH": "$TRAVIS_BRANCH"
}
}
}
}
}
EOF
)
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token $TRAVIS_TOKEN" \
-d "$body" \
https://api.travis-ci.com/repo/Human-Connection%2FHuman-Connection/requests