File tree 3 files changed +19
-5
lines changed
3 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -4,10 +4,11 @@ set -eo pipefail
4
4
echo " Deploying workload"
5
5
6
6
humanitec_app=$( terraform -chdir=setup/terraform output -raw humanitec_app)
7
+ humanitec_environment=$( terraform -chdir=setup/terraform output -raw humanitec_environment)
7
8
8
- humctl score deploy --app " $humanitec_app " --env development -f ./score.yaml --wait
9
+ humctl score deploy --app " $humanitec_app " --env " $humanitec_environment " -f ./score.yaml --wait
9
10
10
- workload_host=$( humctl get active-resources --app " $humanitec_app " --env development -o yaml | yq ' .[] | select(.metadata.type == "route") | .status.resource.host' )
11
+ workload_host=$( humctl get active-resources --app " $humanitec_app " --env " $humanitec_environment " -o yaml | yq ' .[] | select(.metadata.type == "route") | .status.resource.host' )
11
12
12
13
echo " Waiting for workload to be available"
13
14
@@ -19,6 +20,6 @@ if curl -I --retry 30 --retry-delay 3 --retry-all-errors --fail \
19
20
else
20
21
echo " Workload not available"
21
22
kubectl get pods --all-namespaces
22
- kubectl -n " $humanitec_app -development " logs deployment/hello-world
23
+ kubectl -n " $humanitec_app -$humanitec_environment " logs deployment/hello-world
23
24
exit 1
24
25
fi
Original file line number Diff line number Diff line change @@ -8,15 +8,23 @@ resource "random_string" "install_id" {
8
8
}
9
9
10
10
locals {
11
- app = " 5min-idp-${ random_string . install_id . result } "
12
- prefix = " ${ local . app } -"
11
+ app = " 5min-idp-${ random_string . install_id . result } "
12
+ prefix = " ${ local . app } -"
13
+ environment = " development-${ random_string . install_id . result } "
13
14
}
14
15
15
16
resource "humanitec_application" "demo" {
16
17
id = local. app
17
18
name = local. app
18
19
}
19
20
21
+ resource "humanitec_environment" "demo" {
22
+ app_id = humanitec_application. demo . id
23
+ id = local. environment
24
+ name = " A demo environment for 5min-idp"
25
+ type = " development"
26
+ }
27
+
20
28
# Configure k8s namespace naming
21
29
22
30
resource "humanitec_resource_definition" "k8s_namespace" {
Original file line number Diff line number Diff line change @@ -2,3 +2,8 @@ output "humanitec_app" {
2
2
description = " The ID of the Humanitec application"
3
3
value = humanitec_application. demo . id
4
4
}
5
+
6
+ output "humanitec_environment" {
7
+ description = " The ID of the Humanitec environment"
8
+ value = humanitec_environment. demo . id
9
+ }
You can’t perform that action at this time.
0 commit comments