-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpipeline.sh
executable file
·39 lines (27 loc) · 1.72 KB
/
pipeline.sh
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
#!/usr/bin/env bash
set -eo pipefail
scriptdir=$(cd "$(dirname "$0")" || exit; pwd)
echo "================================================================================"
echo " Stage 0: Verify S3 bucket, AWS profile and region "
echo "================================================================================"
./check_env.sh
echo "================================================================================"
echo " Stage 1: Build "
echo "================================================================================"
echo "!!! To be added. Nothing happens here at the moment !!!"
echo "================================================================================"
echo " Stage 2: Copy artifacts to S3 "
echo "================================================================================"
aws s3 cp "$scriptdir/target" s3://"$GRL_AWS_LAB_BUILDS_S3_BUCKET" --recursive --include "*"
echo "================================================================================"
echo " Stage 3: Terraform "
echo "================================================================================"
(cd "$scriptdir/grl-aws-tf-infrastructure" &&
terraform init &&
terraform plan -out tfplan -var "s3_bucket=$GRL_AWS_LAB_BUILDS_S3_BUCKET" &&
terraform apply "tfplan"
)
echo "================================================================================"
echo " Stage 4: Deploy "
echo "================================================================================"
./deploy.sh