Project

General

Profile

« Previous | Next » 

Revision 49b75f26

Added by Andreas Kohlbecker about 13 years ago

cdm_dataportal must be copied to sites/all

View differences:

modules/cdm_dataportal/jenkins-ci/integration.sh
2 2
###
3 3
# Continous intergration build with jenkins
4 4
#   call this script from within jenkins with:
5
#   >    bash -e $WORKSPACE/jenkins-ci/integration.sh $JOB_NAME $dbUser $dbPassword
6
#
7
#   USAGE: 
5
#   >    bash -ex $WORKSPACE/jenkins-ci/integration.sh $WORKSPACE $JOB_NAME $dbUser $dbPassword
8 6
#
9 7
# references:
10 8
#   http://thinkshout.com/blog/2010/09/sean/beginners-guide-using-hudson-continuous-integration-drupal
11 9
#   http://drush.ws/help/3
12
###
13
#  The following variables are available to shell scripts
14
#  
15
#  BUILD_NUMBER
16
#      The current build number, such as "153"
17
#  BUILD_ID
18
#      The current build id, such as "2005-08-22_23-59-59" (YYYY-MM-DD_hh-mm-ss)
19
#  JOB_NAME
20
#      Name of the project of this build, such as "foo"
21
#  BUILD_TAG
22
#      String of "hudson-${JOB_NAME}-${BUILD_NUMBER}". Convenient to put into a resource file, a jar file, etc for easier identification.
23
#  EXECUTOR_NUMBER
24
#      The unique number that identifies the current executor (among executors of the same machine) that's carrying out this build. This is the number you see in the "build executor status", except that the number starts from 0, not 1.
25
#  NODE_NAME
26
#      Name of the slave if the build is on a slave, or "" if run on master
27
#  NODE_LABELS
28
#      Whitespace-separated list of labels that the node is assigned.
29
#  JAVA_HOME
30
#      If your job is configured to use a specific JDK, this variable is set to the JAVA_HOME of the specified JDK. When this variable is set, PATH is also updated to have $JAVA_HOME/bin.
31
#  WORKSPACE
32
#      The absolute path of the workspace.
33
#  HUDSON_URL
34
#      Full URL of Hudson, like http://server:port/hudson/
35
#  BUILD_URL
36
#      Full URL of this build, like http://server:port/hudson/job/foo/15/
37
#  JOB_URL
38
#      Full URL of this job, like http://server:port/hudson/job/foo/
39
#  SVN_REVISION
40
#      For Subversion-based projects, this variable contains the revision number of the module.
41
#  CVS_BRANCH
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.
43
#
10

  
44 11
WORKSPACE=$1
45 12
JOB_NAME=$2
46 13
drupalRoot=/var/www/drupal/
......
52 19
dbPassword=$4
53 20

  
54 21
# copy installation profiles
55
echo ">>> workspace is $WORKSPACE"
56
echo "${WORKSPACE}/profile/* ${drupalRoot}profiles/"
22
echo ">>> copying installation profiles to ${drupalRoot}profiles/"
57 23
svn export ${WORKSPACE}/profile/ /tmp/drupal_profiles
58 24
cp -R  /tmp/drupal_profiles/* ${drupalRoot}profiles/
59 25
rm -R /tmp/drupal_profiles
60 26

  
27
# copy module
28
echo ">>> copying module ${drupalRoot}profiles/"
29
rm -R ${drupalRoot}/sites/all/modules/cdm_dataportal
30
svn export ${WORKSPACE} ${drupalRoot}/sites/all/modules/
31

  
61 32
# drop all tables in database
33
echo ">>> clearing database ..."
62 34
MYSQLCMD="mysql --user=$dbUser --password=$dbPassword -D $dbName"
63
echo $MYSQLCMD
64 35
$MYSQLCMD -BNe "show tables" | awk '{print "set foreign_key_checks=0; drop table `" $1 "`;"}' | $MYSQLCMD
65 36
unset MYSQLCMD
66 37

  
67 38
# install drupal site
68
echo "installing drupal site ..."
39
echo ">>> installing drupal site ..."
69 40
cd $drupalRoot
70 41
DRUSH="drush --uri=http://160.45.63.201/dataportal/jenkins/"
71 42
## drush si only works with drupal 7 so the folowing does not yet work

Also available in: Unified diff