forked from frodenas/gcs-resource
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (45 loc) · 4.14 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
sudo: required
language: go
go_import_path: github.com/frodenas/gcs-resource
services:
- docker
jobs:
include:
- stage: Unit tests
script: make
- stage: Integration tests
if: type != pull_request
env:
- GOOGLE_APPLICATION_CREDENTIALS=$TRAVIS_BUILD_DIR/client_secrets.json
- secure: j2PI4lSeuvVRY2FE0CcDc8O6k+jDq5QUGBPWuoGi3+PM6+f5j5QQjA2T7afsp2bG9e7EQ64n0gB2ks/antXHgViyNJ3nMiCtSfVpUmWHlIC/6dfhUdA+FQzjfSwJ7vhJKXDH81Cin509uSZQ+eHwl+ZSUV/7db6K7RdK7GKzxZr92rhBlBo4l+GC83im/9iWEpj5YNMmxjC2EXxXiW0XebUm2Y0+isYnTrEgcwR6L1XOV8CP30Pwmhk+k5KnbX4rWLhznQwkHZPbc+zjBUIep5mzc7wujwPM+HMb7ohzqYmeGziIAEGv99Rsz71oLoT5sjE/KTiNVRHvZxqws0OWjxsy8uo7eB433Tfm4mU2ctj/mNFsoZ/wWPoDUXA5sXeoWJ6URtnwtjjO3lgoaAx+2Gv2Zm/w9a18O2PNfjO9k9gRSxMl7fkvmiaadz91OSZascfIZqI3M+Z2o8XOIZXH5VIGovY0SfHFCYODybXpWrakuZ01O9cEDAi2zBc2nucgHNJM7ivp0SVwZGi35uiotxkXEtaHisSnSygAL1Vi9UUP9e+iDqR5zY63J0mkeA/LHo+N2Ob0fA1NFzWk/wxx9/0NFgav0Fq2/rIj27PJpzI9n8S9u16vcgkWCyrsmfTvMSsPppG82VwIrlMM6J52u9xiloysFfZel3GzNZwNRcg=
- secure: pWzKFugsT6DHAh6D5NmNx+4mbsPlNGQdXSvFUfO3nDj3CJ7SSTt+mxAifcFrymPCTc3YnMjXR1u5gldWNcZnYXw5ObUm8+e+HTYhN9dSTLBhczr4+b7p4fJ6D+Ke99PF4HoZirQOHFW169jU4YVpz6yV6WIycWXlgeVBSp3eFdJvCh6FiQN17Ym3POxt8CMuy03QfFnd2qQ9x9XfQliOlsn4ZjCQRJfX7IRAiK31/Lb4cdlyswMcgnN3W/O2Sdeh4b26Rp+OoBRbyeF2rSLN1hfarHbCTMEgaI4HrGFZ5d4nTkVbscMsapufgrBwOsI/HvbEWRK7E1NEubD4isgOGMpZuU4IJgbsegKcf/qAkIJfMfk9VxZpHftBRQ+Va6J4Nv8L5VPngtOfa8Ct3QIUV4MmK+RLzAFoT66iu4qRFQL3WUyRZavKgXZekYcThfF9JfPWhcDQf+FlwJdP9uVMSG6PEzX+GK0vRQG/7c0egcpFBYOlYiM745ZissoFJY8bMT9O0UL4lYtsLUpwBJbp6gnaGFwerGSPPhnKocFF73Z6yeMpcYCAFbPh0RdgLh8PfS9xbduIABuW8F37j0DS9je6AlJ1cQ8pjmYlWa395cAidz2WPR7aZbzgH4xEMTzVYfqqgfxCBYnwN19gG1XDm5iG8KA9eDrTm0sbcDDLPyg=
script:
- openssl aes-256-cbc -K $encrypted_901c39c3ea3a_key -iv $encrypted_901c39c3ea3a_iv -in client_secrets.json.enc -out $GOOGLE_APPLICATION_CREDENTIALS -d
- make integration-tests
- stage: Build docker image
env:
- DOCKER_IMAGE_NAME=frodenas/gcs-resource
- secure: RPUd4pA+kb1xRdZ2flCGv/BEa4jlMk9pm+WH9yyIUxnjift9TWwUHAfOi1Qbng+FU7hZ0RMaiyvtt969Soscf52auBV5RWZlhBfBa6C3noxqdHkRHOQ1DUOXtKiEn77Kn2/SaM06CRMSeVL2ivmwHUdo2p496jxK0LEerofe0zSqhy6Ra5gFhTttX3InTYMGmqH0+R9YZdOm/5nO5f4RhXQtAtMRg+qkkQpa7ecDQiOkFctdbK3NBkmi9c+IxlUoOZBml6J+4G5+pd9mLlucEzjhYbpgc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C4u8ON4GTYcdu2M=
script:
- |
if [ -n "$TRAVIS_TAG" ]; then
DOCKER_IMAGE_TAG=$TRAVIS_TAG
else
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
DOCKER_IMAGE_TAG=$TRAVIS_BRANCH
else
DOCKER_IMAGE_TAG=$TRAVIS_PULL_REQUEST_BRANCH
fi
fi
- make docker DOCKER_IMAGE_NAME=$DOCKER_IMAGE_NAME DOCKER_IMAGE_TAG=$DOCKER_IMAGE_TAG
- |
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+(\.[0-9]+){2}$ ]]; then
docker tag "$DOCKER_IMAGE_NAME:$TRAVIS_TAG" "$DOCKER_IMAGE_NAME:latest"
fi
- docker images
- |
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
docker push $DOCKER_IMAGE_NAME
fi