Compare commits

...

51 Commits

Author SHA1 Message Date
d99ef45240 Update to Factorio 1.1.25 2021-02-17 17:47:25 +00:00
2b26cd1b69 Update to Factorio 1.1.24 2021-02-16 15:53:19 +00:00
7dddaf62bd Update to Factorio 1.1.24 2021-02-16 10:17:23 +00:00
3f034d0754 Update to Factorio 1.1.23 2021-02-16 08:38:07 +00:00
7720e32081 Update to Factorio 1.1.23 2021-02-16 07:17:24 +00:00
65049c8120 Update to Factorio 1.1.22 2021-02-15 21:27:28 +00:00
c94ab998b4 Update to Factorio 1.1.21 2021-02-12 23:33:03 +00:00
6e4ec92a95 Update to Factorio 1.1.21 2021-02-11 09:30:47 +00:00
7dcac4cdd7 Update to Factorio 1.1.21 2021-02-10 05:27:46 +00:00
cc70895c33 Update to Factorio 1.1.21 2021-02-06 21:14:54 +00:00
89b54579e0 Update to Factorio 1.1.21 2021-02-06 18:01:57 +00:00
c1e1a1c4ca Fix CI for PRs 2021-02-05 22:55:04 +01:00
429c88f290 Update to Factorio 1.1.21 2021-02-05 18:19:26 +00:00
074bf11633 Update to Factorio 1.1.20 2021-02-04 22:24:29 +00:00
5765088f7e Update to Factorio 1.1.19 2021-02-04 17:55:42 +00:00
316f790530 Update to Factorio 1.1.19 2021-02-04 08:41:53 +00:00
c91852a196 Update to Factorio 1.1.19 2021-02-04 06:45:27 +00:00
9ba7c5c8d6 Update to Factorio 1.1.19 2021-02-03 11:14:38 +00:00
f2a4223c7b Update to Factorio 1.1.19 2021-02-03 05:51:48 +00:00
2a5e5b48ef Update to Factorio 1.1.19 2021-02-02 19:13:10 +00:00
57e979bca1 Update to Factorio 1.1.19 2021-02-02 02:00:33 +00:00
88ca3293a6 Push base version on incremental tags 2021-01-28 00:19:59 +01:00
018269377a Remove ref/tags from version 2021-01-28 00:12:38 +01:00
846e102ac8 Fix version short for stable 2021-01-27 23:51:45 +01:00
4551f6ee03 Fix tag pushes 2021-01-27 23:49:40 +01:00
09db1e2141 Mark 1.1 as stable 2021-01-27 23:39:56 +01:00
cb9a9812bd Fix image in docker description update 2021-01-27 11:24:26 +01:00
d03e4063e7 Quote version numbers 2021-01-26 20:00:56 +01:00
21c5c85ac3 Fix yaml 2021-01-26 19:59:58 +01:00
a10642d3eb Use secrets properly 2021-01-26 19:57:15 +01:00
2856c1cf76 Update docker hub description update 2021-01-26 19:51:32 +01:00
3e736968d1 Converto to GitHub actions (#364) 2021-01-26 19:43:14 +01:00
ac6d647ddd Update to Factorio 1.1.19 2021-01-26 15:11:30 +00:00
02439750d1 Update to Factorio 1.1.18 2021-01-25 21:26:24 +00:00
3efae7b161 Update to Factorio 1.1.17 2021-01-25 18:26:24 +00:00
49a258c830 Update to Factorio 1.1.16 2021-01-25 10:11:39 +00:00
3ffa3610ef Update to Factorio 1.1.15 2021-01-24 17:31:24 +00:00
56984b2ef1 Update to Factorio 1.1.14 2021-01-23 09:11:24 +00:00
653c87a32e Update to Factorio 1.1.13 2021-01-22 12:31:24 +00:00
07bd20120c Update to Factorio 1.1.12 2021-01-16 11:01:09 +00:00
bd7347b42c ci: fix invalid yaml 2021-01-15 11:30:40 +01:00
cfbef2aedb ci: log into docker hub to pull the hadolint image 2021-01-15 11:21:25 +01:00
8436dfe8a0 Fix travis rate limiting
Should close #354
2021-01-15 10:39:24 +01:00
82892d8ad8 Update to Factorio 1.1.11 2021-01-14 17:31:28 +00:00
34132ddbd6 Update to Factorio 1.1.10 2021-01-14 14:31:29 +00:00
b52af78919 Update to Factorio 1.1.9 2021-01-14 09:56:29 +00:00
13964c7a50 Update to Factorio 1.1.8 2021-01-07 19:22:14 +00:00
e5e5dc27d2 Update to Factorio 1.1.7 2021-01-07 09:52:17 +00:00
8ad8f81eed Update to Factorio 1.1.6 2020-12-14 19:48:56 +00:00
b0e855bb8a Update to Factorio 1.1.5 2020-12-04 05:41:02 +00:00
31a60e976b Update to Factorio 1.1.4 2020-12-03 15:36:01 +00:00
8 changed files with 124 additions and 91 deletions

View File

@ -0,0 +1,18 @@
name: Docker build & push
on:
push:
branches: master
jobs:
docker-description:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2.4.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: factoriotools/factorio

53
.github/workflows/docker.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Docker build & push
on:
pull_request:
push:
branches: master
tags:
- '*'
jobs:
old-version:
runs-on: ubuntu-latest
strategy:
matrix:
version: [ "1.0", "0.18", "0.17", "0.16", "0.15", "0.14" ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: build
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
VERSION_SHORT: ${{ matrix.version }}
run: |
./build.sh ${{ matrix.version }}
stable:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: build
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
EXTRA_TAG: stable,latest
VERSION_SHORT: "1.1"
run: |
./build.sh $VERSION_SHORT
# experimental:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: build
# env:
# DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
# EXTRA_TAG: latest
# VERSION_SHORT: "1.2"
# run: |
# ./build.sh $VERSION_SHORT

27
.github/workflows/lint.yml vendored Normal file
View File

@ -0,0 +1,27 @@
name: 'Linter'
on:
pull_request:
push:
branches: master
jobs:
shellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: shellcheck
uses: reviewdog/action-shellcheck@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review
hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: hadolint
uses: reviewdog/action-hadolint@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-review

View File

@ -1,37 +0,0 @@
dist: xenial
language: bash
services:
- docker
addons:
apt:
packages:
- jq
jobs:
include:
- stage: test
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"' -- {}
- bash -c 'shopt -s globstar; shellcheck **/*.sh'
- &build
stage: Build & update Docker HUB description
env: VERSION_SHORT=1.1 EXTRA_TAG=latest
script:
- ./build.sh $VERSION_SHORT
- <<: *build
env: VERSION_SHORT=1.0 EXTRA_TAG=stable
- <<: *build
env: VERSION_SHORT=0.18
- <<: *build
env: VERSION_SHORT=0.17
- <<: *build
env: VERSION_SHORT=0.16
- <<: *build
env: VERSION_SHORT=0.15
- <<: *build
env: VERSION_SHORT=0.14
- <<: *build
if: branch = master AND type != pull_request
script: DOCKERHUB_USERNAME=$DOCKER_USERNAME DOCKERHUB_PASSWORD=$DOCKER_PASSWORD DOCKERHUB_REPOSITORY='factoriotools/factorio' README_FILEPATH='./README.md' ./update-dockerhub-description.sh

View File

@ -9,8 +9,8 @@ ARG PGID=845
ENV PORT=34197 \
RCON_PORT=27015 \
VERSION=1.1.3 \
SHA1=ea68fef8f60cebfeccb1effdca9ce349c6b4719f \
VERSION=1.1.25 \
SHA1=31675ca964afaf9df5fd0da506e1cbcff8e9a6af \
SAVES=/factorio/saves \
CONFIG=/factorio/config \
MODS=/factorio/mods \

View File

@ -1,7 +1,7 @@
# Factorio [![Build Status](https://travis-ci.org/factoriotools/factorio-docker.svg?branch=master)](https://travis-ci.org/factoriotools/factorio-docker) ![Updater status](https://img.shields.io/endpoint?label=Updater%20status&logo=a&url=https%3A%2F%2Fhealthchecks.supersandro.de%2Fbadge%2F1a0a7698-445d-4e54-9e4b-f61a1544e01f%2FBO8VukOA%2Fmaintainer.shields) [![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")
* `1.1.3`, `1.1`, `latest` [(1.1/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/1.1/Dockerfile)
* `1.0.0`, `1.0`, `stable` [(1.0/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/1.0/Dockerfile)
* `1.1.25`, `1.1`, `latest`, `stable` [(1.1/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/1.1/Dockerfile)
* `1.0.0`, `1.0` [(1.0/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/1.0/Dockerfile)
* `0.18.47`, `0.18` [(0.18/Dockerfile)](https://github.com/factoriotools/factorio-docker/blob/master/0.18/Dockerfile)
* `0.17.79`, `0.17` [(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)

View File

@ -16,19 +16,21 @@ cd "$VERSION_SHORT" || exit 1
VERSION=$(grep -oP '[0-9]+\.[0-9]+\.[0-9]+' Dockerfile | head -1)
DOCKER_REPO=factoriotools/factorio
if [[ ${TRAVIS_PULL_REQUEST:-} == true ]]; then
TAGS="$DOCKER_REPO:$TRAVIS_PULL_REQUEST_SLUG"
BRANCH=${GITHUB_REF#refs/*/}
if [[ -n ${GITHUB_BASE_REF:-} ]]; then
TAGS="-t $DOCKER_REPO:$GITHUB_BASE_REF"
else
if [[ -n ${CI:-} ]]; then
# we are either on master or on a tag build
if [[ ${TRAVIS_BRANCH:-} == master || ${TRAVIS_BRANCH:-} == "$VERSION" ]]; then
if [[ ${BRANCH:-} == master || ${BRANCH:-} == "$VERSION" ]]; then
TAGS="-t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
# we are on an incremental build of a tag
elif [[ $VERSION == "${TRAVIS_BRANCH%-*}" ]]; then
TAGS="-t $DOCKER_REPO:$TRAVIS_BRANCH -t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
elif [[ $VERSION == "${BRANCH%-*}" ]]; then
TAGS="-t $DOCKER_REPO:$BRANCH -t $DOCKER_REPO:$VERSION -t $DOCKER_REPO:$VERSION_SHORT"
# we build a other branch than master and exclude dependabot branches from tags cause the / is not supported by docker
elif [[ -n ${TRAVIS_BRANCH:-} && ! $TRAVIS_BRANCH =~ "/" ]]; then
TAGS="-t $DOCKER_REPO:$TRAVIS_BRANCH"
elif [[ -n ${BRANCH:-} && ! $BRANCH =~ "/" ]]; then
TAGS="-t $DOCKER_REPO:$BRANCH"
fi
else
# we are not in CI and tag version and version short
@ -47,19 +49,24 @@ else
fi
fi
# Travis gets rate limited by Docker HUB.
if [[ ${CI:-} == true && -n ${DOCKER_PASSWORD:-} && -n ${DOCKER_USERNAME:-} ]]; then
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
fi
# shellcheck disable=SC2068
eval docker build . ${TAGS[@]:-}
docker images
# remove -1 from incremental tag
# eg before: 0.18.24-1, after 0.18.24
if [[ ${TRAVIS_BRANCH:-} ]]; then
TRAVIS_BRANCH_VERSION=${TRAVIS_BRANCH%-*}
if [[ ${BRANCH:-} ]]; then
BRANCH_VERSION=${BRANCH%-*}
fi
# only push when:
# or we build a tag and we don't build a PR
if [[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" && ${TRAVIS_PULL_REQUEST_BRANCH:-} == "" ]] ||
if [[ $VERSION == "${BRANCH_VERSION:-}" && ${GITHUB_BASE_REF:-} == "" ]] ||
# or we are not in CI
[[ -z ${CI:-} ]]; then
@ -68,18 +75,18 @@ if [[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" && ${TRAVIS_PULL_REQUEST_BRANCH:-
fi
# push a tag on a branch other than master except dependabot branches cause docker does not support /
if [[ -n ${TRAVIS_BRANCH:-} && $VERSION != "${TRAVIS_BRANCH_VERSION:-}" && ${TRAVIS_BRANCH:-} != "master" && ! ${TRAVIS_BRANCH:-} =~ "/" ]]; then
docker push "$DOCKER_REPO:$TRAVIS_BRANCH"
if [[ -n ${BRANCH:-} && $VERSION != "${BRANCH_VERSION:-}" && ${BRANCH:-} != "master" && ! ${BRANCH:-} =~ "/" ]]; then
docker push "$DOCKER_REPO:$BRANCH"
fi
# push an incremental tag
# eg 0.18.24-1
if [[ $VERSION == "${TRAVIS_BRANCH_VERSION:-}" ]]; then
docker push "$DOCKER_REPO:$TRAVIS_BRANCH"
if [[ $VERSION == "${BRANCH_VERSION:-}" ]]; then
docker push "$DOCKER_REPO:$BRANCH"
fi
# only push on tags or when manually running the script
if [[ -n ${TRAVIS_TAG:-} || -z ${CI:-} ]]; then
if [[ -n ${BRANCH_VERSION:-} || -z ${CI:-} ]]; then
docker push "$DOCKER_REPO:$VERSION"
docker push "$DOCKER_REPO:$VERSION_SHORT"
fi

View File

@ -1,35 +0,0 @@
#!/bin/bash
# This script is licensed under MIT and was originally written by Peter Evans. You can find a copy of the MIT license next to this file.
# The original file is available on his Github repo under the following link:
# https://github.com/peter-evans/dockerhub-description/blob/84d38211e27bb9b9effefa718f8c734db8adc5e1/entrypoint.sh
set -euo pipefail
IFS=$'\n\t'
# Set the default path to README.md
README_FILEPATH=${README_FILEPATH:="./README.md"}
# Check the file size
if [[ $(wc -c <${README_FILEPATH}) -gt 25000 ]]; then
echo "File size exceeds the maximum allowed 25000 bytes"
exit 1
fi
# Acquire a token for the Docker Hub API
echo "Acquiring token"
# shellcheck disable=2089
LOGIN_PAYLOAD="{\"username\": \"${DOCKERHUB_USERNAME}\", \"password\": \"${DOCKERHUB_PASSWORD}\"}"
TOKEN=$(curl -s -H "Content-Type: application/json" -X POST -d "${LOGIN_PAYLOAD}" https://hub.docker.com/v2/users/login/ | jq -r .token)
# Send a PATCH request to update the description of the repository
echo "Sending PATCH request"
REPO_URL="https://hub.docker.com/v2/repositories/${DOCKERHUB_REPOSITORY}/"
RESPONSE_CODE=$(curl -s --write-out "%{response_code}" --output /dev/null -H "Authorization: JWT ${TOKEN}" -X PATCH --data-urlencode full_description@${README_FILEPATH} "${REPO_URL}")
echo "Received response code: $RESPONSE_CODE"
if [[ $RESPONSE_CODE -eq 200 ]]; then
exit 0
else
exit 1
fi