Skip to content

Commit ea83e56

Browse files
committed
Merge branch 'develop' into Feature/Changelog
2 parents 7c14e87 + dea2c91 commit ea83e56

File tree

6 files changed

+5144
-26
lines changed

6 files changed

+5144
-26
lines changed

.travis.yml

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
language: go
2-
os:
3-
- linux
4-
- windows
5-
6-
go:
7-
- 1.11.x
8-
- 1.12.x
9-
- 1.13.x
10-
- 1.x
11-
12-
env:
13-
- GO111MODULE=on
14-
15-
script:
16-
- cd src/
17-
- go test -v ./...
1+
jobs:
2+
include:
3+
- stage: deploy
4+
go: 1.x
5+
language: minimal
6+
before_install:
7+
- docker build -f "docker/Dockerfile-build" -t factorio-server-manager docker
8+
script:
9+
- mkdir /home/travis/build/mroote/build
10+
- docker run -t -e FAC_BRANCH=$TRAVIS_BRANCH -v /home/travis/build/mroote/build:/build factorio-server-manager
11+
- mv /home/travis/build/mroote/build/factorio-server-manager-linux.zip /home/travis/factorio-server-manager-linux-${TRAVIS_TAG}.zip
12+
- mv /home/travis/build/mroote/build/factorio-server-manager-windows.zip /home/travis/factorio-server-manager-windows-${TRAVIS_TAG}.zip
13+
deploy:
14+
provider: releases
15+
api_key: "${GITHUB_TOKEN}"
16+
draft: true
17+
skip_cleanup: true
18+
on:
19+
tags: true
20+
file:
21+
- /home/travis/factorio-server-manager-linux-${TRAVIS_TAG}.zip
22+
- /home/travis/factorio-server-manager-windows-${TRAVIS_TAG}.zip

docker/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
# glibc is required for Factorio Server binaries to run
22
FROM frolvlad/alpine-glibc
33

4-
MAINTAINER Mitch Roote <mitch@r00t.ca>
5-
64
ENV FACTORIO_VERSION=latest \
7-
MANAGER_VERSION=0.8.1 \
5+
MANAGER_VERSION=0.8.2 \
86
ADMIN_PASSWORD=factorio
97

108
VOLUME /opt/factorio/saves /opt/factorio/mods /opt/factorio/config /security
@@ -16,7 +14,8 @@ WORKDIR /opt/
1614
RUN curl -s -L -S -k https://www.factorio.com/get-download/$FACTORIO_VERSION/headless/linux64 -o /tmp/factorio_$FACTORIO_VERSION.tar.xz && \
1715
tar Jxf /tmp/factorio_$FACTORIO_VERSION.tar.xz && \
1816
rm /tmp/factorio_$FACTORIO_VERSION.tar.xz && \
19-
curl -s -L -S -k https://github.com/mroote/factorio-server-manager/releases/download/$MANAGER_VERSION/factorio-server-manager-linux.zip --cacert /opt/github.pem -o /tmp/factorio-server-manager-linux_$MANAGER_VERSION.zip && \
17+
curl -sLSk https://github.com/mroote/factorio-server-manager/releases/download/$MANAGER_VERSION/factorio-server-manager-linux-${MANAGER_VERSION}.zip \
18+
--cacert /opt/github.pem -o /tmp/factorio-server-manager-linux_$MANAGER_VERSION.zip && \
2019
unzip -qq /tmp/factorio-server-manager-linux_$MANAGER_VERSION.zip && \
2120
rm /tmp/factorio-server-manager-linux_$MANAGER_VERSION.zip && \
2221
mkdir -p /run/nginx && \

docker/Dockerfile-build

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM alpine:latest
2+
3+
RUN apk add --no-cache git make musl-dev go nodejs npm zip
4+
5+
ENV FAC_BRANCH=develop
6+
ENV GOROOT /usr/lib/go
7+
ENV GOPATH /go
8+
ENV PATH /go/bin:$PATH
9+
ENV FAC_ROOT /go/src/factorio-server-manager
10+
11+
COPY build.sh /usr/local/bin/build.sh
12+
13+
RUN mkdir -p ${GOPATH}/bin
14+
RUN chmod u+x /usr/local/bin/build.sh
15+
16+
WORKDIR $FAC_ROOT
17+
18+
VOLUME /build
19+
20+
CMD ["/usr/local/bin/build.sh"]

docker/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@ SECURITY_PATH ?= $(FACTORIO_PATH)/security
55
SAVES_PATH ?= $(FACTORIO_PATH)/saves
66
MODS_PATH ?= $(FACTORIO_PATH)/mods
77
PORT_FORWARD ?= -p 80:80 -p 443:443 -p 34197:34197/udp
8+
FACTORIO_BRANCH ?= develop
89

910
build:
11+
docker build --build-arg FAC_BRANCH=$FACTORIO_BRANCH -f Dockerfile-build -t fsm-build .
1012
docker build -t factorio-server-manager .
1113

1214
logs:
13-
docker logs factorio-server
14-
echo "Nginx Access Logs"
15-
docker exec -it factorio-server cat /var/log/nginx/access.log
16-
echo "Nginx Error Logs"
17-
docker exec -it factorio-server cat /var/log/nginx/error.log
15+
docker logs factorio-server -f
1816

1917
run:
2018
docker run -d --name factorio-server -v $(SECURITY_PATH):/security -v $(SAVES_PATH):/opt/factorio/saves -v $(MODS_PATH):/opt/factorio/mods $(PORT_FORWARD) factorio-server-manager
@@ -25,3 +23,5 @@ stop:
2523

2624
clean:
2725
docker rmi factorio-server-manager
26+
docker stop fsm-build
27+
docker rmi fsm-build

docker/build.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
3+
echo "Cloning ${FAC_BRANCH}"
4+
git clone -b ${FAC_BRANCH} https://github.com/mroote/factorio-server-manager.git ${FAC_ROOT}
5+
echo "Creating build..."
6+
make gen_release
7+
echo "Copying build artifacts..."
8+
cp -v build/* /build/

0 commit comments

Comments
 (0)