CezarLeahu 3a0725ee77
ACS-457: Build linkage, tagging and release (#4)
* ACS-457: Build linkage, tagging and release

- update .travis.settings.xml

* ACS-457: Build linkage, tagging and release

- add cleanup_cache.sh script

* ACS-457: Build linkage, tagging and release

- add init.sh script for before_install job phases

* ACS-457: Build linkage, tagging and release

- add build.sh script for install job phases

* ACS-457: Build linkage, tagging and release

- minor updates on the older travis and veracode scripts

* ACS-457: Build linkage, tagging and release

- reorganized and updated .travis.yml

* ACS-457: Build linkage, tagging and release

- add remote branch validation in the trigger_travis.sh script

* ACS-457: Build linkage, tagging and release

- update and propagate branch version numbers during the build

* ACS-457: Build linkage, tagging and release

- enable docker image squash for all image builds

* ACS-457: Build linkage, tagging and release

- shellcheck CI scripts

* ACS-457: Build linkage, tagging and release

- switch to TEST pom versions

* ACS-457: Build linkage, tagging and release

- post-merge fixes

* ACS-457: Build linkage, tagging and release

- update trigger_travis.sh scrips so they offer more debug info

* ACS-457: Build linkage, tagging and release

- clone upstream repositories with "--depth=1" (no history needed)
- add "-Dmaven.javadoc.skip=true" options in the build scripts

* ACS-457: Build linkage, tagging and release

- remove <scm> configuration from sub-modules
- remove <distributionManagement> configurations from submodules
- remove <repository> configuration from poms
- remove unnecessary and unused POM profiles

* ACS-457: Build linkage, tagging and release

- add pom <pluginManagement> section
- removed some plugin versions from downstream modules
- add a single common configuration for the *maven-relese-plugin*

* ACS-457: Build linkage, tagging and release

- post-merge fixes

* ACS-457: Build linkage, tagging and release

- update and reorganize the fabric8-maven-plugin configuration

* ACS-457: Build linkage, tagging and release

- extra debug info on the trigger_travis.sh scripts

* ACS-457: Build linkage, tagging and release

- modify the build.sh scripts so they checkout the upstream project tag

* ACS-457: Build linkage, tagging and release

- test different token variable for propagating builds

* ACS-457: Build linkage, tagging and release

- re-implement build.sh script logic to support PRs & branch builds
- restricted the build.sh script capabilities
- moved build functions to a separate .sh file

* ACS-457: Build linkage, tagging and release

- update release scripts

* ACS-457: Build linkage, tagging and release

- debug build scripts

* ACS-457: Build linkage, tagging and release

- fix build scripts

* ACS-457: Build linkage, tagging and release

- setup/update the S3 publishing jobs

* ACS-457: Build linkage, tagging and release

- update build scripts
- remove a few unnecessary TODOs

* ACS-457: Build linkage, tagging and release

- disable release jobs for now
2020-08-12 00:24:51 +03:00

49 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -ev
USER=${1}
REPO=${2}
BRANCH=${3}
if [ "${TRAVIS_PULL_REQUEST}" != "false" ]; then
echo "Downstream projects shouldn't be triggered from PR builds"
exit 1
fi
if ! git ls-remote --exit-code --heads "https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/${USER}/${REPO}.git" "${BRANCH}" ; then
echo "Branch \"${BRANCH}\" not found on the downstream repository ${USER}/${REPO}. Exiting..."
exit 0
fi
URL="https://api.travis-ci.com/repo/${USER}%2F${REPO}/requests"
BODY="{
\"request\": {
\"branch\":\"${BRANCH}\"
}}"
printf "Travis API call:\n URL: %s\n Body: %s\n\n" "${URL}" "${BODY}"
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token ${TRAVIS_ACCESS_TOKEN_TEMP}" \
-d "${BODY}" \
"${URL}" \
| tee /tmp/travis-request-output.txt
cat /tmp/travis-request-output.txt
if grep -q '"@type": "error"' /tmp/travis-request-output.txt; then
echo "Error when triggering build..."
exit 2
fi
if grep -q 'access denied' /tmp/travis-request-output.txt; then
echo "Access denied when triggering build..."
exit 3
fi
exit 0