Compare commits

...

12 Commits
dev ... master

Author SHA1 Message Date
Marcel Otte b2bf61913f Fix workflow 2020-04-14 11:53:28 +02:00
Marcel M. Otte bf176adb88
Update dockerpublish.yml 2020-04-14 11:47:18 +02:00
Marcel M. Otte 4c13ccc440
Create dockerpublish.yml 2020-04-14 11:44:07 +02:00
Marcel Otte eaf33e1541 Update docker image to ubuntu:18.04
- Update java to jre11, worked in local tests
2019-03-10 13:21:47 +01:00
Marcel 73171b836f
Fix for PathManager issue 2018-07-04 20:31:32 +02:00
Marcel Otte 5e6146bf08 Removing any existing versionInfo.properties now. 2018-04-03 21:09:10 +02:00
Marcel M. Otte c1728d4993 Added Jenkinsfile.
Does just call build.sh.
2018-01-16 15:21:51 +01:00
Marcel Otte a16c7b0f3c oops 2016-10-08 11:45:49 +02:00
Marcel Otte 53ca038d5e readme changes to reflect new versioning schema, again. 2016-10-08 11:44:58 +02:00
Marcel Otte 81cef5b0a3 also tagging latest in same build as versioned variant. 2016-10-08 10:41:50 +02:00
Marcel Otte 9ca279f3bb Readme update for changed dev->nightly tag names 2016-10-06 10:32:26 +02:00
Marcel Otte 97e82b55f1 updated Readme to reflect latest changes. 2016-09-19 20:46:39 +02:00
6 changed files with 132 additions and 18 deletions

90
.github/workflows/dockerpublish.yml vendored Normal file
View File

@ -0,0 +1,90 @@
name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
# Publish `v1.2.3` tags as releases.
tags:
- v*
# Run tests for any PRs.
pull_request:
env:
IMAGE_NAME: terasology
jobs:
# Run tests.
# See also https://docs.docker.com/docker-hub/builds/automated-testing/
#test:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - name: Run tests
# run: |
# if [ -f docker-compose.test.yml ]; then
# docker-compose --file docker-compose.test.yml build
# docker-compose --file docker-compose.test.yml run sut
# else
# docker build . --file Dockerfile
# fi
# Push image to GitHub Packages.
# See also https://docs.docker.com/docker-hub/builds/
push:
# Ensure test job passes before pushing image.
# needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build . --file Dockerfile --tag image
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
rm versionInfo.properties* || true
if [ " ${TERASOLOGY_PROPERTIES_URL}" == " " ]; then
if [ " ${TERASOLOGY_BUILD}" == " " ]; then
TERASOLOGY_PROPERTIES_URL=http://jenkins.terasology.org/job/TerasologyStable/lastSuccessfulBuild/artifact/build/resources/main/org/terasology/version/versionInfo.properties
else
if [ " ${TERASOLOGY_BUILD}" == " unstable" ]; then
TERASOLOGY_PROPERTIES_URL=http://jenkins.terasology.org/job/Terasology/lastSuccessfulBuild/artifact/build/resources/main/org/terasology/version/versionInfo.properties
fi
fi
fi
wget ${TERASOLOGY_PROPERTIES_URL}
source versionInfo.properties
TAGNAME=$engineVersion-$displayVersion
echo TAGNAME=$TAGNAME
docker tag image $IMAGE_ID:$TAGNAME
docker push $IMAGE_ID:$TAGNAME

View File

