Skip to content

Commit

Permalink
Merge pull request #96 from ec-europa/feature/MULTISITE-19822
Browse files Browse the repository at this point in the history
MULTISITE-19822: Copy templates with inventory replacements
  • Loading branch information
jonhy81 authored Jun 8, 2018
2 parents c986518 + ba2d9d7 commit 76e69c5
Show file tree
Hide file tree
Showing 5 changed files with 296 additions and 5 deletions.
37 changes: 37 additions & 0 deletions includes/phing/build/help/toolkit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,41 @@
<echo msg="Project structure for ${project-type} created." />
</target>

<target name="toolkit-generate-project-info" description="Copies template files to your project for toolkit integration with inventory details." hidden="true">
<exec command="basename -s .git `git config --get remote.origin.url`" outputProperty="project-id" />
<exec command="grep ${project-id} ${toolkit.dir.incl.templates}/project/inventory.csv | head -1" outputProperty="project-details" />
<if>
<not>
<equals arg1="${project-details}" arg2="" />
</not>
<then>
<exec command="echo ${project-details} | cut -d',' -f1" outputProperty="project.id" />
<exec command="echo ${project-details} | cut -d',' -f2" outputProperty="project.name" />
<exec command="echo ${project-details} | cut -d',' -f3" outputProperty="project.url.repository" />
<exec command="echo ${project-details} | cut -d',' -f4" outputProperty="backtrac.id.static" />
<exec command="echo ${project-details} | cut -d',' -f5" outputProperty="backtrac.id.dynamic" />
<exec command="echo ${project-details} | cut -d',' -f6" outputProperty="project.url.production" />
<exec command="echo ${project-details} | cut -d',' -f7" outputProperty="project.url.playground" />
<copy todir="${project.basedir}">
<fileset dir="${toolkit.dir.incl.templates}/subsite">
<include name="README.md" />
<include name="composer.json" />
<include name="build.project.props" />
</fileset>
<filterchain>
<replacetokens begintoken="${" endtoken="}">
<token key="PROJECT_ID" value="${project.id}" />
<token key="PROJECT_DESCRIPTION" value="${project.name}" />
<token key="PRODUCTION_URL" value="${project.url.production}" />
<token key="REPOSITORY_URL" value="${project.url.repository}" />
<token key="BACKTRAC_ID_STATIC" value="${backtrac.id.static}" />
<token key="BACKTRAC_ID_DYNAMIC" value="${backtrac.id.dynamic}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Project information generated in README.md, composer.json and build.project.props." />
</then>
</if>
</target>

</project>
Loading

0 comments on commit 76e69c5

Please sign in to comment.