-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-cloud-test.ps1
More file actions
42 lines (32 loc) · 1.03 KB
/
dev-cloud-test.ps1
File metadata and controls
42 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
param(
[string]$ProjectId = "",
[string]$ArtifactReg = "",
[string]$GcpDocker = "",
[string]$ImageTag = "",
[string]$Region = "",
[string]$BqDatasetId = "",
[string]$Memory = "",
[string]$Cpu = "",
[string]$Threads = ""
)
$ErrorActionPreference = 'Stop'
$IMAGE_PATH = "$GcpDocker/$ProjectId/$ArtifactReg/$ImageTag"
Write-Host ""
Write-Host "BUILDING IMAGE LOCALLY" -ForegroundColor Blue
docker build --no-cache -t $IMAGE_PATH -f data_pipeline/Dockerfile .
Write-Host ""
Write-Host "PUSHING IMAGE TO CLOUD REPO" -ForegroundColor Blue
docker push $IMAGE_PATH
Write-Host ""
Write-Host "UPDATING JOB" -ForegroundColor Blue
gcloud run jobs update operations-pipeline-dev `
--image $IMAGE_PATH `
--update-env-vars GCP_PROJECT=$ProjectId `
--update-env-vars BQ_DATASET_ID=$BqDatasetId `
--update-env-vars POLARS_MAX_THREADS=$Threads `
--region $Region `
--memory $Memory `
--cpu $Cpu
Write-Host ""
Write-Host "EXECUTING CLOUD JOB" -ForegroundColor Blue
gcloud run jobs execute operations-pipeline-dev --region $Region