Project

General

Profile

« Previous | Next » 

Revision afbbb0c8

Added by Andreas Kohlbecker about 13 years ago

almoust complete

View differences:

modules/cdm_dataportal/jenkins-ci/integration.sh
1 1
#!/bin/bash
2 2
###
3
# Continius intergration build with jenkins
3
# Continous intergration build with jenkins
4 4
#   call this script from within jenkins with:
5 5
#   >    bash -e $WORKSPACE/jenkins-ci/integration.sh $JOB_NAME $dbUser $dbPassword
6 6
#
7
#   USAGE: 
8
#
7 9
# references:
8 10
#   http://thinkshout.com/blog/2010/09/sean/beginners-guide-using-hudson-continuous-integration-drupal
9 11
#   http://drush.ws/help/3
......
39 41
#  CVS_BRANCH
40 42
#      For CVS-based projects, this variable contains the branch of the module. If CVS is configured to check out the trunk, this environment variable will not be set.
41 43
#
42
set JOB_NAME=$1
43
set drupalRoot=/var/www/drupal/
44
set drupalSiteName=$JOB_NAME
45
set drupalInstallationProfile="CDM_DataPortal"
44
WORKSPACE=$1
45
JOB_NAME=$2
46
drupalRoot=/var/www/drupal/
47
drupalSiteName="jenkins"
48
drupalInstallationProfile="CDM_DataPortal"
46 49

  
47
set dbName="jenkins_"$JOB_NAME
48
set dbUser= $2
49
set 
50
dbPassword=$3
50
dbName="jenkins_$JOB_NAME"
51
dbUser=$3
52
dbPassword=$4
51 53

  
52 54
# copy installation profiles
53
echo ">>> workspace is "$WORKSPACE
54
cp $WORKSPACE/profile/ $drupalRoot/profiles/
55
echo ">>> workspace is $WORKSPACE"
56
echo "${WORKSPACE}profile/* ${drupalRoot}profiles/"
57
cp -R  ${WORKSPACE}profile/* ${drupalRoot}profiles/
55 58

  
56 59
# drop all tables in database
57
MYSQL --user=$dbUser --password=$dbPassword -D $dbName
58
$MYSQL -BNe "show tables" | awk '{print "set foreign_key_checks=0; drop table `" $1 "`;"}' | $MYSQL
59
unset MYSQL
60
MYSQLCMD="mysql --user=$dbUser --password=$dbPassword -D $dbName"
61
echo $MYSQLCMD
62
$MYSQLCMD -BNe "show tables" | awk '{print "set foreign_key_checks=0; drop table `" $1 "`;"}' | $MYSQLCMD
63
unset MYSQLCMD
60 64

  
61 65
# install drupal site
66
echo "installing drupal site ..."
62 67
cd $drupalRoot
63
yes | drush si --profile=$drupalInstallationProfile --clean-url=0 --sites-subdir=$drupalSiteName --db-url=mysql://$dbUser:$dbPassword@localhost/$dbName
68
DRUSH="drush --uri=http://160.45.63.201/dataportal/jenkins/"
69
## drush si only works with drupal 7 so the folowing does not yet work
70
#yes | drush si --profile=${drupalInstallationProfile} --clean-url=0 --sites-subdir=${drupalSiteName} --db-url=mysql://${dbUser}:${dbPassword}@localhost/${dbName}
71
# and we will use a preset sub site directory and ur own install script:
72
wget -O /tmp/jenkins-drupal-install http://160.45.63.201/dataportal/jenkins/install.php?profile=CDM_DataPortal_Testing
64 73

  
74
$DRUSH vset --yes cdm_webservice_url "http://160.45.63.201:8080/cichorieae/
65 75

  
66 76

  
67 77

  

Also available in: Unified diff