Skip to content

Commit

Permalink
Add custom SP version selection instead of url
Browse files Browse the repository at this point in the history
  • Loading branch information
NikolaSimsic committed Oct 7, 2024
1 parent 35c588e commit ff9ab40
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 22 deletions.
9 changes: 2 additions & 7 deletions .github/scripts/mxbuild.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ RUN \
rm /tmp/openjdk.tar.gz

RUN \
if [ -n "$MENDIX_VERSION_URL" ]; then \
echo "Downloading mxbuild from provided URL..." && \
wget -q $MENDIX_VERSION_URL -O /tmp/mxbuild.tar.gz; \
else \
echo "Downloading mxbuild ${MENDIX_VERSION}..." && \
wget -q https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz -O /tmp/mxbuild.tar.gz; \
fi && \
echo "Downloading mxbuild ${MENDIX_VERSION}..." && \
wget -q https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz -O /tmp/mxbuild.tar.gz && \
mkdir /tmp/mxbuild && \
tar xfz /tmp/mxbuild.tar.gz --directory /tmp/mxbuild && \
rm /tmp/mxbuild.tar.gz
Expand Down
22 changes: 7 additions & 15 deletions .github/workflows/NativePipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ 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)"
mendix_version:
description: "Provide the SP version to be used (e.g., 10.14.0.43709). If empty, latest version will be used."
required: false
default: ""

Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "scope=--since --include '*-native'" >> $GITHUB_OUTPUT
else
echo "scope=--include '*-native' --all" >> $GITHUB_OUTPUT
echo "scope=--all--include '*-native'" >> $GITHUB_OUTPUT
fi
fi
Expand All @@ -93,33 +93,26 @@ jobs:
runs-on: ubuntu-22.04
outputs:
mendix_version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }}
mendix_version_url: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION_URL }}
steps:
- name: "Check out code"
uses: actions/checkout@v3
- name: "Get Mendix version from JSON"
id: get-mendix-version
if: ${{ github.event.inputs.mendix_version_url == '' }}
uses: notiz-dev/[email protected]
with:
path: configs/e2e/mendix-versions.json
prop_path: latest
- name: Set Mendix version and URL
- name: Set Mendix version
id: set-mendix-version
run: |
if [[ -n "${{ github.event.inputs.mendix_version_url }}" ]]; then
MENDIX_VERSION=$(basename ${{ github.event.inputs.mendix_version_url }} | sed 's/mxbuild-\(.*\)\.tar\.gz/\1/')
echo "MENDIX_VERSION=${MENDIX_VERSION}" >> $GITHUB_OUTPUT
echo "MENDIX_VERSION_URL=${{ github.event.inputs.mendix_version_url }}" >> $GITHUB_OUTPUT
if [[ -n "${{ github.event.inputs.mendix_version }}" ]]; then
echo "MENDIX_VERSION=${{ github.event.inputs.mendix_version }}" >> $GITHUB_OUTPUT
else
MENDIX_VERSION="${{ steps.get-mendix-version.outputs.prop }}"
echo "MENDIX_VERSION=${MENDIX_VERSION}" >> $GITHUB_OUTPUT
echo "MENDIX_VERSION_URL=https://cdn.mendix.com/runtime/mxbuild-${MENDIX_VERSION}.tar.gz" >> $GITHUB_OUTPUT
echo "MENDIX_VERSION=${{ steps.get-mendix-version.outputs.prop }}" >> $GITHUB_OUTPUT
fi
- name: "Debug Mendix Version"
run: |
echo "Mendix Version: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION }}"
echo "Mendix Version URL: ${{ steps.set-mendix-version.outputs.MENDIX_VERSION_URL }}"
docker-images:
needs: mendix-version
Expand All @@ -146,7 +139,6 @@ jobs:
context: ./.github/scripts
build-args: |
MENDIX_VERSION=${{ needs.mendix-version.outputs.mendix_version }}
MENDIX_VERSION_URL=${{ needs.mendix-version.outputs.mendix_version_url }}
push: true
tags: ghcr.io/mendix/native-widgets/mxbuild:${{ needs.mendix-version.outputs.mendix_version }}
resources:
Expand Down

0 comments on commit ff9ab40

Please sign in to comment.