-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·29 lines (24 loc) · 1.11 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
#!/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 "--=== Run local Tests on Deployment ===--"
echo "No tests yet Defined"
echo "-----------------------------------------"
echo "--=== Modify Version Information ===--"
echo "Version $1" > ./www/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" ./server/app/* jenkins@$2:$3
echo "---------------------------------------"
echo "----====== Verify Deployments-List from Remote ======----"
ssh -p 22 $2 "ls -al /home/apache/public_html/"
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-------------------------------------------------------"