-
Notifications
You must be signed in to change notification settings - Fork 6
/
deploy_master.sh
44 lines (36 loc) · 1.42 KB
/
deploy_master.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
40
41
42
43
44
#### User Definition ####
# Use this section to define input variables:
# application name
# environment_name
# jsonfile name
# Important: Please make sure that application/environment/
# pipeline names are not the same as exisinting
# application/environment/pipelines
application_name=Impulses-Master
environment_name=impulse-master
#pipeline_name=Impulses_deploy_master
jsonfile=file://pipeline_master.json
#### Initializing EBS ####
# User needs to have awsebcli installed
# there is no .elasticbeanstalk folder in directory,
# aws account does not have a environment with the same name
# working
echo "3\n\n$application_name\nY\n1\nn\nn\n" | eb init -i
#### Creating EBS Environment (EC2 instance) ####
# This will host our webserver
# working
eb create $environment_name
#### Create Codepipeline ####
# This will create an aws codepipeline that connect the
# github repo to application environment for deployment
#
# Changes in the github repo will be automatically tracked
aws codepipeline create-pipeline --cli-input-json $jsonfile
#### Terminate ####
# terminate ebs application environment (EC2 instance)
# environment has to be terminated before deleting application
#eb terminate
# delete ebs application
# aws elasticbeanstalk delete-application --application-name Impulses-test
# delete aws codepipeline
# aws codepipeline delete-pipeline --name $pipeline_name