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

Fix deployment #118

Merged
merged 2 commits into from
Oct 22, 2023
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
10 changes: 5 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- uses: dflook/terraform-apply@v1
with:
path: toll-infrastructure
- uses: "google-github-actions/setup-gcloud@v1"
- run: ./deploy-batch.sh
working-directory: toll-application
- run: ./deploy-streaming.sh
working-directory: toll-application
# - uses: "google-github-actions/setup-gcloud@v1"
# - run: ./deploy-batch.sh
# working-directory: toll-application
# - run: ./deploy-streaming.sh
# working-directory: toll-application
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,6 @@ metals.sbt
.idea
.idea_modules
/.worksheet/

# Terraform
.terraform
21 changes: 21 additions & 0 deletions toll-application/run-batch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

PROJECT=playground-272019
REGION=europe-west1
DATE=`date +%Y-%m-%d`

gcloud dataflow flex-template run "toll-application-`date +%Y%m%d-%H%M%S`" \
--template-file-gcs-location "gs://$PROJECT-toll-application/templates/toll-application-batch.json" \
--region "$REGION" \
--staging-location="gs://$PROJECT-toll-application/staging/" \
--parameters effectiveDate="$DATE" \
--parameters entryTable="$PROJECT.toll_application.toll-booth-entry" \
--parameters exitTable="$PROJECT.toll_application.toll-booth-exit" \
--parameters vehicleRegistrationTable="$PROJECT.toll_application.vehicle-registration" \
--parameters entryStatsHourlyTable="$PROJECT.toll_application.toll-booth-entry-stats-hourly" \
--parameters entryStatsDailyTable="$PROJECT.toll_application.toll-booth-entry-stats-daily" \
--parameters totalVehicleTimesOneHourGapTable="$PROJECT.toll_application.total-vehicle-times-one-hour-gap" \
--parameters totalVehicleTimesOneHourGapDiagnosticTable="$PROJECT.toll_application.total-vehicle-times-one-hour-gap-diagnostic" \
--parameters vehiclesWithExpiredRegistrationDailyTable="$PROJECT.toll_application.vehicles-with-expired-registration-diagnostic-daily" \
--parameters vehiclesWithExpiredRegistrationDailyDiagnosticTable="$PROJECT.toll_application.vehicles-with-expired-registration-daily-diagnostic" \

3 changes: 2 additions & 1 deletion toll-application/run-streaming.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ REGION=europe-west1
gcloud dataflow flex-template run "toll-application-`date +%Y%m%d-%H%M%S`" \
--template-file-gcs-location "gs://$PROJECT-toll-application/templates/toll-application-streaming.json" \
--region "$REGION" \
--staging-location="gs://$PROJECT-toll-application/staging/" \
--enable-streaming-engine \
--parameters entrySubscription="projects/$PROJECT/subscriptions/toll-booth-entry" \
--parameters entryDlq="gs://$PROJECT-toll-application/dlq/entry" \
Expand All @@ -19,4 +20,4 @@ gcloud dataflow flex-template run "toll-application-`date +%Y%m%d-%H%M%S`" \
--parameters totalVehicleTimesDiagnosticTable="$PROJECT.toll_application.total-vehicle-times-diagnostic" \
--parameters vehiclesWithExpiredRegistrationTopic="projects/$PROJECT/topics/vehicle-registration" \
--parameters vehiclesWithExpiredRegistrationDiagnosticTable="$PROJECT.toll_application.vehicles-with-expired-registration-diagnostic" \
--parameters ioDiagnosticTable="$PROJECT.toll_application.io-diagnostic"
--parameters ioDiagnosticTable="$PROJECT.toll_application.io-diagnostic" \
19 changes: 19 additions & 0 deletions toll-infrastructure/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
30 changes: 0 additions & 30 deletions toll-infrastructure/.terraform/terraform.tfstate

This file was deleted.

14 changes: 14 additions & 0 deletions toll-infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,23 @@ provider "google" {
region = "europe-west1"
}

provider "google-beta" {
project = "playground-272019"
region = "europe-west1"
}

resource "google_artifact_registry_repository" "toll-application-registry-repository" {
provider = google-beta

repository_id = "toll-application"
format = "DOCKER"
cleanup_policies {
id = "keep-minimum-versions"
action = "KEEP"
most_recent_versions {
keep_count = 3
}
}
}
resource "google_storage_bucket" "toll-application-bucket" {
name = "playground-272019-toll-application"
Expand Down