Merge pull request #158 from mroote/improve_ci_build

Add dockerfile to build releases
This commit is contained in:
Mitch Roote 2020-01-07 19:32:07 -05:00 committed by GitHub
commit 80cc8c3931
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 5142 additions and 25 deletions

View File

@ -1,17 +1,22 @@
language: go
os:
- linux
- windows
go:
- 1.11.x
- 1.12.x
- 1.13.x
- 1.x
env:
- GO111MODULE=on
script:
- cd src/
- go test -v ./...
jobs:
include:
- stage: deploy
go: 1.x
language: minimal
before_install:
- docker build -f "docker/Dockerfile-build" -t factorio-server-manager docker
script:
- mkdir /home/travis/build/mroote/build
- docker run -t -e FAC_BRANCH=$TRAVIS_BRANCH -v /home/travis/build/mroote/build:/build factorio-server-manager
- mv /home/travis/build/mroote/build/factorio-server-manager-linux.zip /home/travis/factorio-server-manager-linux-${TRAVIS_TAG}.zip
- mv /home/travis/build/mroote/build/factorio-server-manager-windows.zip /home/travis/factorio-server-manager-windows-${TRAVIS_TAG}.zip
deploy:
provider: releases
api_key: "${GITHUB_TOKEN}"
draft: true
skip_cleanup: true
on:
tags: true
file:
- /home/travis/factorio-server-manager-linux-${TRAVIS_TAG}.zip
- /home/travis/factorio-server-manager-windows-${TRAVIS_TAG}.zip

View File

@ -1,10 +1,8 @@
# glibc is required for Factorio Server binaries to run
FROM frolvlad/alpine-glibc
MAINTAINER Mitch Roote <mitch@r00t.ca>
ENV FACTORIO_VERSION=latest \
MANAGER_VERSION=0.8.1 \
MANAGER_VERSION=0.8.2 \
ADMIN_PASSWORD=factorio
VOLUME /opt/factorio/saves /opt/factorio/mods /opt/factorio/config /security

20
docker/Dockerfile-build Normal file
View File

@ -0,0 +1,20 @@
FROM alpine:latest
RUN apk add --no-cache git make musl-dev go nodejs npm zip
ENV FAC_BRANCH=develop
ENV GOROOT /usr/lib/go
ENV GOPATH /go
ENV PATH /go/bin:$PATH
ENV FAC_ROOT /go/src/factorio-server-manager
COPY build.sh /usr/local/bin/build.sh
RUN mkdir -p ${GOPATH}/bin
RUN chmod u+x /usr/local/bin/build.sh
WORKDIR $FAC_ROOT
VOLUME /build
CMD ["/usr/local/bin/build.sh"]

View File

@ -5,16 +5,14 @@ SECURITY_PATH ?= $(FACTORIO_PATH)/security
SAVES_PATH ?= $(FACTORIO_PATH)/saves
MODS_PATH ?= $(FACTORIO_PATH)/mods
PORT_FORWARD ?= -p 80:80 -p 443:443 -p 34197:34197/udp
FACTORIO_BRANCH ?= develop
build:
docker build --build-arg FAC_BRANCH=$FACTORIO_BRANCH -f Dockerfile-build -t fsm-build .
docker build -t factorio-server-manager .
logs:
docker logs factorio-server
echo "Nginx Access Logs"
docker exec -it factorio-server cat /var/log/nginx/access.log
echo "Nginx Error Logs"
docker exec -it factorio-server cat /var/log/nginx/error.log
docker logs factorio-server -f
run:
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:
clean:
docker rmi factorio-server-manager
docker stop fsm-build
docker rmi fsm-build

8
docker/build.sh Normal file
View File

@ -0,0 +1,8 @@
#!/bin/sh
echo "Cloning ${FAC_BRANCH}"
git clone -b ${FAC_BRANCH} https://github.com/mroote/factorio-server-manager.git ${FAC_ROOT}
echo "Creating build..."
make gen_release
echo "Copying build artifacts..."
cp -v build/* /build/

5086
ui/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff