-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path.travis.yml
136 lines (115 loc) · 5.01 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
###
### Choose OS
###
sudo: required
dist: trusty
###
### Choose Environment
###
language: ruby
rvm: 2.5.0
services: docker
###
### Env variables
###
env:
global:
- image=cytopia/awesome-ci
# travis encrypt DOCKER_USERNAME=user
# travis encrypt DOCKER_PASSWORD=pass
# Must be regenerated when repository name/owner changes
# DOCKER_USERNAME
- secure: "UUqp9snjT3BpAaFt7c6Q7xelG6YowlmlPep9/6xmKIFL0ezjAAb9caRO1lu511Z/f17RXq7RQJtvrmjstBYh3MndR5EYavva4V4O09jg2SPdPMJcez6aB9Hsl/uOL8bdsbra0jJdtftWfNaVOeVPGac0bmTIbLga17FCu/A6lxRhREnnOJcnHOpWnlufU1U/ccY/SvS9j+gHxV4Tj0/yDNi589yhrFMxCg4FpNdc3EEuf8GtHx3gtYUqkBfdKniHIab4SUyP4ZRydjb2WBQ5lnwSGRAuXvBEV3Zlo9bMKAgAr5q/9qW4FKbnETo/LzdwbUW1MC8EesT2+j5fsYJf0DE9yyvIaJbAfAf8YMkQp6f7H1negSbj/Fa0mMC53IRrO3uu/X957/jWrxwzGPZC/Eq4H+axiZ/7nQIHN9uoXpCWbGcbe2PHO9ohyCBQ60CHc/eA2Z/DwB8HsB15QU6Lr0rDAsZ8YpNBFAFgAuirleSXffzHXIlVrJ8ro325EYA248u9+/8MgZ/9VbI7bPMIv36OFVvZcpKzAd25ih8j1oqv8iSHMfp7hUL5/H8ReZtVs2H0OsrsvZ/lc3Xx45R0/ZNHj46vz7FBoZ7yHvtr5m6X2p7THx2hLGb011yvpw2q1Rg3xAhuvdfkc+TwgPdrZXY6Ty3LU4+MwwLtGRauC4Y="
# DOCKER_PASSWORD
- secure: "NRLUpUka7C3pHFJugilLzd+fpFOJ2Xv5x86ctyjwJkmWXDKXI6Bjo59AMbKilrUOTpfcFATPY4PX0NpJqCK1sRFcthjfjpA5FYigoiKOdlkohapnxaBghnYXippmDUrHorWd7WoFS0l5vgeOhAkhH7Gh8oac0BT7rbFygWNgFPtFmI4UaleF4w/46K/qiDyrjZFtb2kueEFZzt6iM5T1naJOq2/Werg0GJ10Z8TqPeG+0FjfUjFiV3+2nB4zO575qDoPayinhfjyBDZQuLtvdFugvLXeT2cX3DBW8A4wxgq/rrGtKXArjdoUHQeFQumFoGHkYdnUfIWIj6mcI3euUL7H1NzhAt3n969tgyz4mhrIVh0KVVlvs3eL3EaPDMu79OR2APN2vHK4/Mg0X3nu7FPOWxA7vpubbAqlQNYN3eJf/Q2rdkth3o4HXGVdHUFCbWfFcVvMfKF5PDCgmpiXuRnhoVrsRgizyrFcBxguHdCvEo89rnykmZ5zQZyBb9JNAc/Tdnxb0tLKsll8fFt+o3hl/FVLZiwfhLbV/bdbPLGY92epzOUDA6qGdYlYzB4H8XC168nR+chKyT1aF2cRfIoTk5uWoGFCQaT0fHwOKlaartNlqmCNGLv0Wr+hb6kB5Kpm77iHijRz0tpux5xiEwnlO4WyH1LBFPtbxaebO1o="
###
### Install dependencies
###
before_install:
# Add more modern repos
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get update; then break; else i=$((i+1)); fi done
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get -y install python-software-properties; then break; else i=$((i+1)); fi done
- sudo add-apt-repository -y ppa:brightbox/ruby-ng
- sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu/ trusty-backports restricted main universe"
# Install dependencies
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get update; then break; else i=$((i+1)); fi done
- max=100; i=0; while [ $i -lt $max ]; do if sudo apt-get -y install
gcc
gcc-multilib
make
ruby2.5
ruby2.5-dev
ruby-switch
moreutils
shellcheck
moreutils
php5-cli
dos2unix
docker-ce;
then break; else i=$((i+1)); fi done
# Set ruby version
- ruby-switch --list
- sudo ruby-switch --set ruby2.5
- ruby -v
- gem -v
#
# - sudo gem update bundler
# - sudo gem pristine executable-hooks --version 1.3.2
# - sudo gem pristine gem-wrappers --version 1.3.2
# - sudo gem pristine nokogiri --version 1.8.1
# - sudo gem pristine ffi --version 1.9.25
# Create custom source/bin directory
- sudo mkdir -p /usr/local/bin
- sudo mkdir -p /usr/local/src
# NodeJS4
- VERSION="$( curl -Lq https://nodejs.org 2>/dev/null | grep LTS | grep -Eo 'data-version.*.' | grep -oE 'v[0-9.]+' )"
- sudo wget -P /usr/local/src https://nodejs.org/dist/${VERSION}/node-${VERSION}-linux-x64.tar.xz
- sudo tar xvf /usr/local/src/node-${VERSION}-linux-x64.tar.xz -C /usr/local/src
- sudo ln -s /usr/local/src/node-${VERSION}-linux-x64 /usr/local/node;
- sudo ln -s /usr/local/node/bin/* /usr/local/bin/
- sudo npm install -g eslint
- sudo npm install -g jsonlint
- sudo npm install -g mdlint
- sudo gem install scss_lint
- sudo gem install mdl
# Symlink node binaries
- sudo ln -s /usr/local/node/bin/* /usr/local/bin/ 2>/dev/null || true
###
### Install Awesome-CI
###
install:
- ./configure
- sudo make install
###
### Checks
###
before_script:
#------------------------------------------------------------
# 1.) Validate coding guidelines of self
#------------------------------------------------------------
- shellcheck --exclude=SC1090,SC2001 --shell=bash bin/*
#------------------------------------------------------------
# 2.) Test awesome-ci
#------------------------------------------------------------
- make test
#------------------------------------------------------------
# 3.) Build Docker image
#------------------------------------------------------------
- make docker
###
### Deploy
###
script:
- if [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
echo "${DOCKER_PASSWORD}" | docker login --username "${DOCKER_USERNAME}" --password-stdin &&
if [ "${TRAVIS_BRANCH}" == "master" ]; then
docker push "${image}:latest";
elif [ -n "${TRAVIS_TAG}" ]; then
docker tag "${image}:latest" "${image}:${TRAVIS_TAG}";
docker push "${image}:${TRAVIS_TAG}";
else
echo "Skipping push to dockerhub on normal branches";
fi
else
echo "Skipping push to dockerhub on PR";
fi