Skip to content

Commit 6f546e2

Browse files
[APIPUB-59] Update pipeline in order to use the latest package (#66)
1 parent b5168a6 commit 6f546e2

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

.github/workflows/on-pullrequest-dockerfile.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- main
1515
paths:
1616
- ".github/workflows/on-pullrequest-dockerfile.yml"
17-
- "src/*"
17+
- "**/Dockerfile*"
1818
workflow_dispatch:
1919

2020
permissions: read-all
@@ -35,13 +35,25 @@ jobs:
3535
matrix:
3636
dockerfile:
3737
[
38-
{ name: "publisher", path: "src/Dockerfile" },
39-
{ name: "development", path: "src/dev.Dockerfile" },
38+
{ name: "publisher", path: "src/Dockerfile", type: "published" },
39+
{ name: "development", path: "src/dev.Dockerfile", type: "local" },
4040
]
4141
steps:
4242
- name: Checkout code
4343
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4444

45+
- name: Set Version Numbers
46+
if: ${{ matrix.dockerfile.type == 'published' }}
47+
id: versions
48+
run: |
49+
FEED="9f7770ac-66d9-4fbc-b81e-b5ad79002b62"
50+
PACKAGE="2d9cb68f-2115-4791-a207-c6ae35d71e8d"
51+
52+
VERSIONS=$(curl https://feeds.dev.azure.com/ed-fi-alliance/$FEED/_apis/Packaging/Feeds/EdFi/Packages/$PACKAGE)
53+
LATEST=$(echo $VERSIONS | jq '.versions[] | select(.isLatest == true) | .version')
54+
echo "latest version: $LATEST"
55+
echo "VERSION=$LATEST" >> $GITHUB_OUTPUT
56+
4557
- uses: hadolint/hadolint-action@54c9adbab1582c2ef04b2016b760714a4bfde3cf # v3.1.0
4658
name: Run Linter on ${{ matrix.dockerfile.name }} Dockerfile
4759
with:
@@ -61,7 +73,7 @@ jobs:
6173
cd $folder
6274
dockerfile=$(echo ${{matrix.dockerfile.path}} | awk -F"/" '{print $NF}')
6375
64-
docker build -f $dockerfile -t ${{ matrix.dockerfile.name }} .
76+
docker build -f $dockerfile -t ${{ matrix.dockerfile.name }} --build-arg="VERSION=${{ steps.versions.outputs.VERSION }}" .
6577
6678
- name: Analyze
6779
uses: docker/scout-action@67eb1afe777307506aaecb9acd9a0e0389cb99ae # v1.5.0

src/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
FROM mcr.microsoft.com/dotnet/aspnet@sha256:ba398f8c6a0469436cc115bfbd278002baf4ce9423b6d8a9e904da6adc31a23d
88
LABEL maintainer="Ed-Fi Alliance, LLC and Contributors <[email protected]>"
99

10-
ENV VERSION="1.0.0"
10+
ARG VERSION=latest
1111

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

0 commit comments

Comments
 (0)