Compare commits

...

26 Commits

Author SHA1 Message Date
412c16e379 Update to Factorio 0.17.79 2019-11-19 14:32:54 +00:00
82635a9cff Update to Factorio 0.17.78 2019-11-15 17:48:02 +00:00
c495fc38a4 Update to Factorio 0.17.77 2019-11-14 20:10:02 +00:00
b580447de4 Update Docker Hub Description 2019-11-11 22:21:45 +01:00
2290034ecf Update to Factorio 0.17.76 2019-11-10 02:29:36 +01:00
300300e7ec Fix stable tag 2019-11-07 00:27:02 +01:00
179be082d9 Update to Factorio 0.17.75 2019-11-07 00:22:42 +01:00
efcc29cfed Mod Updater: Force remove mod archives
Closes #293
2019-11-04 16:12:49 +01:00
1b7decd8ce Mark 0.17 stable 2019-11-01 10:15:23 +01:00
b38750e4ac Update to Factorio 0.17.74 2019-10-25 15:17:09 +00:00
bfb8b7fd95 Update to Factorio 0.17.73 2019-10-24 18:30:51 +00:00
8b5d4e06df Update to Factorio 0.17.72 2019-10-18 13:08:58 +00:00
33060cc4fb Update readme 2019-10-18 11:56:15 +02:00
e1beb32f81 Fix CI 2019-10-18 11:56:07 +02:00
2c1d1cd985 Fix CI
hopefully!
2019-10-18 11:52:25 +02:00
39fd391e9b Fix ci script for manual runs 2019-10-18 11:37:43 +02:00
a5d6466f0b Fix variable expansion 2019-10-18 11:21:15 +02:00
c6b15d89c1 Fix shellcheck 2019-10-18 11:15:36 +02:00
7c9011dcee Add note for when 0.17 leaves experimental entirely 2019-10-18 10:53:16 +02:00
b5af3130e2 Format 2019-10-18 10:51:06 +02:00
e307b1d537 CI: Add support for comma seperated extra tags 2019-10-18 10:50:25 +02:00
8c0ddf99ce Update to Factorio 0.17.71 2019-10-16 16:06:48 +00:00
d7b79c567a Update to Factorio 0.17.70 2019-10-15 20:20:03 +00:00
3e62698b4b Update store links 2019-10-01 16:25:31 +02:00
d4870219f6 Added a link to Gog in addition to Factorio's website and Steam in the README.md (#290) 2019-10-01 11:48:30 +02:00
01194242b9 Update to Factorio 0.17.69 2019-09-19 15:32:52 +00:00
5 changed files with 63 additions and 36 deletions

View File

@ -3,6 +3,7 @@ sudo: required
language: bash language: bash
services: services:
- docker - docker
addons: addons:
apt: apt:
packages: packages:
@ -14,13 +15,18 @@ jobs:
script: script:
- git ls-files --exclude='*Dockerfile' --ignored | xargs --max-lines=1 -I{} sh -c 'docker run --rm -i -v ${PWD}/.hadolint.yaml:/.hadolint.yaml hadolint/hadolint < "$1"' -- {} - git ls-files --exclude='*Dockerfile' --ignored | xargs --max-lines=1 -I{} sh -c 'docker run --rm -i -v ${PWD}/.hadolint.yaml:/.hadolint.yaml hadolint/hadolint < "$1"' -- {}
- bash -c 'shopt -s globstar; shellcheck **/*.sh' - bash -c 'shopt -s globstar; shellcheck **/*.sh'
- stage: Update Docker HUB description
if: branch = master
script: docker run -v $PWD:/workspace -e DOCKERHUB_USERNAME=$DOCKER_USERNAME -e DOCKERHUB_PASSWORD=$DOCKER_PASSWORD -e DOCKERHUB_REPOSITORY='factoriotools/factorio' -e README_FILEPATH='/workspace/README.md' peterevans/dockerhub-description:2.1.0
- &build - &build
stage: build stage: build
env: VERSION_SHORT=0.17 EXTRA_TAG=latest env: VERSION_SHORT=0.17 EXTRA_TAG=latest STABLE=0.17.74
script: script:
- ./build.sh $VERSION_SHORT - ./build.sh $VERSION_SHORT
- <<: *build - <<: *build
env: VERSION_SHORT=0.16 EXTRA_TAG=stable env: VERSION_SHORT=0.16
- <<: *build - <<: *build
env: VERSION_SHORT=0.15 env: VERSION_SHORT=0.15
- <<: *build - <<: *build

