forked from F5Networks/f5-ipam-controller
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
70 lines (68 loc) · 3.25 KB
/
.travis.yml
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
language: go
sudo: required
services:
- docker
git:
# don't limit git clone depth
depth: false
before_install:
- pyenv global 3.7.1
script:
- set -e
- if [ "$DOCKER_NAMESPACE" == "" ]; then DOCKER_NAMESPACE="local"; fi
- BASE_PUSH_TARGET="$DOCKER_NAMESPACE/f5-ipam-controller"
- |
if [ "$DOCKER_P" == "" -o "$DOCKER_U" == "" -o $DOCKER_NAMESPACE == "" ]; then
echo "[INFO] Docker user, password, or namespace vars absent from travis-ci."
echo "[INFO] See README.md section 'build' to configure travis with DockerHub."
else
docker login -u="$DOCKER_U" -p="$DOCKER_P"
DOCKER_READY="true"
fi
- export BUILD_VERSION=$(build-tools/version-tool.py version)
- export BUILD_INFO=$(build-tools/version-tool.py build-info)
- if [ "$TRAVIS_TAG" == "$TRAVIS_BRANCH" ]; then BUILD_VERSION=$TRAVIS_TAG; fi
- export IMG_TAG="${BASE_PUSH_TARGET}:${TRAVIS_COMMIT}"
- export BUILD_IMG_TAG="${BASE_PUSH_TARGET}-devel:${TRAVIS_COMMIT}"
- export BUILD_STAMP=devel-$TRAVIS_BRANCH-n-$TRAVIS_BUILD_NUMBER-id-$TRAVIS_BUILD_ID-$(date +%s)
- |
if [[ "$TRAVIS_BRANCH" == *"-stable" ]]; then
export CTLR_VERSION=v$(echo $TRAVIS_BRANCH | sed s/-stable//g)
export LICENSE_STRICT=false
elif [[ "$TRAVIS_BRANCH" =~ ^v[0-9]+\.[0-9]+\.[0-9]* ]]; then
va=( ${TRAVIS_BRANCH//./ } ) # replace decimals and split into array
export CTLR_VERSION="${va[0]}.${va[1]}"
export LICENSE_STRICT=true
else
export CTLR_VERSION=$TRAVIS_BRANCH
export LICENSE_STRICT=false
fi
- export CLEAN_BUILD=true
- export BASE_OS=debian
# - make verify
- make prod-quick
- docker tag "$IMG_TAG" "$BASE_PUSH_TARGET:devel-$TRAVIS_BRANCH"
- docker tag "$IMG_TAG" "$BASE_PUSH_TARGET:devel-$TRAVIS_BRANCH-n-$TRAVIS_BUILD_NUMBER-id-$TRAVIS_BUILD_ID"
- |
if [ "$DOCKER_READY" ]; then
docker tag "$IMG_TAG" "$BASE_PUSH_TARGET"
docker tag "$IMG_TAG" "$BASE_PUSH_TARGET:devel-$TRAVIS_BRANCH"
docker tag "$IMG_TAG" "$BASE_PUSH_TARGET:$BUILD_STAMP"
docker tag "$IMG_TAG" "$BASE_PUSH_TARGET:$BUILD_VERSION"
docker tag "$IMG_TAG" "$BASE_PUSH_TARGET:$BUILD_VERSION-$BUILD_INFO"
docker push "$IMG_TAG"
docker push "$BASE_PUSH_TARGET:devel-$TRAVIS_BRANCH"
docker push "$BASE_PUSH_TARGET:$BUILD_STAMP"
docker push "$BASE_PUSH_TARGET:$BUILD_VERSION"
docker push "$BASE_PUSH_TARGET:$BUILD_VERSION-$BUILD_INFO"
docker push "$BASE_PUSH_TARGET:latest"
fi
# - make docs
notifications:
slack:
rooms:
# k8s channel
- secure: DviXu1iLQaBbF3ya4PLvy/ln6OLTmhCOM3EJBsQpzCWG/YtdONKgOrSNTOqOu1iq3AcUehE2svSgTtg+9qvG+S5iiHwZ0QfJOvTWMr0CogNhb8S8/fVd66UP4oewdJOtyOTNj1F8AQld+8lJR39ZOgkeBKmTQduxv+rt3iJVHuBx9MLbiOTOYVlFQ4mQ+xkAMUPp/fuosjYCyeDYaWrQv6sWISnHShWV8cceCqyeSs+h3I8KOdNmsONkD6z1goqE5UbtZ5rUPLGU70FEoyG1lUCaLNq7f0oDpZGEYPPl9WhDUA1HVEiaArl0w7AneDDz0U5S2V2mwAWG+KYNyMtb5YYkzI2MccqiIPJiux+nUnpXy0cbwrRO1gg5L656dRshM78vp6MHVKDWo8cG+Xz4r6VsEbna3wA0fuIm1XrI/idTH4exGsf5NdoRjITCsNw6tdwaql+RdfMuzvHEd3GWb5oU+nuSf9HTsl4RD5kkNUBquQln/P0motyNmqTP2kCazO/AphV08k7cKxEWdfdR62ETs289spYWa7szGXv2sm/u6r2DakBNLWX6lQbDYRtWBVWclCrH5i1S7yANOnzzgiX4QCQ8Dtg++VvSDrPpH/Q0lYgyw0InPOJIeL1QiUmvVLeCFZnVANQbnn8bLWOJGAl82t2tvRLOT0OOUw+gic0=
on_success: change
on_failure: always
on_pull_requests: false