forked from JonasProgrammer/docker-machine-driver-hetzner
/
.travis.yml
41 lines (39 loc) · 2.44 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
# Builds the docker-machine-driver-hetzner and releases it, if the build is a tag
# (due to the deploy.on.tags=true below).
#
# To make it work, create and encrypt an OAuth token for the Github API as follows:
# (1) Go to https://github.com/settings/tokens and create a new private token
# with scope "public_repo".
# (2) Convert the token into a Travis secret as described at
# https://docs.travis-ci.com/user/encryption-keys/:
# * (assuming you are on a shell with the current working directory being
# inside a local working copy of your Github project)
# * gem install travis
# * travis encypt <the token created in step (1)>
# * add the secure: "<encrypted token>" to the travis.yml file as a key
# below the api_key
language: go
go:
- 1.9
before_deploy:
# Create binaries for many OSs and architures as tarballs.
# the -osarch="!a/b !c/d" option is used to exclude OS-arch pairs
# a/b and c/d from the build. OS-arch pairs might e.g. be excluded
# they failed to build.
- go get github.com/mitchellh/gox
- mkdir releases
- gox -osarch="!netbsd/arm !openbsd/386 !openbsd/amd64 !netbsd/386 !netbsd/amd64" -output="releases/{{.Dir}}_`git describe --tags --abbrev=0`_{{.OS}}_{{.Arch}}/{{.Dir}}"
# Below tar command will log an error because either ...-hetzner or
# ...-hetzner.exe are missing. The process continues, though and the
# created tarballs are fine.
- find releases -maxdepth 1 -mindepth 1 -type d -exec tar -cvzf {}.tar.gz -C {} docker-machine-driver-hetzner docker-machine-driver-hetzner.exe \;
deploy:
# See https://docs.travis-ci.com/user/deployment/releases/
provider: releases
api_key:
secure: "axqqN9jR04SeVkHJXLRFPGECdXWcryMMgQXtN5G5vBXyN4jaEl0L6uMxxRxO/v+XQc71lS3YR+6vgpqYgK5PSEORi8EDzGaiEzZN2Zg1YKX1vCP+n5FykKu+v/+j+S/ZCNI+gvW4hhgb4vFXzcy3OF/CKSKlzfIM9Gqx8VtHQ+C3EQPkW1xgpVoGmenU505DipDJHQkE99WTtUmV34hQagOcDDEUMotCEn653YOeuPMUpprmfpwthAtZbKNls//+TUWboYzLkqQlym0vuSnDVXCIxTjAtakAIhnPQfynh6DGVkQhdVSPD8epo1o36/K4DQrf49Mj+yIZxhJ9o27XPHPdnsnpslrZZl0ayQw4GHGwMq4eRUGxW/fLE64sCO18JZMd5qtU9K/z9cAcS480uZI0yzD94xROcvMeBxxGyt/aQU0oqnu/3b7QPzU0DR824gmBgtVCBkrg58pTMKHn5U+BosZjBjMMWcj8WAzVuJt7P81gMIzc7m7cpU2NWf5Z3RgBFgD4EfZrmCnlENzgMyXkWkqJYpVGOBB/DblTLp4t8v8T07QCBcD2oWd/dLvc816Ot0FXyIttQEhpEMRlYBpUSBjR5Nov8hYQdFebKUB+nDJoC+L73okf2BdST4v/LCN86bNregHL1DxRNB84vlSeMM2bC31DuiD0Z+dX7VI="
file_glob: true # enables wildcards in file names
file: "releases/*.tar.gz"
skip_cleanup: true
on:
tags: true