View File

@ -9,8 +9,8 @@ ARG PGID=845
ENV PORT=34197 \ ENV PORT=34197 \
RCON_PORT=27015 \ RCON_PORT=27015 \
VERSION=0.17.68 \ VERSION=0.17.79 \
SHA1=dac6b6b04d35b54c188a1313a321e19e4f02263e \ SHA1=7f127baf3cf01c6e545a9ca376dec1ac37468f8a \
SAVES=/factorio/saves \ SAVES=/factorio/saves \
CONFIG=/factorio/config \ CONFIG=/factorio/config \
MODS=/factorio/mods \ MODS=/factorio/mods \

View File

@ -58,7 +58,7 @@ update_mod()
if [[ $HTTP_STATUS != 200 ]]; then if [[ $HTTP_STATUS != 200 ]]; then
print_failure " Download failed: Code $HTTP_STATUS." print_failure " Download failed: Code $HTTP_STATUS."
rm "$MOD_DIR/$MOD_FILENAME" rm -f "$MOD_DIR/$MOD_FILENAME"
return 1 return 1
fi fi
@ -69,7 +69,7 @@ update_mod()
if ! [[ $(sha1sum "$MOD_DIR/$MOD_FILENAME") =~ $MOD_SHA1 ]]; then if ! [[ $(sha1sum "$MOD_DIR/$MOD_FILENAME") =~ $MOD_SHA1 ]]; then
print_failure " SHA1 mismatch!" print_failure " SHA1 mismatch!"
rm "$MOD_DIR/$MOD_FILENAME" rm -f "$MOD_DIR/$MOD_FILENAME"
return 1 return 1
fi fi
@ -78,7 +78,7 @@ update_mod()
for file in "$MOD_DIR/${MOD_NAME}_"*".zip"; do # wildcard does usually not work in quotes: https://unix.stackexchange.com/a/67761 for file in "$MOD_DIR/${MOD_NAME}_"*".zip"; do # wildcard does usually not work in quotes: https://unix.stackexchange.com/a/67761
if [[ $file != $MOD_DIR/$MOD_FILENAME ]]; then if [[ $file != $MOD_DIR/$MOD_FILENAME ]]; then
print_success " Deleting old version: $file" print_success " Deleting old version: $file"
rm "$file" rm -f "$file"
fi fi
done done

View File

