This repository has been archived by the owner on Jul 29, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
.travis.yml
82 lines (78 loc) · 3.63 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
71
72
73
74
75
76
77
78
79
80
81
82
language: go
sudo: required
services:
- docker
git:
# don't limit git clone depth
depth: false
before_install:
- docker pull golang:1.7.5
- docker pull f5devcentral/containthedocs
script:
- set -e
- if [ "$DOCKER_NAMESPACE" == "" ]; then DOCKER_NAMESPACE="local"; fi
- BASE_PUSH_TARGET="$DOCKER_NAMESPACE/cf-bigip-ctlr"
- |
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 DEVEL.md section 'Travis Builds' 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 version)
- export BUILD_INFO=$(build-tools/version-tool 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=alpine
- make verify
- make prod
- 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
deploy:
- provider: script
skip_cleanup: true
on:
all_branches: true
repo: F5Networks/cf-bigip-ctlr
condition: $TRAVIS_BRANCH == *"-stable" || "$TRAVIS_BRANCH" =~ ^v[0-9]+\.[0-9]+\.[0-9]*
script:
- ./build-tools/deploy-docs.sh publish-product-docs-to-prod connectors/cf-bigip-ctlr $CTLR_VERSION
notifications:
slack:
rooms:
# cloud-foundry channel
- secure: ZtCTWHavj3oGCuz9pbs1aMLx9ducWyr6/lcmjL2x42AtzN14claWS4SW724bSrFppxftPqo73pt7S+XgjoW80+uaHN5mjTLwFbdZw2mkeeBs7k+VOniyAIRSgFsXLEO+1yeV38tP8bIXmZyNotqPKBmdeVSDmU+ITYQZfwzAW5wSm3PDICgUsZ6Bz3zMw8Fnq+lG9AW8/kygeHPIfiW0LZCDqNxuDvmxcp3QTOnk9Vuub9l0oEwcUTJitphP4ONaChOhUHUHTcC1JJq2e7LOJzK/PiR2lak86988gcVEp88N89p1aJUZZz51zfT0lJPpgM2LTw6TkBfI27mqNFZ8UmwcyOd04ZoAs9WRL1vXm9bY2YTL9+JKfsb2yT6vyw325Cs0U6KgI885IMNosjzgljeDnHJUhAqLvRZaRWmLLjH4Oo1ZHT0yTZq59rGDNqpkBiIvNs0TInwUFDnSoQ5t6xtPV6nmtEhjfhIDO1W+yHf8xQ1MjuhOPqybsk9mbh5aqHGSBunvLwl+bTn0a0WBk3KnIsd2AIvttJQMqOcD4z1+UuXFpMLCSSQwZjUyVxKXh9HkzWMAJNfdZfGYRr07wA4uSqWOol7p9l7AIE8AfX38+CwDOQbzJqV7gqur+g8dfF0XO2z2i9NODSV9FFe8fJg4TbeXKu0Gy6MEYTCkn1U=
on_success: change
on_failure: always
on_pull_requests: false