Skip to content
Snippets Groups Projects
Commit c18ffd56 authored by Gabriel Engel's avatar Gabriel Engel
Browse files

trying to fix docker hub triggers

parent 820ed44a
No related branches found
No related tags found
No related merge requests found
......@@ -2,22 +2,18 @@
set -euo pipefail
IFS=$'\n\t'
# TRAVIS_TAG='v0.7'
# TAG="v0.7"
# TRAVIS_BUILD_NUMBER="1234"
# TRAVIS_BRANCH="develop"
# PUSHTOKEN="secret"
CURL_HEADER="Content-Type: application/json"
CURL_URL="https://registry.hub.docker.com/u/rocketchat/rocket.chat/trigger/$PUSHTOKEN/"
if [ -z ${TRAVIS_TAG+x} ];
then
CURL_DATA='{"source_type": "Branch", "source_name": "'$TRAVIS_BRANCH'", "docker_tag": "'$TRAVIS_BUILD_NUMBER.$TRAVIS_BRANCH'"}';
if [ "$TRAVIS_TAG" ]; then
CURL_DATA='{"source_type": "Tag", "source_name": "'$TRAVIS_TAG'", "docker_tag": "'$TRAVIS_TAG'"}';
else
CURL_DATA='{"source_type": "Tag", "source_name": "'$TRAVIS_TAG'", "docker_tag": "'$TRAVIS_BUILD_NUMBER.$TRAVIS_BRANCH.$TRAVIS_TAG'"}';
if [ "$TRAVIS_BRANCH" = "master" ]; then
CURL_DATA='{"source_type": "Branch", "source_name": "master", "docker_tag": "latest"}';
else
CURL_DATA='{"source_type": "Branch", "source_name": "'$TRAVIS_BRANCH'", "docker_tag": "'$TRAVIS_BRANCH'"}';
fi
fi
curl -H "${CURL_HEADER}" --data "${CURL_DATA}" -X POST "${CURL_URL}"
echo -H "${CURL_HEADER}" --data "${CURL_DATA}" -X POST $CURL_URL
curl -H "${CURL_HEADER}" --data "${CURL_DATA}" -X POST $CURL_URL
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment