Skip to content
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

Cleanup legacy #790

Merged
merged 6 commits into from
Jun 10, 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
226 changes: 0 additions & 226 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,6 @@ jobs:
dotnet-version: ${{ vars.VBR_DOTNET_VERSION_8 }}
secrets: inherit

build-api-legacy:
name: Build Api Legacy
uses: Informatievlaanderen/build-pipeline/.github/workflows/build-image.yml@main
needs: [ set-release-version ]
if: ${{ (github.repository_owner == 'Informatievlaanderen') && (needs.set-release-version.outputs.version != 'none') }}
with:
registry: ${{ vars.VBR_DEVOPS_DOCKER_REGISTRY }}/parcel-registry
image-file: pr-api-legacy-image.tar
image-name: api-legacy
test-project: ParcelRegistry.Tests
build-project: ParcelRegistry.Api.Legacy
semver: ${{ needs.set-release-version.outputs.version }}
dotnet-version: ${{ vars.VBR_DOTNET_VERSION_8 }}
secrets: inherit

build-api-oslo:
name: Build Api Oslo
uses: Informatievlaanderen/build-pipeline/.github/workflows/build-image.yml@main
Expand Down Expand Up @@ -262,19 +247,6 @@ jobs:
dotnet-version: ${{ vars.VBR_DOTNET_VERSION_8 }}
secrets: inherit

pack-api-legacy:
name: Pack Api Legacy
uses: Informatievlaanderen/build-pipeline/.github/workflows/pack.yml@main
needs: [ set-release-version ]
if: ${{ (github.repository_owner == 'Informatievlaanderen') && (needs.set-release-version.outputs.version != 'none') }}
with:
pack-file: Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.Legacy
test-project: ParcelRegistry.Tests
build-project: ParcelRegistry.Api.Legacy
semver: ${{ needs.set-release-version.outputs.version }}
dotnet-version: ${{ vars.VBR_DOTNET_VERSION_8 }}
secrets: inherit

pack-api-oslo:
name: Pack Api Oslo
uses: Informatievlaanderen/build-pipeline/.github/workflows/pack.yml@main
Expand Down Expand Up @@ -321,11 +293,9 @@ jobs:
needs: [ set-release-version,
#pack-api-backoffice,
pack-api-backoffice-abstractions,
pack-api-legacy,
pack-api-oslo,
pack-api-extract,
build-api-backoffice,
build-api-legacy,
build-api-oslo,
build-api-extract,
build-projector,
Expand Down Expand Up @@ -406,13 +376,6 @@ jobs:
name: nuget-Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.BackOffice.Abstractions-${{ needs.set-release-version.outputs.version }}
path: dist/nuget/

- name: Download NuGet Api Legacy
uses: actions/download-artifact@v4
continue-on-error: false
with:
name: nuget-Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.Legacy-${{ needs.set-release-version.outputs.version }}
path: dist/nuget/

- name: Download NuGet Api Oslo
uses: actions/download-artifact@v4
continue-on-error: false
Expand Down Expand Up @@ -560,12 +523,6 @@ jobs:
name: nuget-Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.BackOffice.Abstractions-${{ needs.release.outputs.version }}
path: ~/

- name: Download NuGet package api-legacy
uses: actions/download-artifact@v4
with:
name: nuget-Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.Legacy-${{ needs.release.outputs.version }}
path: ~/

- name: Download NuGet package api-oslo
uses: actions/download-artifact@v4
with:
Expand All @@ -583,7 +540,6 @@ jobs:
# dotnet nuget push ~/Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.BackOffice.$SEMVER.nupkg --source nuget.org --api-key $NUGET_API_KEY
run: |
dotnet nuget push ~/Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.BackOffice.Abstractions.$SEMVER.nupkg --source nuget.org --api-key $NUGET_API_KEY
dotnet nuget push ~/Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.Legacy.$SEMVER.nupkg --source nuget.org --api-key $NUGET_API_KEY
dotnet nuget push ~/Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.Oslo.$SEMVER.nupkg --source nuget.org --api-key $NUGET_API_KEY
dotnet nuget push ~/Be.Vlaanderen.Basisregisters.ParcelRegistry.Api.Extract.$SEMVER.nupkg --source nuget.org --api-key $NUGET_API_KEY
env:
Expand Down Expand Up @@ -661,7 +617,6 @@ jobs:
matrix:
image: [
'api-backoffice',
'api-legacy',
'api-oslo',
'api-extract',
'projector',
Expand Down Expand Up @@ -712,68 +667,6 @@ jobs:
SEMVER: ${{ needs.release.outputs.version }}
WORKSPACE: ${{ github.workspace }}

push_images_to_staging:
if: needs.release.outputs.version != 'none'
needs: [ release ]
name: Push images to Staging
runs-on: ubuntu-latest
strategy:
matrix:
image: [
'api-backoffice',
'api-legacy',
'api-oslo',
'api-extract',
'projector',
'projections-backoffice',
'projections-last-changed-list-console',
'consumer-address',
'producer',
'producer-snapshot-oslo',
'importer-grb',
'snapshot-verifier'
]
steps:
- name: Configure AWS credentials (Staging)
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-access-key-id: ${{ secrets.VBR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.VBR_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.VBR_AWS_REGION_PRD }}

- name: Login to Amazon ECR (Staging)
uses: aws-actions/amazon-ecr-login@v2

# Download artifact
- name: Download artifact
uses: actions/download-artifact@v4
continue-on-error: false
with:
name: ${{ matrix.image }}-${{ needs.release.outputs.version }}
path: ~/

# Load artifact
- name: Load artifact
shell: bash
run: |
echo pr-$IMAGE-image.tar
docker image load -i ~/pr-$IMAGE-image.tar
env:
IMAGE: ${{ matrix.image }}

- name: Push artifacts to ECR Staging
shell: bash
run: |
echo $IMAGE:$SEMVER
docker tag $BUILD_DOCKER_REGISTRY_TST/parcel-registry/$IMAGE:$SEMVER $BUILD_DOCKER_REGISTRY/parcel-registry/$IMAGE:$SEMVER
docker push $BUILD_DOCKER_REGISTRY/parcel-registry/$IMAGE:$SEMVER
env:
BUILD_DOCKER_REGISTRY_TST: ${{ vars.VBR_DEVOPS_DOCKER_REGISTRY }}
BUILD_DOCKER_REGISTRY: ${{ secrets.VBR_BUILD_DOCKER_REGISTRY }}
IMAGE: ${{ matrix.image }}
SEMVER: ${{ needs.release.outputs.version }}
WORKSPACE: ${{ github.workspace }}

deploy_to_test_start_slack:
if: github.repository_owner == 'Informatievlaanderen'
needs: [ push_images, upload-lambda, release ]
Expand Down Expand Up @@ -1085,122 +978,3 @@ jobs:
SLACK_BOT_TOKEN: ${{ secrets.VBR_SLACK_BOT_TOKEN }}
SLACK_CHANNEL: ${{ secrets.VBR_NOTIFIER_CHANNEL_NAME }}
REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }}

deploy_to_staging_start_slack:
if: github.repository_owner == 'Informatievlaanderen'
needs: [ push_images_to_staging, upload-lambda, release ]
name: Deploy to staging started
environment: stg
runs-on: ubuntu-latest

steps:
- name: Parse repository name
run: echo REPOSITORY_NAME=$(echo ""$GITHUB_REPOSITORY"" | awk -F / '{print $2}' | sed -e ""s/:refs//"") >> $GITHUB_ENV
shell: bash

- name: Notify deployment started
uses: slackapi/slack-github-action@v1.25.0
with:
channel-id: '#team-dinosaur-dev'
slack-message: Deployment of parcel-registry to staging has started
env:
SLACK_BOT_TOKEN: ${{ secrets.VBR_SLACK_BOT_TOKEN }}
SLACK_CHANNEL: ${{ secrets.VBR_NOTIFIER_CHANNEL_NAME }}
REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }}

