Project

General

Profile

Download (1.14 KB) Statistics
| Branch: | Tag: | Revision:
1 92463307 edit-jenkins
#!/bin/bash 
2
#
3
# update the symlink for the stable folder
4
#
5 a95d0ed3 Andreas Kohlbecker
6
##############################################################
7
# NOTE: the ssh host should be configured in the ~/.ssh/config:
8
#     Host edit-deploy
9
#     HostName <ip ot host name>
10
#     User <deployment-user>
11
# 
12
# At the server to be delpoyed to you need to setup and configure the 
13
14
# 1. crate the <deployment-user> 
15
#
16
# 2. assuming you are logged in as the <deployment-user>:
17
#
18
#  echo "umask 0126" >> ~/.bashrc : 
19
#   
20
# 3. user 'www-data' must be member of the group of the <deployment-user>
21
#
22
# 4. The permissions of the folders to delpoyed to must be set to 775 ownership must be adjusted:
23
#   chmod -R 775 <the folders>
24
#   chown -R www-data:deploy <the folders> 
25
# 
26
#  
27 d9875e4c Andreas Kohlbecker
SSH_HOST='edit-deploy'
28 a95d0ed3 Andreas Kohlbecker
##############################################################
29 d9875e4c Andreas Kohlbecker
30 92463307 edit-jenkins
cd $WORKSPACE
31 d220174c Cherian Mathew
PROJECT_VERSION=(`cat target/classes/version.properties | grep "cdm-webapp.version" | sed -e "s/[^0-9]*\([^\n\r]*\)/\1/g"`)
32 92463307 edit-jenkins
33
if [ -n "$PROJECT_VERSION" ]; then
34 d9875e4c Andreas Kohlbecker
 ssh $SSH_HOST "rm -r /var/www/download/cdmserver/stable"
35
 ssh $SSH_HOST "ln -s /var/www/download/cdmserver/$PROJECT_VERSION /var/www/download/cdmserver/stable"
36 92463307 edit-jenkins
fi