Skip to content
This repository was archived by the owner on Mar 25, 2026. It is now read-only.

Commit fa19154

Browse files
Merge pull request #226 from acompany-develop/fefature/takahashi/fix_terraform
Fix to stop processing when an error occurs
2 parents adbe294 + de52b18 commit fa19154

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

demo/src/prepare_deploy.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/bash
2+
set -e
23
# ./prepare_deploy.sh party_id party_str image_tag
34
party_id=$1 # パーティの番号を引数から取得
45
party_str=$2 # パーティのipリストを引数から取得
56
image_tag=$3 # containerイメージのタグを引数から取得
67

78
# 0-indexを1-indexに変換(terraformのcount.indexが0-indexのため引数は0-index)
8-
((party_id++))
9+
party_id=$((party_id+=1))
910
# パーティのリストをカンマで区切って配列に格納
1011
party_list=(${party_str//,/ })
1112

demo/terraform/application/deploy.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ resource "null_resource" "setup" {
4040
# Prepare deploy
4141
# ---------------------------
4242
resource "null_resource" "prepare_deploy" {
43+
triggers = {
44+
image_tag = "${var.docker_image_tag}"
45+
}
4346
count = local.instance_count
4447
provisioner "remote-exec" {
4548
connection {

0 commit comments

Comments
 (0)