factorio-docker/.travis.yml
Florian Kinder 605ca74c0e
Add travis ci, linter, merge shellcheck, fix some issues (#241)
* Quote all vars, remove useless echo/sub-shell, add shebands, fail on unset vars, enable pipefail, formatting

* Add CI including linting via hadolint nad shellcheck

* Update all base images to tag 3.9

* Switch to maintainer labels

* Quote vars

* Remove commented code

* Ignore if the folder exists
2019-05-02 17:28:20 +02:00

36 lines
1.1 KiB
YAML

dist: xenial
sudo: required
language: bash
services:
- docker
addons:
apt:
packages:
- jq
jobs:
include:
- stage: test
env: HADOLINT=${HOME}/hadolint
install: curl -sLo ${HADOLINT} $(curl -s https://api.github.com/repos/hadolint/hadolint/releases/latest?access_token=${GITHUB_TOKEN} | jq -r '.assets | .[] | select(.name=="hadolint-Linux-x86_64") | .browser_download_url')
&& chmod 700 ${HADOLINT}
script:
- git ls-files --exclude='*Dockerfile' --ignored | xargs --max-lines=1 ${HADOLINT}
- bash -c 'shopt -s globstar; shellcheck **/*.sh'
- &build
stage: build
env: VERSION=0.17
script:
- ./build.sh $VERSION
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ]; then
echo "$DOCKER_PASSWORD" | DOCKER login -u "$DOCKER_USERNAME" --password-stdin
docker push "factoriotools/docker_factorio_server:$VERSION"
fi
- <<: *build
env: VERSION=0.16
- <<: *build
env: VERSION=0.15
- <<: *build
env: VERSION=0.14