forked from ec-europa/joinup-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.continuousphp.xml
More file actions
95 lines (85 loc) · 4.01 KB
/
build.continuousphp.xml
File metadata and controls
95 lines (85 loc) · 4.01 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?xml version="1.0" encoding="UTF-8" ?>
<project name="ContinuousPHP" default="help">
<echo msg="Loading AWS additional tasks." />
<import file="./vendor/continuousphp/aws-sdk-phing/tasks.xml" />
<property name="aws.profile" value="" />
<echo msg="Turn environment variable into a phing property" />
<taskdef name="env2property" classname="\DrupalProject\Phing\EnvironmentVarAsProperty" />
<echo msg="Loading infra additional tasks." />
<import file="./vendor/ec-europa/infra/infra.xml" />
<!-- Run Behat tests. -->
<!-- Use this target to run tests with increased verbosity on ContinuousPHP to help debugging. -->
<target name="run-behat-tests" description="Run Behat tests.">
<behat
executable="${behat.bin}"
config="${behat.yml.path}"
strict="${behat.options.strict}"
verbose="${behat.options.verbosity}"
/>
</target>
<target name="setup-continuousphp"
depends="check-continuousphp">
<echo msg="Set the virtuoso checkpoint to -1. Do not use a checkpoint for CPHP testing."/>
<phingcall target="set-virtuoso-checkpoint">
<property name="interval" value="-1"/>
</phingcall>
<echo message="Put the odbc configuration file in the home folder where CPHP can find it" />
<copy
file="./vendor/ec-europa/infra/continuousphp/odbc.ini"
tofile="${user.home}/.odbc.ini"
overwrite="true" />
<echo message="Create Solr index" />
<exec dir="${project.basedir}"
command="sudo curl -o /opt/solr/search_api_solr.tar.gz https://ftp.drupal.org/files/projects/search_api_solr-8.x-1.0-alpha4.tar.gz;
sudo tar xvzf /opt/solr/search_api_solr.tar.gz -C /opt/solr;
sudo /opt/solr/bin/solr create_core -c drupal_published;
sudo mkdir /opt/solr/server/solr/drupal_published;
sudo rsync -avz /opt/solr/search_api_solr/solr-conf/6.x/ /opt/solr/server/solr/drupal_published/conf/;
sudo /opt/solr/bin/solr create_core -c drupal_unpublished;
sudo mkdir /opt/solr/server/solr/drupal_unpublished;
sudo rsync -avz /opt/solr/search_api_solr/solr-conf/6.x/ /opt/solr/server/solr/drupal_unpublished/conf/"
checkreturn="true"
passthru="true" />
<echo message="Report Solr status" />
<exec dir="${project.basedir}"
command="sudo /opt/solr/bin/solr status"
checkreturn="true"
passthru="true" />
<echo message="Restart Solr" />
<exec dir="${project.basedir}"
command="sudo /opt/solr/bin/solr restart"
checkreturn="true"
passthru="true"
spawn="true" />
</target>
<target name="check-continuousphp">
<echo message="Check if we are running on ContinuousPHP" />
<if>
<not>
<available file="/home/cphp" type="dir" property="environment.cphp" />
</not>
<then>
<fail message="Only run this target on a ContinuousPHP test environment" />
</then>
</if>
</target>
<target name="build-continuousphp" >
<echo message="Install the SASS compiler" />
<exec dir="${project.basedir}"
command="gem install sass"
checkreturn="true"
passthru="true" />
<!-- Set environment variables as extra properties through cloudformation -->
<env2property prefix="cphp" phingproperty="cloudformation.properties" />
<echo message="Copy CPHP pipeline variables to local properties file" />
<echoproperties prefix="cphp." destfile="build.properties.local" />
<exec dir="${project.basedir}"
command="sed -i 's/^cphp\.//' build.properties.local"
checkreturn="true"
passthru="true" />
</target>
<!-- provision new demo/test stack on AWS -->
<target name="provision-stack"
description="Provision a stack on AWS"
depends="setup-aws, run-stack, setup-deployment-group" />
</project>