-
Notifications
You must be signed in to change notification settings - Fork 0
/
fn-setup.tf
86 lines (67 loc) · 3.21 KB
/
fn-setup.tf
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
## Copyright (c) 2020, Oracle and/or its affiliates.
## All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl
resource "null_resource" "Login2OCIR" {
provisioner "local-exec" {
command = "echo '${var.ocir_user_password}' | docker login ${local.ocir_docker_repository} --username ${local.ocir_namespace}/${var.ocir_user_name} --password-stdin"
}
}
resource "null_resource" "demo-apiPush2OCIR" {
depends_on = [null_resource.Login2OCIR
]
provisioner "local-exec" {
command = "image=$(docker images | grep demo-api | awk -F ' ' '{print $3}') ; docker rmi -f $image &> /dev/null ; echo $image"
working_dir = "functions-fn/api/demo-api/"
}
provisioner "local-exec" {
command = "fn build "
working_dir = "functions-fn/api/demo-api/"
}
provisioner "local-exec" {
command = "image=$(docker images | grep demo-api | awk -F ' ' '{print $3}') ; docker tag $image ${local.ocir_docker_repository}/${local.ocir_namespace}/${var.ocir_repo_name}/demo-api:0.0.1"
working_dir = "functions-fn/api/demo-api/"
}
provisioner "local-exec" {
command = "docker push ${local.ocir_docker_repository}/${local.ocir_namespace}/${var.ocir_repo_name}/demo-api:0.0.1"
working_dir = "functions-fn/api/demo-api/"
}
}
resource "null_resource" "demo-keyval-loadPush2OCIR" {
depends_on = [null_resource.Login2OCIR
]
provisioner "local-exec" {
command = "image=$(docker images | grep demo-keyval-load | awk -F ' ' '{print $3}') ; docker rmi -f $image &> /dev/null ; echo $image"
working_dir = "functions-fn/load/demo-keyval-load/"
}
provisioner "local-exec" {
command = "fn build "
working_dir = "functions-fn/load/demo-keyval-load/"
}
provisioner "local-exec" {
command = "image=$(docker images | grep demo-keyval-load | awk -F ' ' '{print $3}') ; docker tag $image ${local.ocir_docker_repository}/${local.ocir_namespace}/${var.ocir_repo_name}/demo-keyval-load:0.0.1"
working_dir = "functions-fn/load/demo-keyval-load/"
}
provisioner "local-exec" {
command = "docker push ${local.ocir_docker_repository}/${local.ocir_namespace}/${var.ocir_repo_name}/demo-keyval-load:0.0.1"
working_dir = "functions-fn/load/demo-keyval-load/"
}
}
resource "null_resource" "demo-loadPush2OCIR" {
depends_on = [null_resource.Login2OCIR
]
provisioner "local-exec" {
command = "image=$(docker images | grep demo-load | awk -F ' ' '{print $3}') ; docker rmi -f $image &> /dev/null ; echo $image"
working_dir = "functions-fn/load/demo-load/"
}
provisioner "local-exec" {
command = "fn build "
working_dir = "functions-fn/load/demo-load/"
}
provisioner "local-exec" {
command = "image=$(docker images | grep demo-load | awk -F ' ' '{print $3}') ; docker tag $image ${local.ocir_docker_repository}/${local.ocir_namespace}/${var.ocir_repo_name}/demo-load:0.0.1"
working_dir = "functions-fn/load/demo-load/"
}
provisioner "local-exec" {
command = "docker push ${local.ocir_docker_repository}/${local.ocir_namespace}/${var.ocir_repo_name}/demo-load:0.0.1"
working_dir = "functions-fn/load/demo-load/"
}
}