forked from openpitrix/openpitrix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
79 lines (79 loc) · 3.68 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
sudo: required
env:
- CHANGE_MINIKUBE_NONE_USER=true TEST_WITH_K8S=1
services:
- docker
language: go
go:
- '1.10'
- '1.11'
go_import_path: openpitrix.io/openpitrix
addons:
apt:
packages:
- docker-ce
before_install:
- if [ "TRAVIS_REPO_SLUG" = "openpitrix/openpitrix" ]; then openssl aes-256-cbc -K $encrypted_31dac1cc4b44_key -iv $encrypted_31dac1cc4b44_iv -in key.yaml.enc -out key.yaml -d;fi
- sudo docker run -d -it --name nsenter ubuntu:16.04 bash
- sudo docker cp nsenter:/usr/bin/nsenter /usr/local/bin/nsenter
- sudo docker stop nsenter && sudo docker rm nsenter
- sudo curl -L "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname
-s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubectl
&& chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-linux-amd64
&& chmod +x minikube && sudo mv minikube /usr/local/bin/
- sudo minikube start --vm-driver=none --kubernetes-version=v1.10.0
- minikube update-context
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}';
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do
sleep 1; done
- DESIRED_VERSION=2.9.1 curl https://raw.githubusercontent.com/helm/helm/master/scripts/get
| DESIRED_VERSION=v2.9.1 bash
- "./deploy/kubernetes/scripts/init-helm.sh"
- until helm list -a; do sleep 1; done
install:
- curl https://pek3a.qingstor.com/releases-qs/qsctl/qsctl-latest-linux.tar.gz -O
- tar -xzvf qsctl-latest-linux.tar.gz
before_script:
- docker --version
- docker-compose --version
- kubectl cluster-info
- make fmt-check
- docker build -t openpitrix -f ./Dockerfile .
- docker build -t openpitrix:metadata -f ./Dockerfile.metadata .
- make compose-up
- sleep 20
script:
- make unit-test && travis_wait 30 make e2e-test WITH_K8S=yes
before_deploy:
- make clean
- make release-openpitrix-$TRAVIS_TAG
- make bin-release-openpitrix-$TRAVIS_TAG
- cd image/amazon-linux/; tar -czvf amazon-linux.tar.gz *;cd ../..
- cd image/ubuntu/; tar -czvf ubuntu.tar.gz *;cd ../..
deploy:
- provider: releases
api_key:
secure: k6pBb0kP99Sb0ZmJjncWZNugdUpT90dwWmvnlG4j8t+U61QarfgarR1RdDi8fYLKdioIOwfduH3SU5iq1Xtc4qV62f1J0mXvoRalcEhCeh16edaBxSIs1akUNirNjAvosKURcqmVpUXo+iRFhSI2708J2XBl8sogAqnuuW49LbcrsY7K4DrFFujjysBeSZDaRxPU8nMFykHNSrbEQgw2u/YK6PI0jg73RDhAfnr6cPfZr0ZJDr0ykLrra6faZLANR9khXKaTCN5JT3enI6ufd4bAY0WvjM6XeNLU9vWGeB5QbJErvLlkANrrtkCA6mRDVh6kUxkEM0R1VirGR4XJMk+kVdCzgJV4bpmQSzFhHVbr0g2+4hqeAvNrbVjGq6z9orbv//Lkg7IXhu21u/wcgSAzBWHZdMpoaAVPvySJSVAIhdCgJD5Q3Ebh7L3olLnQ0MWWf95Mz21jTaH0F76pe3Kcu/p3ATSsomZQL9ez+W1A0P+3Bxcjk4fjqjQDkrwBqxo4wTb0Oix66eZFJtwPWKqu0erzuViprSDi6+vwPydjt9ADxMWescFc53sfFPkQWzVC6Pfbxdqt4jCcgRBPipzchsbxHYaofKzfMJrJYIx67iR5Ai9Z8Nwwki6rGXocuR06uhuIyyN4j0yR6Y9qiCslvLUbptsU69WDkMlsOwI=
file:
- deploy/openpitrix-$TRAVIS_TAG-kubernetes.tar.gz
- deploy/openpitrix-$TRAVIS_TAG-bin.tar.gz
skip_cleanup: true
on:
repo: openpitrix/openpitrix
tags: true
- provider: script
script: bash docker_push latest
on:
branch: master
repo: openpitrix/openpitrix
- provider: script
script: bash docker_push $TRAVIS_TAG
on:
tags: true
repo: openpitrix/openpitrix
after_deploy:
- if [ "TRAVIS_REPO_SLUG" = "openpitrix/openpitrix" ]; then ./qsctl cp -f image/ubuntu/ubuntu.tar.gz qs://openpitrix/image/ubuntu.tar.gz -c key.yaml -z pek3a; fi
- if [ "TRAVIS_REPO_SLUG" = "openpitrix/openpitrix" ]; then ./qsctl cp -f image/amazon-linux/amazon-linux.tar.gz qs://openpitrix/image/amazon-linux.tar.gz -c key.yaml -z pek3a; fi