This repository has been archived by the owner on Jun 26, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·37 lines (30 loc) · 1.36 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
#!/bin/bash
echo "--=== Incoming Paramters (This script hould be reusable) ===--"
echo "[P1] Version Number is :$1 "
echo "[P2] Target Server is :$2 "
echo "[P3] Target Folder is :$3 "
echo "---------------------------------------"
echo "--=== Identify the taret server ===--"
ssh -p 22 $2 "sudo /home/ubuntu/role.sh"
ssh -p 22 $2 "sudo whoami"
echo "---------------------------------------"
echo "--=== Run local Tests on Deployment ===--"
echo "No tests yet Defined"
echo "-----------------------------------------"
echo "--=== Modify Version Information ===--"
echo "Version $1" > version.html
ls -l
echo "--------------------------------------"
echo "--=== Transfer files to remote Server ===--"
echo "rsync -avzhe ssh --rsync-path="""rsync""" ./www/* jenkins@$2:$3"""
rsync -avzhe ssh --rsync-path="rsync" ./www/* jenkins@$2:$3
echo "---------------------------------------"
#echo "--=== Set permisions on transfered files ===--"
#ssh -p 22 $2 "chown -R apache:apache $3"
#echo "-------------------------------------------"
echo "----====== Verify Deployments-List from Remote ======----"
ssh -p 22 $2 "ls -al $3"
echo "---------------------------------------------------------"
echo "--=== Version Deployed is [$1] The folowing output from version.info ===--"
ssh -p 22 $2 "cat $3/version.html"
echo "------------The-End-------------------------------------------------------"