@ -1,7 +1,8 @@
# Factorio [![Build Status](https://travis-ci.org/factoriotools/factorio-docker.svg?branch=master)](https://travis-ci.org/factoriotools/factorio-docker) [![Docker Version](https://images.microbadger.com/badges/version/factoriotools/factorio.svg)](https://hub.docker.com/r/factoriotools/factorio/) [![Docker Pulls](https://img.shields.io/docker/pulls/factoriotools/factorio.svg?maxAge=600)](https://hub.docker.com/r/factoriotools/factorio/) [![Docker Stars](https://img.shields.io/docker/stars/factoriotools/factorio.svg?maxAge=600)](https://hub.docker.com/r/factoriotools/factorio/) [![Microbadger Layers](https://images.microbadger.com/badges/image/factoriotools/factorio.svg)](https://microbadger.com/images/factoriotools/factorio "Get your own image badge on microbadger.com") # Factorio [![Build Status](https://travis-ci.org/factoriotools/factorio-docker.svg?branch=master)](https://travis-ci.org/factoriotools/factorio-docker) [![Docker Version](https://images.microbadger.com/badges/version/factoriotools/factorio.svg)](https://hub.docker.com/r/factoriotools/factorio/) [![Docker Pulls](https://img.shields.io/docker/pulls/factoriotools/factorio.svg?maxAge=600)](https://hub.docker.com/r/factoriotools/factorio/) [![Docker Stars](https://img.shields.io/docker/stars/factoriotools/factorio.svg?maxAge=600)](https://hub.docker.com/r/factoriotools/factorio/) [![Microbadger Layers](https://images.microbadger.com/badges/image/factoriotools/factorio.svg)](https://microbadger.com/images/factoriotools/factorio "Get your own image badge on microbadger.com")
* `0.17.68`, `0.17`, `latest` [(0.17/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.17/Dockerfile) * `0.17.79`, `0.17`, `latest` [(0.17/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.17/Dockerfile)
* `0.16.51`, `0.16`, `stable` [(0.16/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.16/Dockerfile) * `0.17.79` `stable` [(0.17/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.17/Dockerfile)
* `0.16.51`, `0.16` [(0.16/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.16/Dockerfile)
* `0.15.40`, `0.15` [(0.15/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.15/Dockerfile) * `0.15.40`, `0.15` [(0.15/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.15/Dockerfile)
* `0.14.23`, `0.14` [(0.14/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.14/Dockerfile) * `0.14.23`, `0.14` [(0.14/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.14/Dockerfile)
@ -22,7 +23,7 @@ You will be mining resources, researching technologies, building infrastructure,
The game is very stable and optimized for building massive factories. You can create your own maps, write mods in Lua or play with friends via Multiplayer. The game is very stable and optimized for building massive factories. You can create your own maps, write mods in Lua or play with friends via Multiplayer.
NOTE: This is only the server. The game is available at [factorio.com](https://www.factorio.com) and [Steam](http://store.steampowered.com/app/427520/). NOTE: This is only the server. The full game is available at [Factorio.com](https://www.factorio.com), [Steam](https://store.steampowered.com/app/427520/), [GOG.com](https://www.gog.com/game/factorio) and [Humble Bundle](https://www.humblebundle.com/store/factorio).
# Usage # Usage

View File

@ -2,9 +2,9 @@
set -eoux pipefail set -eoux pipefail
if [[ -z ${1:-} ]] && [[ -n ${CI:-} ]]; then if [[ -z ${1:-} ]] && [[ -n ${CI:-} ]]; then
echo "Usage: ./build.sh \$VERSION_SHORT" echo 'Usage: ./build.sh VERSION_SHORT'
exit 1 exit 1
elif [[ $CI == true ]]; then elif [[ ${CI:-} == true ]] || [[ -n ${1:-} ]]; then
VERSION_SHORT="$1" VERSION_SHORT="$1"
else else
VERSION_SHORT=$(find . -maxdepth 1 -type d | sort | tail -1 | grep -o "[[0-9]].[[0-9]]*") VERSION_SHORT=$(find . -maxdepth 1 -type d | sort | tail -1 | grep -o "[[0-9]].[[0-9]]*")
@ -16,61 +16,81 @@ cd "$VERSION_SHORT" || exit 1
VERSION=$(grep -oP '[0-9]+\.[0-9]+\.[0-9]+' Dockerfile | head -1) VERSION=$(grep -oP '[0-9]+\.[0-9]+\.[0-9]+' Dockerfile | head -1)
DOCKER_REPO=factoriotools/factorio DOCKER_REPO=factoriotools/factorio
if [[ $TRAVIS_PULL_REQUEST == true ]]; then if [[ ${TRAVIS_PULL_REQUEST:-} == true ]]; then
TAGS="$DOCKER_REPO:$TRAVIS_PULL_REQUEST_SLUG" TAGS="$DOCKER_REPO:$TRAVIS_PULL_REQUEST_SLUG"
else else
# we are either on master or on a tag build if [[ -n ${CI:-} ]]; then
if [[ $TRAVIS_BRANCH == master ]] || [[ $TRAVIS_BRANCH == "$VERSION" ]]; then # we are either on master or on a tag build
TAGS="$DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT" if [[ $TRAVIS_BRANCH == master ]] || [[ $TRAVIS_BRANCH == "$VERSION" ]]; then
# we are on an incremental build of a tag TAGS="-t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
elif [[ $VERSION == "${TRAVIS_BRANCH%-*}" ]]; then # we are on an incremental build of a tag
TAGS="$DOCKER_REPO:$TRAVIS_BRANCH -t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT" elif [[ $VERSION == "${TRAVIS_BRANCH%-*}" ]]; then
# we build a other branch than master TAGS="-t $DOCKER_REPO:$TRAVIS_BRANCH -t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
elif [[ -n $TRAVIS_BRANCH ]]; then # we build a other branch than master
TAGS="$DOCKER_REPO:$TRAVIS_BRANCH" elif [[ -n $TRAVIS_BRANCH ]]; then
# we are not in CI and tag version and version short TAGS="-t $DOCKER_REPO:$TRAVIS_BRANCH"
elif [[ $CI == "" ]]; then fi
TAGS="$DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT" else
# we are not in CI and tag version and version short
TAGS="-t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
fi fi
if [[ -n ${EXTRA_TAG:-} ]]; then if [[ -n ${EXTRA_TAG:-} ]]; then
TAGS="$TAGS -t $DOCKER_REPO:$EXTRA_TAG" IFS=","
for TAG in $EXTRA_TAG; do
TAGS+=" -t $DOCKER_REPO:$TAG"
done
fi
if [[ ${STABLE:-} == "$VERSION" ]]; then
TAGS+=" -T $DOCKER_REPO:stable"
fi fi
fi fi
# shellcheck disable=SC2086 # shellcheck disable=SC2068
docker build . -t $TAGS eval docker build . ${TAGS[@]}
docker images docker images
if [[ ${TRAVIS_BRANCH:-} ]]; then
TRAVIS_BRANCH_VERSION=${TRAVIS_BRANCH%-*}
fi
# only push when: # only push when:
# latest changes where made in the folder corosponding to the version we build, we are on master and don#t build a PR. # latest changes where made in the folder corosponding to the version we build, we are on master and don#t build a PR.
if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ $TRAVIS_BRANCH == master ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] || if [[ $(dirname "$(git diff --name-only HEAD^)") =~ $VERSION_SHORT ]] && [[ ${TRAVIS_BRANCH:-} == master ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] ||
# we build a tag and we are not on master # we build a tag and we are not on master
[[ $VERSION == "${TRAVIS_BRANCH%-*}" ]] && [[ $TRAVIS_PULL_REQUEST_BRANCH == "" ]] || [[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]] && [[ ${TRAVIS_PULL_REQUEST_BRANCH:-} == "" ]] ||
# we are not in CI # we are not in CI
[[ $CI == "" ]]; then [[ -z ${CI:-} ]]; then
if [[ $CI == true ]]; then if [[ ${CI:-} == true ]]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi fi
# push a tag on a branch other than master # push a tag on a branch other than master
if [[ -n $TRAVIS_BRANCH ]] && [[ $VERSION != "${TRAVIS_BRANCH%-*}" ]] && [[ $TRAVIS_BRANCH != "master" ]]; then if [[ -n ${TRAVIS_BRANCH:-} ]] && [[ $VERSION != "${TRAVIS_BRANCH_VERSION:-}" ]] && [[ ${TRAVIS_BRANCH:-} != "master" ]]; then
docker push "$DOCKER_REPO:$TRAVIS_BRANCH" docker push "$DOCKER_REPO:$TRAVIS_BRANCH"
fi fi
# push an incremental tag # push an incremental tag
if [[ $VERSION == "${TRAVIS_BRANCH%-*}" ]]; then if [[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]]; then
docker push "$DOCKER_REPO:$TRAVIS_BRANCH" docker push "$DOCKER_REPO:$TRAVIS_BRANCH"
fi fi
if [[ -n $TRAVIS_TAG ]] || [[ $CI == "" ]]; then if [[ -n ${TRAVIS_TAG:-} ]] || [[ -z ${CI:-} ]]; then
docker push "$DOCKER_REPO:$VERSION" docker push "$DOCKER_REPO:$VERSION"
docker push "$DOCKER_REPO:$VERSION_SHORT" docker push "$DOCKER_REPO:$VERSION_SHORT"
fi fi
if [[ -n ${EXTRA_TAG:-} ]]; then if [[ -n ${EXTRA_TAG:-} ]]; then
docker push "$DOCKER_REPO:$EXTRA_TAG" IFS=","
for TAG in $EXTRA_TAG; do
docker push "$DOCKER_REPO:$TAG"
done
fi
if [[ ${STABLE:-} == "$VERSION" ]]; then
docker push "$DOCKER_REPO:stable"
fi fi
curl -X POST https://hooks.microbadger.com/images/factoriotools/factorio/TmmKGNp8jKcFqZvcJhTCIAJVluw= curl -X POST https://hooks.microbadger.com/images/factoriotools/factorio/TmmKGNp8jKcFqZvcJhTCIAJVluw=