Skip to content

[APIPUB-59] Update pipeline in order to use the latest package #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2024
Merged
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
20 changes: 16 additions & 4 deletions .github/workflows/on-pullrequest-dockerfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- main
paths:
- ".github/workflows/on-pullrequest-dockerfile.yml"
- "src/*"
- "**/Dockerfile*"
workflow_dispatch:

permissions: read-all
Expand All @@ -35,13 +35,25 @@ jobs:
matrix:
dockerfile:
[
{ name: "publisher", path: "src/Dockerfile" },
{ name: "development", path: "src/dev.Dockerfile" },
{ name: "publisher", path: "src/Dockerfile", type: "published" },
{ name: "development", path: "src/dev.Dockerfile", type: "local" },
]
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set Version Numbers
if: ${{ matrix.dockerfile.type == 'published' }}
id: versions
run: |
FEED="9f7770ac-66d9-4fbc-b81e-b5ad79002b62"
PACKAGE="2d9cb68f-2115-4791-a207-c6ae35d71e8d"

VERSIONS=$(curl https://feeds.dev.azure.com/ed-fi-alliance/$FEED/_apis/Packaging/Feeds/EdFi/Packages/$PACKAGE)
LATEST=$(echo $VERSIONS | jq '.versions[] | select(.isLatest == true) | .version')
echo "latest version: $LATEST"
echo "VERSION=$LATEST" >> $GITHUB_OUTPUT

- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
name: Run Linter on ${{ matrix.dockerfile.name }} Dockerfile
with:
Expand All @@ -61,7 +73,7 @@ jobs:
cd $folder
dockerfile=$(echo ${{matrix.dockerfile.path}} | awk -F"/" '{print $NF}')

docker build -f $dockerfile -t ${{ matrix.dockerfile.name }} .
docker build -f $dockerfile -t ${{ matrix.dockerfile.name }} --build-arg="VERSION=${{ steps.versions.outputs.VERSION }}" .

- name: Analyze
uses: docker/scout-action@67eb1afe777307506aaecb9acd9a0e0389cb99ae # v1.5.0
Expand Down
2 changes: 1 addition & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
FROM mcr.microsoft.com/dotnet/aspnet@sha256:ba398f8c6a0469436cc115bfbd278002baf4ce9423b6d8a9e904da6adc31a23d
LABEL maintainer="Ed-Fi Alliance, LLC and Contributors <[email protected]>"

ENV VERSION="1.0.0"
ARG VERSION=latest

# Alpine image does not contain Globalization Cultures library so we need to install ICU library to get fopr LINQ expression to work
# Disable the globaliztion invariant mode (set in base image)
Expand Down
Loading