Skip to content

Commit

Permalink
Adding config for custom SP version download
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaSimsic committed Sep 6, 2024
1 parent fc16579 commit 3b7cbf7
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
10 changes: 8 additions & 2 deletions .github/scripts/mxbuild.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM mcr.microsoft.com/dotnet/runtime:8.0
ARG MENDIX_VERSION
ARG MENDIX_VERSION_URL

RUN \
echo "Installing Java..." && \
Expand All @@ -10,8 +11,13 @@ RUN \
tar xfz /tmp/openjdk.tar.gz --directory /usr/lib/jvm && \
rm /tmp/openjdk.tar.gz
RUN \
echo "Downloading mxbuild ${MENDIX_VERSION}..." && \
wget -q https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz -O /tmp/mxbuild.tar.gz && \
if [ -z "$MENDIX_VERSION_URL" ]; then \
echo "Downloading mxbuild ${MENDIX_VERSION}..." && \
wget -q https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz -O /tmp/mbuild.tar.gz; \
else \
echo "Downloading mxbuild from provided URL..." && \
wget -q $MENDIX_VERSION_URL -O /tmp/mbuild.tar.gz; \
fi && \
mkdir /tmp/mxbuild && \
tar xfz /tmp/mxbuild.tar.gz --directory /tmp/mxbuild && \
rm /tmp/mxbuild.tar.gz
Expand Down
29 changes: 18 additions & 11 deletions .github/workflows/NativePipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Run Native Pipeline
on:
workflow_dispatch:
inputs:
mendix_version_url:
description: "Provide the url of SP to be used in job (Full path to mxbuild.tar.gz)"
required: false
default: ""

nt_branch:
description: "Native Template branch to use (default: master)"
default: "master"
Expand Down Expand Up @@ -54,12 +59,6 @@ on:
- video-player-native
- web-view-native

# schedule:
# - cron: "0 6 * * *"

# push:
# branches: [master]

pull_request:
# branches: [master]

Expand Down Expand Up @@ -97,17 +96,24 @@ jobs:
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
- name: "Get Mendix version"
id: get-mendix-version
if: ${{ github.event.inputs.mendix_version_url == '' }}
uses: notiz-dev/github-action-json-property@7a701887f4b568b23eb7b78bb0fc49aaeb1b68d3 # v0.2.0
with:
path: configs/e2e/mendix-versions.json
prop_path: latest
outputs:
mendix-version: ${{ steps.get-mendix-version.outputs.prop }}

- name: Use provided mx version
id: use-provided-mx-version
run: |
if [[ -z "${{ github.event.inputs.mendix_version_url }}" ]]; then
echo "MENDIX_VERSION=${{ steps.get-mendix-version.outputs.prop }}" >> $GITHUB_ENV
else
echo "MENDIX_VERSION_URL=${{ github.event.inputs.mendix_version_url }}" >> $GITHUB_ENV
fi
docker-images:
needs: mendix-version
runs-on: ubuntu-22.04
env:
MENDIX_VERSION: ${{ needs.mendix-version.outputs.mendix-version }}
steps:
- name: "Login to GitHub Container Registry"
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
Expand All @@ -117,7 +123,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Check if docker image already exists"
run: |
docker manifest inspect ghcr.io/mendix/native-widgets/mxbuild:${{ env.MENDIX_VERSION }} || EXIT_CODE=$?
docker manifest inspect ghcr.io/m/native-widgets/mxbuild:${{ env.MENDIX_VERSION }} || EXIT_CODE=$?
echo "IMAGE_MISSING=$EXIT_CODE" >> $GITHUB_ENV
- name: "Check out code"
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3
Expand All @@ -130,6 +136,7 @@ jobs:
context: ./.github/scripts
build-args: |
MENDIX_VERSION=${{ env.MENDIX_VERSION }}
MENDIX_VERSION_URL=${{ env.MENDIX_VERSION_URL }}
push: true
tags: ghcr.io/mendix/native-widgets/mxbuild:${{ env.MENDIX_VERSION }}
secrets: GIT_AUTH_TOKEN=${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 3b7cbf7

Please sign in to comment.