Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into 117249/transfers-404
Browse files Browse the repository at this point in the history
  • Loading branch information
dneed-nimble authored Jan 30, 2023
2 parents b4a8f2e + 40b73c1 commit c1e3504
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 288 deletions.
90 changes: 69 additions & 21 deletions .github/workflows/build-and-push-image-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,46 +5,94 @@ on:
branches:
- main

env:
DOCKER_IMAGE: acatran-app

jobs:
build-and-push-image-development:
name: Build and push image development
set-env:
name: Prepare
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.var.outputs.branch }}
release: ${{ steps.var.outputs.release }}
steps:
- id: var
run: |
GIT_REF=${{ github.ref }}
GIT_BRANCH=${GIT_REF##*/}
RELEASE=dev-`date +%Y-%m-%d`.${{ github.run_number }}
echo "branch=$GIT_BRANCH" >> $GITHUB_OUTPUT
echo "release=${RELEASE}" >> $GITHUB_OUTPUT
build-and-push-image:
name: Build and push image
needs: [ set-env ]
environment: Dev
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Azure Container Registry login
- name: Login to ACR
uses: docker/login-action@v2
with:
username: ${{ secrets.DEVELOPMENT_AZURE_ACR_CLIENTID }}
password: ${{ secrets.DEVELOPMENT_AZURE_ACR_SECRET }}
registry: ${{ secrets.DEVELOPMENT_AZURE_ACR_URL }}

- name: Prepare tags
id: prepare-tags
run: |
DOCKER_IMAGE=${{ secrets.DEVELOPMENT_AZURE_ACR_URL }}/acatran-app
VERSION=dev-`date +%Y-%m-%d`.${{ github.run_number }}
SHA=sha-${GITHUB_SHA}
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHA}"
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
echo "deploy-version=${VERSION}" >> $GITHUB_OUTPUT
- name: Push image
- name: Build and push image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile.gpaas-azure-migration
file: Dockerfile.gpaas-azure-migration
tags: |
${{ secrets.DEVELOPMENT_AZURE_ACR_URL }}/${{ env.DOCKER_IMAGE }}:${{ needs.set-env.outputs.branch }}
${{ secrets.DEVELOPMENT_AZURE_ACR_URL }}/${{ env.DOCKER_IMAGE }}:${{ needs.set-env.outputs.release }}
${{ secrets.DEVELOPMENT_AZURE_ACR_URL }}/${{ env.DOCKER_IMAGE }}:latest
push: true
tags: ${{ steps.prepare-tags.outputs.tags }}

- name: Azure login with ACA credentials
create-tag:
name: Tag and release
needs: [ set-env ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Create tag
run: |
git tag ${{ needs.set-env.outputs.release }}
git push origin ${{ needs.set-env.outputs.release }}
- name: Create release
uses: "actions/github-script@v6"
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
try {
await github.rest.repos.createRelease({
draft: false,
generate_release_notes: true,
name: "${{ needs.set-env.outputs.release }}",
owner: context.repo.owner,
prerelease: false,
repo: context.repo.repo,
tag_name: "${{ needs.set-env.outputs.release }}",
});
} catch (error) {
core.setFailed(error.message);
}
deploy-image:
name: Deploy to Development
needs: [ build-and-push-image, set-env ]
runs-on: ubuntu-latest
environment: Dev
steps:
- name: Login to Azure
uses: azure/login@v1
with:
creds: ${{ secrets.DEVELOPMENT_AZURE_ACA_CREDENTIALS }}

- name: Update Azure Container Apps Revision
- name: Update Container Revision
uses: azure/CLI@v1
with:
azcliversion: 2.40.0
Expand All @@ -53,5 +101,5 @@ jobs:
az containerapp update \
--name ${{ secrets.DEVELOPMENT_AZURE_ACA_CONTAINERAPP_NAME }} \
--resource-group ${{ secrets.DEVELOPMENT_AZURE_ACA_RESOURCE_GROUP }} \
--image ${{ secrets.DEVELOPMENT_AZURE_ACR_URL }}/acatran-app:${{ steps.prepare-tags.outputs.deploy-version }} \
--image ${{ secrets.DEVELOPMENT_AZURE_ACR_URL }}/${{ env.DOCKER_IMAGE }}:${{ needs.set-env.outputs.release }} \
--output none
10 changes: 4 additions & 6 deletions Frontend/Options/ServiceLinkOptions.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
namespace Frontend.Options
namespace Frontend.Options;

public class ServiceLinkOptions
{
public class ServiceLinkOptions
{
public const string Name = "ServiceLink";
public string ConversionsUrl { get; set; }
}
public string ConversionsUrl { get; set; }
}
25 changes: 13 additions & 12 deletions Frontend/Services/AzureAd/AzureAdOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@
using System.Collections.Generic;
using System.Globalization;

namespace Frontend.Services.AzureAd
namespace Frontend.Services.AzureAd;

public class AzureAdOptions
{
public class AzureAdOptions
{
public const string Name = "AzureAd";
public Guid ClientId { get; set; }
public string ClientSecret { get; set; }
public Guid TenantId { get; set; }
public Guid GroupId { get; set; }
public string ApiUrl { get; set; } = "https://graph.microsoft.com/";
public string Authority => string.Format(CultureInfo.InvariantCulture, "https://login.microsoftonline.com/{0}", TenantId);
public IEnumerable<string> Scopes => new[] { $"{ApiUrl}.default" };
}
public Guid ClientId { get; set; }
public string ClientSecret { get; set; }
public Guid TenantId { get; set; }
public Guid GroupId { get; set; }
public string ApiUrl { get; set; } = "https://graph.microsoft.com/";

public string Authority =>
string.Format(CultureInfo.InvariantCulture, "https://login.microsoftonline.com/{0}", TenantId);

public IEnumerable<string> Scopes => new[] { $"{ApiUrl}.default" };
}
Loading

0 comments on commit c1e3504

Please sign in to comment.