forked from factoriotools/factorio-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add travis ci, linter, merge shellcheck, fix some issues (factoriotoo…
…ls#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
- Loading branch information
Showing
9 changed files
with
73 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
ignored: | ||
# ignore apt version pinning | ||
- DL3008 | ||
# ignore pip version pinning | ||
- DL3013 | ||
# ignore apk version pinning | ||
- DL3018 | ||
# ignore pipefail cause Balena/resin.io images do not work with it | ||
- DL4006 | ||
# ignore false positive regex | ||
- SC1083 | ||
- SC2086 | ||
# ignore as need for debug | ||
- SC2005 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
|
||
if [ -z "$1" ] ; then | ||
echo "Usage: ./build.sh \$VERSION" | ||
else | ||
VERSION="$1" | ||
fi | ||
|
||
cd "$VERSION" || exit | ||
|
||
docker build . -t "factoriotools/docker_factorio_server:$VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
git ls-files --exclude='*Dockerfile' --ignored | xargs --max-lines=1 ./hadolint |