-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdeploy.sh
executable file
·45 lines (44 loc) · 1.78 KB
/
deploy.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
45
#!/bin/bash
#Build the artefacts
mvn clean install -q
#Deploy them into servers
if [[ $1 == "staging" ]]; then
echo "Starting to deploy into Staging"
cd ./CICDESBProjectCompositeApplicationStaging
mvn clean deploy -Dmaven.deploy.skip=true -Dmaven.car.deploy.skip=false
echo "Deploying the artefacts"
sleep 10
cd ../
echo "Running tests"
newman run TestAPI/WSO2_API_STORE_TESTS.postman_collection.json -e StagingEnvironment/Staging.postman_environment.json --bail
echo "Tests are completed for $1 environment"
elif [[ $1 == "production" ]]; then
echo "Starting to deploy into Production"
cd ./CICDESBProjectCompositeApplicationProduction
mvn clean deploy -Dmaven.deploy.skip=true -Dmaven.car.deploy.skip=false
echo "Deploying the artefacts"
sleep 10
cd ../
echo "Running tests"
newman run TestAPI/WSO2_API_STORE_TESTS.postman_collection.json -e ProductionEnvironment/Production.postman_environment.json --bail
echo "Tests are completed for $1 environment"
else
echo "Starting to deploy into Staging"
cd ./CICDESBProjectCompositeApplicationStaging
mvn clean deploy -Dmaven.deploy.skip=true -Dmaven.car.deploy.skip=false
echo "Deploying the artefacts"
sleep 10
cd ../
echo "Running tests"
newman run TestAPI/WSO2_API_STORE_TESTS.postman_collection.json -e StagingEnvironment/Staging.postman_environment.json --bail
echo "Tests are completed for staging environment"
echo "Starting to deploy into Production"
cd ./CICDESBProjectCompositeApplicationProduction
mvn clean deploy -Dmaven.deploy.skip=true -Dmaven.car.deploy.skip=false
echo "Deploying the artefacts"
sleep 10
cd ../
echo "Running tests"
newman run TestAPI/WSO2_API_STORE_TESTS.postman_collection.json -e ProductionEnvironment/Production.postman_environment.json --bail
echo "Tests are completed for production environment"
fi