Skip to content

Commit

Permalink
Push to dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Jun 12, 2018
1 parent ae78247 commit 6e30237
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 7 deletions.
49 changes: 44 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,22 @@ dist: trusty
###
language: ruby
rvm: 2.5.0
node_js: 7
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="


###
Expand All @@ -36,7 +51,8 @@ before_install:
shellcheck
moreutils
php5-cli
dos2unix;
dos2unix
docker-ce;
then break; else i=$((i+1)); fi done

# Set ruby version
Expand Down Expand Up @@ -83,15 +99,38 @@ install:
###
### Checks
###
script:
before_script:

#------------------------------------------------------------
# 1.) Validate coding guidelines of self
#------------------------------------------------------------
- shellcheck --exclude=SC1090,SC2001 --shell=bash bin/*


#------------------------------------------------------------
# 2.) Output Info
# 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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# awesome-ci
# [awesome-ci](https://github.com/cytopia/awesome-ci)

[![Build Status](https://travis-ci.org/cytopia/awesome-ci.svg?branch=master)](https://travis-ci.org/cytopia/awesome-ci)
[![Latest Stable Version](https://poser.pugx.org/cytopia/awesome-ci/v/stable)](https://packagist.org/packages/cytopia/awesome-ci)
[![Total Downloads](https://poser.pugx.org/cytopia/awesome-ci/downloads)](https://packagist.org/packages/cytopia/awesome-ci)
[![Docker image](https://images.microbadger.com/badges/image/cytopia/awesome-ci.svg)](https://hub.docker.com/r/cytopia/awesome-ci)
[![License](https://poser.pugx.org/cytopia/awesome-ci/license)](http://opensource.org/licenses/MIT)

**Runs on every good OS**
**Runs on**

[![Linux](https://raw.githubusercontent.com/cytopia/icons/master/64x64/linux.png)](https://www.kernel.org/)
[![FreeBSD](https://raw.githubusercontent.com/cytopia/icons/master/64x64/freebsd.png)](https://www.freebsd.org)
Expand Down Expand Up @@ -188,6 +189,8 @@ make install

## Awesome CI Docker image

[![Docker image](http://dockeri.co/image/cytopia/awesome-ci)](https://hub.docker.com/r/cytopia/awesome-ci)

Instead of installing awesome-ci and all its required dependencies locally on your computer,
you can also use the bundled Docker image
**[cytopia/awesome-ci](https://hub.docker.com/r/cytopia/awesome-ci/)** which has everything
Expand Down

0 comments on commit 6e30237

Please sign in to comment.