forked from laincloud/deployd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
47 lines (43 loc) · 2.3 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
sudo: required
language: go
go:
- 1.8.x
services:
- docker
install:
- go get -u github.com/golang/dep/cmd/dep
- go get github.com/aliyun/ossutil
before_script:
- dep ensure
- echo 'DOCKER_OPTS="-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster-store=etcd://127.0.0.1:2379 -s devicemapper"' | sudo tee /etc/default/docker > /dev/null
- sudo service docker restart
- ip=$(ip addr show eth0| grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*')
- curl -L https://github.com/coreos/etcd/releases/download/v2.3.7/etcd-v2.3.7-linux-amd64.tar.gz -o etcd-v2.3.7-linux-amd64.tar.gz
- tar xzvf etcd-v2.3.7-linux-amd64.tar.gz
- nohup ./etcd-v2.3.7-linux-amd64/etcd --listen-client-urls=http://$ip:2379,http://localhost:2379 --advertise-client-urls=http://$ip:2379 &
- cat /lib/systemd/system/docker.service
- docker network create hello
- docker pull swarm:1.2.8
- docker run -d --name swarm-manage.service -p 2376:2375 swarm:1.2.8 manage --replication --addr=$ip:2376 etcd://$ip:2379/lain/swarm
- docker run -d --name swarm-agent.service swarm:1.2.8 join --addr=$ip:2375 etcd://$ip:2379/lain/swarm
- docker ps -a
- docker -H :2376 info
script:
- go build -o bin/deployd main.go
- ./test.sh
after_success:
- bash <(curl -s https://codecov.io/bash)
- xz -9k bin/deployd
- if [ "$TRAVIS_TAG" != "" ]; then
ossutil cp bin/deployd.xz oss://lain/binary/deployd/releases/download/${TRAVIS_TAG}/deployd.xz -f -e ${ALIYUN_OSS_ENDPOINT} -i ${ALIYUN_OSS_ACCESS_KEY_ID} -k ${ALIYUN_OSS_ACCESS_KEY_SECRET};
fi
deploy:
provider: releases
api_key:
secure: NZjqwP3WFYrQSqwdad4HfdJKFGAOBuoRZx5CQQutg94Y92Le5JtgGXpzNSZA8jYoK5PjJCRBE0BQbT/VZv8DDN6U7qMhZkblaqeISxralrZZOh1wVA/bn6TlOcci2SYSMEVSakT/V4dwAJESO3P6KRZQUaOHktY0OlCZWp2n5NpLEQBf7H+r+UwibUoBizATrTfN+K0/2kbbyvx4G6Dcouo9T92N2A1di5ZUWCH6XBwdVOVRfco1Ove11PaEyrylQc08Mspo7KE44xLUDE4kvkjvlDZT34uAQn0cNF/EtWbF2oXsMRpNvr9d7H5iie8WEfbT5NYFb2gAp6fIvTdsCEhOOz6h5GIHHAeJGPtTg13g+ZW5jB+Yux/d/h5FNSYTkwn0ozPqMgBIn90as9qNkl+IQxasDlGb7j+C2PwF6DSsTIVM4yTGz+fzJV1dr4fu2Pb3ux4Gxbb9cXOzJAqBShh3xYS+XX3Vba8WOYI8iA7KMSC3ZJQ3L17HUOhQ7nKlR+5Ph5b5xUZ9TNQa6rdUEMItVPTrI7ZKOWXGY2xhEEc1It0t4np/AoWrLggyTwq8JDEAZwukbn+X1U4OD18gkFW5R0COtKT+r3URFRbgdv015H3KXz/2saIkVxJBIQCrxuJUC5dnCesZmupvYlQ5i9nyDiW1osOB+0zNOD084qU=
file:
- bin/deployd
- bin/deployd.xz
skip_cleanup: true
on:
tags: true