-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #708 from bcgov/jess-admin-tool
Jess admin tool
- Loading branch information
Showing
6 changed files
with
315 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: diam-common | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
paths: | ||
- "backend/common/**" | ||
- ".github/workflows/build-push-common.yml" | ||
workflow_dispatch: | ||
env: | ||
IMAGE_NAME: common | ||
WORKING_DIRECTORY: ./backend/common | ||
BRANCH_NAME: develop | ||
VALUES_FILE: dev | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
|
||
if: github.event_name == 'push' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set environment for branch | ||
run: | | ||
if [[ ${{ github.ref_name }} == 'main' ]]; then | ||
echo "BRANCH_NAME=main" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=prod" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'test' ]]; then | ||
echo "BRANCH_NAME=test" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=test" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'develop' ]]; then | ||
echo "BRANCH_NAME=develop" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=dev" >> "$GITHUB_ENV" | ||
fi | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Branch name | ||
run: echo running on branch ${GITHUB_REF##*/} | ||
|
||
- name: Login to Artifactory | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: artifacts.developer.gov.bc.ca | ||
username: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
password: ${{ secrets.ARTIFACTORY_PASSWORD }} | ||
|
||
- name: Dotnet Pack | ||
working-directory: ${{env.WORKING_DIRECTORY}} | ||
run: | | ||
dotnet build -c Release | ||
dotnet pack -c Release | ||
ls -lstra | ||
- name: Docker Push to Artifactory | ||
working-directory: backend/common/bin/Release | ||
run: | | ||
nuget push *.nupkg -Source https://artifacts.developer.gov.bc.ca/artifactory/api/nuget/de27-common -apikey ${{ secrets.ARTIFACTORY_USERNAME }}:${{ secrets.ARTIFACTORY_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
name: diam-common-constants | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
paths: | ||
- "backend/CommonConstants/**" | ||
- ".github/workflows/build-push-commonconstants.yml" | ||
workflow_dispatch: | ||
env: | ||
IMAGE_NAME: common | ||
WORKING_DIRECTORY: ./backend/CommonConstants | ||
BRANCH_NAME: develop | ||
VALUES_FILE: dev | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
|
||
if: github.event_name == 'push' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set environment for branch | ||
run: | | ||
if [[ ${{ github.ref_name }} == 'main' ]]; then | ||
echo "BRANCH_NAME=main" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=prod" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'test' ]]; then | ||
echo "BRANCH_NAME=test" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=test" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'develop' ]]; then | ||
echo "BRANCH_NAME=develop" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=dev" >> "$GITHUB_ENV" | ||
fi | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Branch name | ||
run: echo running on branch ${GITHUB_REF##*/} | ||
|
||
- name: Login to Artifactory | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: artifacts.developer.gov.bc.ca | ||
username: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
password: ${{ secrets.ARTIFACTORY_PASSWORD }} | ||
|
||
- name: Dotnet Pack | ||
working-directory: ${{env.WORKING_DIRECTORY}} | ||
run: | | ||
dotnet build -c Release | ||
dotnet pack -c Release | ||
ls -lstra | ||
- name: Docker Push to Artifactory | ||
working-directory: backend/CommonConstants/bin/Release | ||
run: | | ||
nuget push *.nupkg -Source https://artifacts.developer.gov.bc.ca/artifactory/api/nuget/de27-common -apikey ${{ secrets.ARTIFACTORY_USERNAME }}:${{ secrets.ARTIFACTORY_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: diam-common-models | ||
|
||
on: | ||
push: | ||
branches: [develop] | ||
paths: | ||
- "backend/CommonModels/**" | ||
- ".github/workflows/build-push-commonmodels.yml" | ||
workflow_dispatch: | ||
env: | ||
WORKING_DIRECTORY: ./backend/CommonModels | ||
BRANCH_NAME: develop | ||
VALUES_FILE: dev | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
|
||
if: github.event_name == 'push' | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set environment for branch | ||
run: | | ||
if [[ ${{ github.ref_name }} == 'main' ]]; then | ||
echo "BRANCH_NAME=main" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=prod" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'test' ]]; then | ||
echo "BRANCH_NAME=test" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=test" >> "$GITHUB_ENV" | ||
fi | ||
if [[ ${{ github.ref_name }} == 'develop' ]]; then | ||
echo "BRANCH_NAME=develop" >> "$GITHUB_ENV" | ||
echo "VALUES_FILE=dev" >> "$GITHUB_ENV" | ||
fi | ||
- name: Extract branch name | ||
shell: bash | ||
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT | ||
id: extract_branch | ||
|
||
- name: Branch name | ||
run: echo running on branch ${GITHUB_REF##*/} | ||
|
||
- name: Login to Artifactory | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: artifacts.developer.gov.bc.ca | ||
username: ${{ secrets.ARTIFACTORY_USERNAME }} | ||
password: ${{ secrets.ARTIFACTORY_PASSWORD }} | ||
|
||
- name: Dotnet Pack | ||
working-directory: ${{env.WORKING_DIRECTORY}} | ||
run: | | ||
dotnet build -c Release | ||
dotnet pack -c Release | ||
ls -lstra | ||
- name: Docker Push to Artifactory | ||
working-directory: backend/CommonModels/bin/Release | ||
run: | | ||
nuget push *.nupkg -Source https://artifacts.developer.gov.bc.ca/artifactory/api/nuget/de27-common -apikey ${{ secrets.ARTIFACTORY_USERNAME }}:${{ secrets.ARTIFACTORY_PASSWORD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#------------------------------------------------------------------------------------ | ||
# WebAPI service Dockerfile | ||
#------------------------------------------------------------------------------------ | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
ENV ASPNETCORE_URLS=http://*:8080 | ||
ENV ASPNETCORE_ENVIRONMENT="Production" | ||
ENV \ | ||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 \ | ||
LC_ALL=en_US.UTF-8 \ | ||
LANG=en_US.UTF-8 | ||
|
||
RUN apk add --no-cache icu-libs | ||
RUN apk add bash | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
|
||
WORKDIR /src | ||
COPY ["common/Common.csproj", "common/Common.csproj"] | ||
COPY ["CommonConstants/CommonConstants.csproj", "CommonConstants/CommonConstants.csproj"] | ||
RUN dotnet restore -r linux-musl-x64 "common/Common.csproj" | ||
COPY . . | ||
RUN dotnet build -r linux-musl-x64 "common/Common.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
RUN dotnet publish -r linux-musl-x64 "common/Common.csproj" -c Release -o /app/publish | ||
USER root | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
|
||
USER 1001 | ||
|
||
ENTRYPOINT ["dotnet", "Common.dll"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#------------------------------------------------------------------------------------ | ||
# WebAPI service Dockerfile | ||
#------------------------------------------------------------------------------------ | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
ENV ASPNETCORE_URLS=http://*:8080 | ||
ENV ASPNETCORE_ENVIRONMENT="Production" | ||
ENV \ | ||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 \ | ||
LC_ALL=en_US.UTF-8 \ | ||
LANG=en_US.UTF-8 | ||
|
||
RUN apk add --no-cache icu-libs | ||
RUN apk add bash | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
|
||
WORKDIR /src | ||
COPY ["CommonConstants/CommonConstants.csproj", "CommonConstants/CommonConstants.csproj"] | ||
RUN dotnet restore -r linux-musl-x64 "CommonConstants/CommonConstants.csproj" | ||
COPY . . | ||
RUN dotnet build -r linux-musl-x64 "CommonConstants/CommonConstants.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
RUN dotnet publish -r linux-musl-x64 "CommonConstants/CommonConstants.csproj" -c Release -o /app/publish | ||
USER root | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
|
||
USER 1001 | ||
|
||
ENTRYPOINT ["dotnet", "CommonConstants.dll"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#------------------------------------------------------------------------------------ | ||
# WebAPI service Dockerfile | ||
#------------------------------------------------------------------------------------ | ||
|
||
FROM mcr.microsoft.com/dotnet/aspnet:8.0-alpine AS base | ||
WORKDIR /app | ||
EXPOSE 8080 | ||
ENV ASPNETCORE_URLS=http://*:8080 | ||
ENV ASPNETCORE_ENVIRONMENT="Production" | ||
ENV \ | ||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 \ | ||
LC_ALL=en_US.UTF-8 \ | ||
LANG=en_US.UTF-8 | ||
|
||
RUN apk add --no-cache icu-libs | ||
RUN apk add bash | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
|
||
WORKDIR /src | ||
COPY ["CommonModels/CommonModels.csproj", "CommonModels/CommonModels.csproj"] | ||
RUN dotnet restore -r linux-musl-x64 "CommonModels/CommonModels.csproj" | ||
COPY . . | ||
RUN dotnet build -r linux-musl-x64 "CommonModels/CommonModels.csproj" -c Release -o /app/build | ||
|
||
FROM build AS publish | ||
RUN dotnet publish -r linux-musl-x64 "CommonModels/CommonModels.csproj" -c Release -o /app/publish | ||
USER root | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
|
||
USER 1001 | ||
|
||
ENTRYPOINT ["dotnet", "CommonModels.dll"] | ||
|