-
Notifications
You must be signed in to change notification settings - Fork 1
/
travis-ci.sh
executable file
·27 lines (25 loc) · 1.21 KB
/
travis-ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
set -x
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d "
{
\"username\": \"$DOCKER_USERNAME\",
\"password\": \"$DOCKER_PASSWORD\"
}
" https://hub.docker.com/v2/users/#/ | jq -r .token)
#http --follow https://gist.githubusercontent.com/jdewinne/3f13494858fad8b6b2b88ebd3439f1ea/raw/2ca20118482b7790fdbc0a1e3cbe6a3d4e78933b/dockertags > ./dockertags
chmod +x dockertags
image_name="xebialabsunsupported/xlr_dev_run"
./dockertags -i xebialabs/xl-release -e "(centos|amazonlinux|debian-slim)$" > /tmp/xlr
./dockertags -i $image_name > /tmp/xl
echo "$DOCKER_PASSWORD" | docker login --username="$DOCKER_USERNAME" --password-stdin
while read tag ; do
echo "####################################################################"
echo "#### $image_name:$tag builing"
docker build -t $image_name:$tag --build-arg xlr_tag=$tag .
echo "#### $image_name:$tag built"
docker push $image_name:$tag
echo "#### $image_name:$tag pushed"
echo "####################################################################"
docker push $image_name:$tag
done < <(comm -23 <(sort /tmp/xlr) <(sort /tmp/xl))