Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/docker-multitest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Check Multi Arch

on:
push:
branches-ignore:
- master
pull_request:
branches:
- master


jobs:
Normal:
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2

- name: Setup ENV
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2.1.4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx

- name: Normal
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: false
file: Dockerfile
tags: |
emcniece/dockeryourxyzzy:${{ env.VERSION }}
ghcr.io/emcniece/dockeryourxyzzy:${{ env.VERSION }}
emcniece/dockeryourxyzzy:latest
ghcr.io/emcniece/dockeryourxyzzy:latest

- name: Prebuilt
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: false
file: Dockerfile.built
tags: |
emcniece/dockeryourxyzzy:${{ env.VERSION }}-built
ghcr.io/emcniece/dockeryourxyzzy:${{ env.VERSION }}-built

- name: Check default.sh
run: shellcheck scripts/default.sh
90 changes: 72 additions & 18 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,75 @@ on:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Get release version
id: get_version
run: echo "RELEASE_VERSION=$(cat ./VERSION)" >> $GITHUB_ENV
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: emcniece/dockeryourxyzzy
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: "latest,${{ env.RELEASE_VERSION }}"
- name: Docker Hub Description
uses: peter-evans/dockerhub-description@v2
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
DOCKERHUB_REPOSITORY: emcniece/dockeryourxyzzy
# steps:
# - uses: actions/checkout@master
# - name: Get release version
# id: get_version
# run: echo "RELEASE_VERSION=$(cat ./VERSION)" >> $GITHUB_ENV
# - name: Publish to Registry
# uses: elgohr/Publish-Docker-Github-Action@master
# with:
# name: emcniece/dockeryourxyzzy
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}
# tags: "latest,${{ env.RELEASE_VERSION }}"
# - name: Docker Hub Description
# uses: peter-evans/dockerhub-description@v2
# env:
# DOCKERHUB_USERNAME: ${{ secrets.DOCKER_USERNAME }}
# DOCKERHUB_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
# DOCKERHUB_REPOSITORY: emcniece/dockeryourxyzzy

Normal:
runs-on: ubuntu-latest
steps:
# - name: Login To GitHub
# run: echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin

- name: Login to Docker
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login --username ${{ secrets.DOCKER_USERNAME }} --password-stdin

- uses: actions/checkout@v2

- name: Setup ENV
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2.1.4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx

- name: Normal
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: true
file: Dockerfile
tags: |
emcniece/dockeryourxyzzy:${{ env.VERSION }}
# ghcr.io/emcniece/dockeryourxyzzy:${{ env.VERSION }}
emcniece/dockeryourxyzzy:latest
# ghcr.io/emcniece/dockeryourxyzzy:latest

- name: Prebuilt
uses: docker/build-push-action@v2
with:
platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: true
file: Dockerfile.built
tags: |
emcniece/dockeryourxyzzy:${{ env.VERSION }}-built
# ghcr.io/emcniece/dockeryourxyzzy:${{ env.VERSION }}-built
18 changes: 15 additions & 3 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,27 @@ on:
- master

jobs:
build:
Normal:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Check default.sh
run: shellcheck scripts/default.sh

- name: Build Image
run: make image
run: make image

- name: Inspect
run: make inspect
run: make inspect

Prebuilt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Build Image
run: make built-image

- name: Inspect
run: make built-inspect

36 changes: 36 additions & 0 deletions Dockerfile.built
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM davidcaste/alpine-tomcat:jdk8tomcat7 as builder

# MAVEN
ENV MAVEN_VERSION 3.5.4
ENV USER_HOME_DIR /root
ENV SHA ce50b1c91364cb77efe3776f756a6d92b76d9038b0a0782f7d53acf1e997a14d
ENV BASE_URL https://apache.osuosl.org/maven/maven-3/${MAVEN_VERSION}/binaries
ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"

RUN apk add --no-cache curl tar procps \
&& mkdir -p /usr/share/maven/ref \
&& curl -fsSL -o /tmp/apache-maven.tar.gz "${BASE_URL}/apache-maven-${MAVEN_VERSION}-bin.tar.gz" \
&& echo "${SHA} /tmp/apache-maven.tar.gz" | sha256sum -c - || true \
&& tar -xzf /tmp/apache-maven.tar.gz -C /usr/share/maven --strip-components=1 \
&& rm -f /tmp/apache-maven.tar.gz \
&& ln -s /usr/share/maven/bin/mvn /usr/bin/mvn

# PYX
ENV GIT_BRANCH master

RUN apk add git --no-cache \
&& git clone -b $GIT_BRANCH https://github.com/ajanata/PretendYoureXyzzy.git /project

ADD overrides/settings-docker.xml /usr/share/maven/ref/
WORKDIR /project

RUN mv build.properties.example build.properties \
&& mvn compile war:war -Dhttps.protocols=TLSv1.2 -Dmaven.buildNumber.doCheck=false -Dmaven.buildNumber.doUpdate=false


FROM jetty:9-jre11-slim

COPY --from=builder /project/target/ZY.war /var/lib/jetty/webapps/ROOT.war

CMD [ "java","-jar","/usr/local/jetty/start.jar" ]
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ image:
docker build -t $(DOCKER_IMAGE):$(VERSION) \
-f Dockerfile .

inspect:
docker inspect $(DOCKER_IMAGE):$(VERSION)

built-image:
docker build -t $(DOCKER_IMAGE):$(VERSION)-built -f Dockerfile.built .

built-inspect:
docker inspect $(DOCKER_IMAGE):$(VERSION)-built

run:
docker run -d -p 8080:8080 $(DOCKER_IMAGE):$(VERSION)

Expand Down