forked from MehdiDonk/erasmus-reference
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
119 lines (100 loc) · 4.75 KB
/
build.xml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?xml version="1.0" encoding="UTF-8" ?>
<project name="My subsite" default="help">
<property file="build.properties.local" />
<property file="build.properties" />
<property file="build.properties.dist" />
<target name="help" description="Phing target list">
<exec executable="${phing.bin}"
passthru="true">
<arg value="-l"/>
</exec>
</target>
<includepath classpath="src/Phing" />
<echo msg="Loading Drush task." />
<taskdef name="drush" classname="DrushTask" />
<echo msg="Loading Behat task." />
<taskdef name="behat" classname="BehatTask" />
<echo msg="Importing the ContinuousPHP specific Phing tasks." />
<import file="vendor/continuousphp/phing-tasks/tasks.xml" />
<echo msg="Loading PHP Codesniffer Configuration task." />
<taskdef name="phpcodesnifferconfiguration" classname="\NextEuropa\Phing\PhpCodeSnifferConfigurationTask" />
<echo msg="Loading Drush Makefile task." />
<taskdef name="drushmakefile" classname="\NextEuropa\Phing\DrushMakeFileTask" />
<echo msg="Loading Starterkit update check task." />
<taskdef name="checkstarterkit" classname="\NextEuropa\Phing\CheckStarterkitTask" />
<import file="build.package.xml" />
<import file="build.test.xml" />
<import file="./vendor/continuousphp/aws-sdk-phing/tasks.xml" />
<property name="aws.profile" value="" />
<target name="setup-aws">
<property name="aws.profile" value="" />
<aws-config region="${aws.region}" profile="${aws.profile}" />
</target>
<target name="delete-deployment-group">
<aws-deploy-delete-deployment-group
name="${deploy.groupName}"
application="${deploy.applicationName}" />
</target>
<target name="delete-stack" depends="delete-deployment-group">
<aws-cf-deletestack name="${cf.stackName}" />
</target>
<target name="run-stack">
<if>
<equals arg1="single-server" arg2="${cf.template}" />
<then>
<aws-cf-runstack
name="${deploy.applicationName}-${cf.stackName}"
updateOnConflict="true"
capabilities="CAPABILITY_IAM"
templatePath="./resources/cloudformation/${cf.template}.template">
<param name="KeyName" value="${cf.KeyName}" />
<param name="ApplicationName" value="${deploy.applicationName}" />
<param name="env" value="${cf.stackName}" />
</aws-cf-runstack>
</then>
<else>
<!-- Todo: This is currently untested. -->
<aws-cf-runstack
name="${deploy.applicationName}-${cf.stackName}"
updateOnConflict="true"
capabilities="CAPABILITY_IAM"
templatePath="./resources/cloudformation/${cf.template}.template">
<param name="KeyName" value="${cf.KeyName}" />
<param name="DBName" value="${cf.DBName}" />
<param name="DBUser" value="${cf.DBUser}" />
<param name="DBPassword" value="${cf.DBPassword}" />
<param name="env" value="${cf.stackName}" />
<output name="AutoscalingGroup" property="deploy.autoScalingGroup" />
</aws-cf-runstack>
</else>
</if>
</target>
<target name="setup-deployment-group">
<if>
<equals arg1="single-server" arg2="${cf.template}" />
<then>
<aws-deploy-deployment-group
name="${cf.stackName}"
updateOnConflict="true"
deploymentConfigName="CodeDeployDefault.OneAtATime"
serviceRole="${deploy.serviceRole}"
application="${deploy.applicationName}">
<ec2TagFilter key="stack" value="${deploy.applicationName}-${cf.stackName}" />
</aws-deploy-deployment-group>
</then>
<else>
<aws-deploy-deployment-group
name="${cf.stackName}"
updateOnConflict="true"
deploymentConfigName="CodeDeployDefault.OneAtATime"
serviceRole="${deploy.serviceRole}"
application="${deploy.applicationName}">
<autoScalingGroup name="${deploy.autoScalingGroup}" />
</aws-deploy-deployment-group>
</else>
</if>
</target>
<target name="provision-stack"
description="Provision a stack on AWS"
depends="setup-aws, run-stack, setup-deployment-group" />
</project>