Skip to content

Commit

Permalink
improve ux
Browse files Browse the repository at this point in the history
  • Loading branch information
xiwenc committed Oct 20, 2022
1 parent 7588012 commit 9d081f7
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 3 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Create and publish a Docker image

on:
release:
types: [published]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified Dockerfile
100644 → 100755
Empty file.
10 changes: 10 additions & 0 deletions Dockerfile.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ghcr.io/cinaq/mxbuild-docker:latest AS builder
COPY . /srv/mendix/package
#ENV MENDIX_VERSION 7.23.24.25653
RUN mendix-build

FROM ghcr.io/cinaq/mendix-docker:latest
COPY --from=builder /srv/mendix/data/mendix_version /srv/mendix/data/mendix_version
RUN mendix-download
COPY --from=builder /srv/mendix/data/model-upload/app.mda /srv/mendix/data/model-upload/app.mda
RUN mendix-unpack
Empty file modified README.md
100644 → 100755
Empty file.
10 changes: 7 additions & 3 deletions bin/mendix-download
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@

set -e

VERSION="$1"
RUNTIME_URL="https://cdn.mendix.com/runtime/mendix-${VERSION}.tar.gz"
runtime_target_dir="/srv/mendix/runtimes/$VERSION"
MENDIX_VERSION="$1"
if [ "$MENDIX_VERSION" = "" ]; then
MENDIX_VERSION=$(cat /srv/mendix/data/mendix_version)
fi

RUNTIME_URL="https://cdn.mendix.com/runtime/mendix-${MENDIX_VERSION}.tar.gz"
runtime_target_dir="/srv/mendix/runtimes/$MENDIX_VERSION"
if [ ! -d "$runtime_target_dir" ]; then
echo "Downloading runtime from $RUNTIME_URL"
curl -SL "$RUNTIME_URL" | tar -zxC /srv/mendix/runtimes
Expand Down
Empty file modified m2ee.yaml
100644 → 100755
Empty file.

0 comments on commit 9d081f7

Please sign in to comment.