deploy_to_staging:
if: github.repository_owner == 'Informatievlaanderen'
needs: [ deploy_to_staging_start_slack, release ]
name: Deploy to staging
runs-on: ubuntu-latest
strategy:
matrix:
services: [
'parcel-registry-api',
'parcel-registry-backoffice-api',
'parcel-registry-consumer-address',
'parcel-registry-producer',
'parcel-registry-producer-snapshot-oslo',
'parcel-registry-projections',
'parcel-registry-projections-backoffice',
'parcel-registry-importer-grb',
'parcel-registry-snapshot-verifier'
]
steps:
- name: CD services
env:
BUILD_URL: ${{ secrets.VBR_AWS_BUILD_API }}/${{matrix.services}}
STATUS_URL: ${{ secrets.VBR_AWS_BUILD_STATUS_API }}/${{matrix.services}}
uses: informatievlaanderen/awscurl-polling-action/polling-action@main
with:
environment: stg
version: ${{ needs.release.outputs.version }}
status-url: $STATUS_URL
deploy-url: $BUILD_URL
access-key: ${{ secrets.VBR_AWS_BUILD_USER_ACCESS_KEY_ID }}
secret-key: ${{ secrets.VBR_AWS_BUILD_USER_SECRET_ACCESS_KEY }}
region: eu-west-1
interval: 2

- name: output CD services
shell: bash
run: |
echo build-uuid: ${{ steps.awscurl-polling-action.outputs.build-uuid }}
echo Status: ${{ steps.awscurl-polling-action.outputs.status }}
echo ${{ steps.awscurl-polling-action.outputs.final-message }}

deploy_lambda_to_staging:
if: github.repository_owner == 'Informatievlaanderen'
needs: [ deploy_to_staging, release ]
name: Deploy lambda to staging
runs-on: ubuntu-latest

steps:
- name: CD Lambda(s) Configure credentials
uses: aws-actions/configure-aws-credentials@v4.0.2
with:
aws-access-key-id: ${{ secrets.VBR_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.VBR_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.VBR_AWS_REGION_PRD }}

- name: Prepare Lambda(s)
shell: bash
run: |
echo aws s3 cp s3://s3-vbr-stg-basisregisters-lam-pr-sqsbackofficehandlerfunction/$VERSION/lambda.zip s3://s3-vbr-stg-basisregisters-lam-pr-sqsbackofficehandlerfunction/lambda.zip --copy-props none
aws s3 cp s3://s3-vbr-stg-basisregisters-lam-pr-sqsbackofficehandlerfunction/$VERSION/lambda.zip s3://s3-vbr-stg-basisregisters-lam-pr-sqsbackofficehandlerfunction/lambda.zip --copy-props none
env:
VERSION: ${{ needs.release.outputs.version }}

- name: Promote Lambda(s)
shell: bash
run: |
echo pulling awscurl docker image
docker pull ghcr.io/okigan/awscurl:latest
echo docker run --rm okigan/awscurl --access_key $ACCESS_KEY_ID --secret_key $SECRET_ACCESS_KEY_ID --region $REGION -X POST -d '{ "functionName": "pr-sqsbackofficehandlerfunction", "project": "basisregisters", "domain": "basisregisters" }' $PROMOTEURL/stg
docker run --rm okigan/awscurl --access_key $ACCESS_KEY_ID --secret_key $SECRET_ACCESS_KEY_ID --region $REGION -X POST -d '{ "functionName": "pr-sqsbackofficehandlerfunction", "project": "basisregisters", "domain": "basisregisters" }' $PROMOTEURL/stg
env:
ACCESS_KEY_ID: ${{ secrets.VBR_AWS_ACCESS_KEY_ID_TST }}
SECRET_ACCESS_KEY_ID: ${{ secrets.VBR_AWS_SECRET_ACCESS_KEY_TST }}
REGION: ${{ secrets.VBR_AWS_REGION_PRD }}
PROMOTEURL: ${{ secrets.VBR_AWS_PROMOTE_LAMBDA_BASEURL }}

deploy_to_staging_finish_slack:
if: github.repository_owner == 'Informatievlaanderen'
needs: [ deploy_lambda_to_staging ]
name: Deploy to staging finished
runs-on: ubuntu-latest