@ -1,10 +1,10 @@
FROM ubuntu:16.04 FROM ubuntu:18.04
MAINTAINER Marcel Otte <qwc+docker@mmo.to> MAINTAINER Marcel Otte <qwc+docker@mmo.to>
RUN apt-get update && apt-get install -y openjdk-8-jre wget unzip RUN apt-get update && apt-get install -y openjdk-11-jre wget unzip
RUN mkdir /terasology \ RUN mkdir /terasology \
&& wget -P /terasology http://jenkins.terasology.org/job/DistroOmegaRelease/lastSuccessfulBuild/artifact/distros/omega/build/distributions/TerasologyOmega.zip \ && wget -P /terasology http://jenkins.terasology.org/job/DistroOmegaRelease/lastSuccessfulBuild/artifact/distros/omega/build/distributions/TerasologyOmega.zip \
&& unzip /terasology/TerasologyOmega.zip -d /terasology \ && unzip /terasology/TerasologyOmega.zip -d /terasology \
&& rm -f /terasology/TerasologyOmega.zip && rm -f /terasology/TerasologyOmega.zip
ENTRYPOINT java -jar /terasology/libs/Terasology.jar -headless -homedir=/terasology/server ENTRYPOINT cd /terasology && java -jar /terasology/libs/Terasology.jar -headless -homedir=/terasology/server
VOLUME /terasology/server VOLUME /terasology/server
EXPOSE 25777 EXPOSE 25777

7
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,7 @@
node ('main') {
stage('docker') {
sh '''
sh build.sh
'''
}
}

View File

@ -1,14 +1,25 @@
# docker-terasology # docker-terasology
check out and build with Automatic builds are provided by dockerhub and my own jenkins instance.
```docker build .``` For all enthusiasts who just want to have a running server:
- `docker pull qwick/terasology:latest`
- or with version: `docker pull qwick/terasology:1.2.1-alpha`
or use the image on dockerhub: For all developers who want a unstable build for debugging or just testing purposes:
https://registry.hub.docker.com/u/qwick/terasology/ - `docker pull qwick/terasology:unstable-latest`
- a versioned tag is available too.
## Latest changes Versioned tags may change over time.
### 2016-03-16: [Alpha release 1; Engine v1.0.0](https://github.com/MovingBlocks/Terasology/releases/tag/v1.0.0)
I'm again a little late with the docker image update, sorry! ;-) ## Versioning
To avoid confusion here the docker image tag schema:
Stable:
- `<engineVersion>-<displayVersion>` e.g. `1.2.1-alpha`
Unstable:
- `unstable-<engineVersion>-<buildNumber>` e.g. `unstable-1.2.2-SNAPSHOT-1806`
## Small guide ## Small guide
@ -25,8 +36,6 @@ Best practice would be cloning this repository and using docker-compose to pull
There may be standard configurations in the future for specific use cases, may be... ;-) There may be standard configurations in the future for specific use cases, may be... ;-)
One thing's for sure, I'll keep this a little more updated after this long time of silence.
More information about terasology can be found on following sites: More information about terasology can be found on following sites:
* https://github.com/MovingBlocks/Terasology * https://github.com/MovingBlocks/Terasology
* http://terasology.org/ * http://terasology.org/

View File

@ -1,5 +1,6 @@
#!/bin/bash #!/bin/bash
rm versionInfo.properties*
wget http://jenkins.terasology.org/job/TerasologyStable/lastSuccessfulBuild/artifact/build/resources/main/org/terasology/version/versionInfo.properties wget http://jenkins.terasology.org/job/TerasologyStable/lastSuccessfulBuild/artifact/build/resources/main/org/terasology/version/versionInfo.properties
@ -11,4 +12,9 @@ TAGNAME=$engineVersion-$displayVersion
docker build --no-cache -t qwick/terasology:$TAGNAME . docker build --no-cache -t qwick/terasology:$TAGNAME .
NEW_TAGNAME=latest
docker tag qwick/terasology:$TAGNAME qwick/terasology:$NEW_TAGNAME
docker push qwick/terasology:$TAGNAME docker push qwick/terasology:$TAGNAME
docker push qwick/terasology:$NEW_TAGNAME

View File

@ -1,6 +1,8 @@
version: '2'
services:
terasology: terasology:
image: qwick/terasology:latest image: qwick/terasology:latest
ports: ports:
- 25777:25777 - 25777:25777
volumes: volumes:
- /mnt/data/docker/terasology:/terasology/server - ./terasology:/terasology/server