steps:
- name: Parse repository name
run: echo REPOSITORY_NAME=$(echo ""$GITHUB_REPOSITORY"" | awk -F / '{print $2}' | sed -e ""s/:refs//"") >> $GITHUB_ENV
shell: bash

- name: Notify deployment finished
uses: slackapi/slack-github-action@v1.25.0
with:
channel-id: '#team-dinosaur-dev'
slack-message: Deployment of parcel-registry to staging has finished
env:
SLACK_BOT_TOKEN: ${{ secrets.VBR_SLACK_BOT_TOKEN }}
SLACK_CHANNEL: ${{ secrets.VBR_NOTIFIER_CHANNEL_NAME }}
REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }}
7 changes: 0 additions & 7 deletions ParcelRegistry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{A1CB15D5-7
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ParcelRegistry", "src\ParcelRegistry\ParcelRegistry.csproj", "{8FE01FF7-515C-448A-A549-EE56080BE1BA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ParcelRegistry.Api.Legacy", "src\ParcelRegistry.Api.Legacy\ParcelRegistry.Api.Legacy.csproj", "{2343237C-031B-4896-9958-57519E455DE1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ParcelRegistry.Infrastructure", "src\ParcelRegistry.Infrastructure\ParcelRegistry.Infrastructure.csproj", "{1F7349F4-ACAB-4DAC-8476-71736E65FE41}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ParcelRegistry.Projections.Legacy", "src\ParcelRegistry.Projections.Legacy\ParcelRegistry.Projections.Legacy.csproj", "{713526B9-1FE5-409E-8754-11B8B50E3BC1}"
Expand Down Expand Up @@ -85,10 +83,6 @@ Global
{8FE01FF7-515C-448A-A549-EE56080BE1BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FE01FF7-515C-448A-A549-EE56080BE1BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FE01FF7-515C-448A-A549-EE56080BE1BA}.Release|Any CPU.Build.0 = Release|Any CPU
{2343237C-031B-4896-9958-57519E455DE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2343237C-031B-4896-9958-57519E455DE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2343237C-031B-4896-9958-57519E455DE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2343237C-031B-4896-9958-57519E455DE1}.Release|Any CPU.Build.0 = Release|Any CPU
{1F7349F4-ACAB-4DAC-8476-71736E65FE41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F7349F4-ACAB-4DAC-8476-71736E65FE41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F7349F4-ACAB-4DAC-8476-71736E65FE41}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -183,7 +177,6 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{8FE01FF7-515C-448A-A549-EE56080BE1BA} = {B483712F-241C-411F-8CC7-D46B3530DF65}
{2343237C-031B-4896-9958-57519E455DE1} = {B483712F-241C-411F-8CC7-D46B3530DF65}
{1F7349F4-ACAB-4DAC-8476-71736E65FE41} = {B483712F-241C-411F-8CC7-D46B3530DF65}
{713526B9-1FE5-409E-8754-11B8B50E3BC1} = {B483712F-241C-411F-8CC7-D46B3530DF65}
{951C912B-E9B2-4941-BE18-C5125FC0D9E6} = {DF5FFD7D-3020-4F80-87EF-BE2D2CACD27E}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public static class ParcelRegistryExtractV2Builder
public static IEnumerable<ExtractFile> CreateParcelFiles(ExtractContext context)
{
var extractItems = context
.ParcelExtractV2
.ParcelExtract
.AsNoTracking();

var parcelProjectionState = context
.ProjectionStates
.AsNoTracking()
.Single(m => m.Name == typeof(ParcelExtractV2Projections).FullName);
.Single(m => m.Name == typeof(ParcelExtractProjections).FullName);
var extractMetadata = new Dictionary<string,string>
{
{ ExtractMetadataKeys.LatestEventId, parcelProjectionState.Position.ToString()}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ParcelRegistryLinkExtractBuilder
public static IEnumerable<ExtractFile> CreateParcelFiles(ExtractContext context)
{
var extractItems = context
.ParcelLinkExtractWithCount
.ParcelLinkExtract
.AsNoTracking();

var parcelProjectionState = context
Expand Down
25 changes: 0 additions & 25 deletions src/ParcelRegistry.Api.Legacy/Convertors/ParcelStatus.cs

This file was deleted.

30 changes: 0 additions & 30 deletions src/ParcelRegistry.Api.Legacy/Dockerfile

This file was deleted.

Loading
Loading