Skip to content

Commit 3efeea1

Browse files
committed
Allow script to skip the insital stage of deploy, clone pyro, require plugins and packages
1 parent 70c8846 commit 3efeea1

File tree

4 files changed

+90
-65
lines changed

4 files changed

+90
-65
lines changed

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@
1414
1515
)))
1616
(o o)
17-
---- PyroCMS Deploy Tool --- ooO--(_)--Ooo ----
18-
17+
---- PyroCMS Deploy Tool v1.2 --- ooO--(_)--Ooo ----
1918
```
2019

2120
> This is a [PyroCMS 3](https://www.pyrocms.com/) deploy tool with customization, install automation, better version control setup and other nice-to-have features.
2221
2322
## Get Started
2423

25-
Auto-pyro downloads, configure, install and deploy a complete Pyro app with all required addons and packages. It automatically installs [Pyro Builder](https://github.com/websemantics/builder-extension) and comes pre-configured with a [todo module](#todo-module) out of the box.
24+
Auto-pyro downloads, configures, installs and deploys a complete Pyro app with optional / required addons and packages. It automatically installs [Pyro Builder](https://github.com/websemantics/builder-extension) and comes pre-configured with a [todo module](#todo-module) example out of the box.
2625

2726
Here's a video to demonstrate how it works (click on the image)
2827

@@ -57,6 +56,14 @@ ant
5756

5857
Set back until the deploy process is complete. Browse to the project to view, for example, http://my-app.dev.
5958

59+
A setup switch `setup` is available for you to only install Pyro.
60+
61+
```bash
62+
ant -Dsetup=false
63+
```
64+
65+
The deploy process will skip cloning PyroCMS repo, requiring plugins and composer packages.
66+
6067
## Todo Module
6168

6269
This is a simple module that is used to demonstrate features of Auto-pyro and [Pyro Builder](https://github.com/websemantics/builder-extension),
@@ -131,7 +138,7 @@ Here's a quick list of the PyroCOM Environment properties,
131138
| DB_DATABASE | `pyro` | Set to `pyro` by default |
132139
| DB_USERNAME | `root` | Change as appropriate |
133140
| DB_PASSWORD | `root` | Change as appropriate |
134-
| DB_DRIVER | `mysql` | Set to `mysql` by default |
141+
| DB_CONNECTION | `mysql` | Set to `mysql` by default |
135142
| DB_HOST | `localhost` | Set to `localhost` by default |
136143
| APP_KEY | `r!a#n^d*o?m` | Auto generated |
137144
| APP_ENV | `local` | Change as appropriate |

build.xml

Lines changed: 73 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# | | | | | | \ \ \ `-.-.-' /
1414
# |_____| |_____| |_____| \____\ '-_ _-'
1515
# `- - - '
16-
# PyroCMS Deploy Tool v1.1
16+
# PyroCMS Deploy Tool v1.2
1717
#
1818
# This build file is desgined to automate the installation process
1919
# of PyroCMS 3 apps, their addons, underlying framework (i.e. Laravel,
@@ -305,28 +305,35 @@
305305
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
306306

307307
<target name="composer-dependencies" depends="require-pyro" description="Require and remove composer packages">
308+
309+
<if>
310+
<equals arg1="${setup}" arg2="true"/>
311+
<then>
308312

309-
<echo message="Run composer ..."/>
313+
<echo message="Run composer ..."/>
310314

311-
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
312-
<arg line="install"/>
313-
</exec>
315+
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
316+
<arg line="install"/>
317+
</exec>
314318

315-
<for list="${env.COMPOSER.require}" param="package">
316-
<sequential>
317-
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
318-
<arg line="require @{package}"/>
319-
</exec>
320-
</sequential>
321-
</for>
319+
<for list="${env.COMPOSER.require}" param="package">
320+
<sequential>
321+
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
322+
<arg line="require @{package}"/>
323+
</exec>
324+
</sequential>
325+
</for>
322326

323-
<for list="${env.COMPOSER.remove}" param="package">
324-
<sequential>
325-
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
326-
<arg line="remove @{package}"/>
327-
</exec>
328-
</sequential>
329-
</for>
327+
<for list="${env.COMPOSER.remove}" param="package">
328+
<sequential>
329+
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
330+
<arg line="remove @{package}"/>
331+
</exec>
332+
</sequential>
333+
</for>
334+
335+
</then>
336+
</if>
330337

331338
</target>
332339

@@ -338,49 +345,56 @@
338345

339346
<target name="require-pyro" depends="clean" description="Clone PyroCMS and copy its files to project folder">
340347

341-
<echo message="Clone a fresh copy of pyrocms ... "/>
342-
343-
<exec dir="${app.dir}" executable="${env.GIT.bin}">
344-
<arg line="clone"/>
345-
<arg line="-b"/>
346-
<arg line="${env.PYRO.branch}"/>
347-
<arg line="${env.PYRO.repo}"/>
348-
<arg line="${pyro.dir}"/>
349-
</exec>
350-
351-
<echo message="Move PyroCMS files into the project folder ..."/>
352-
353-
<!-- move root folders -->
354-
<for list="${env.PYRO_FOLDERS}" param="folder">
355-
<sequential>
356-
<move file="${pyro.dir}/@{folder}" todir="${app.dir}" includeEmptyDirs="yes" failonerror="${failonerror}" quiet="${quiet}"/>
357-
</sequential>
358-
</for>
359-
360-
<!-- move folders inside public -->
361-
<for list="${env.PUBLIC_FOLDERS}" param="folder">
362-
<sequential>
363-
<move file="${pyro.dir}/public/@{folder}" todir="${app.dir}/public" includeEmptyDirs="yes" failonerror="${failonerror}" quiet="${quiet}"/>
364-
</sequential>
365-
</for>
348+
<if>
349+
<equals arg1="${setup}" arg2="true"/>
350+
<then>
366351

367-
<!-- move root folder files -->
368-
<for list="${env.ROOT_FILES}" param="file">
369-
<sequential>
370-
<move file="${pyro.dir}/@{file}" todir="${app.dir}" failonerror="${failonerror}" quiet="${quiet}"/>
371-
</sequential>
372-
</for>
352+
<echo message="Clone a fresh copy of pyrocms ... "/>
353+
354+
<exec dir="${app.dir}" executable="${env.GIT.bin}">
355+
<arg line="clone"/>
356+
<arg line="-b"/>
357+
<arg line="${env.PYRO.branch}"/>
358+
<arg line="${env.PYRO.repo}"/>
359+
<arg line="${pyro.dir}"/>
360+
</exec>
361+
362+
<echo message="Move PyroCMS files into the project folder ..."/>
363+
364+
<!-- move root folders -->
365+
<for list="${env.PYRO_FOLDERS}" param="folder">
366+
<sequential>
367+
<move file="${pyro.dir}/@{folder}" todir="${app.dir}" includeEmptyDirs="yes" failonerror="${failonerror}" quiet="${quiet}"/>
368+
</sequential>
369+
</for>
370+
371+
<!-- move folders inside public -->
372+
<for list="${env.PUBLIC_FOLDERS}" param="folder">
373+
<sequential>
374+
<move file="${pyro.dir}/public/@{folder}" todir="${app.dir}/public" includeEmptyDirs="yes" failonerror="${failonerror}" quiet="${quiet}"/>
375+
</sequential>
376+
</for>
377+
378+
<!-- move root folder files -->
379+
<for list="${env.ROOT_FILES}" param="file">
380+
<sequential>
381+
<move file="${pyro.dir}/@{file}" todir="${app.dir}" failonerror="${failonerror}" quiet="${quiet}"/>
382+
</sequential>
383+
</for>
384+
385+
<!-- move files from public folder -->
386+
<move todir="${app.dir}/public">
387+
<fileset dir="${pyro.dir}/public">
388+
<include name="**/*.*"/>
389+
</fileset>
390+
</move>
373391

374-
<!-- move files from public folder -->
375-
<move todir="${app.dir}/public">
376-
<fileset dir="${pyro.dir}/public">
377-
<include name="**/*.*"/>
378-
</fileset>
379-
</move>
392+
<echo message="Remove PyroCMS temporary folder ..."/>
380393

381-
<echo message="Remove PyroCMS temporary folder ..."/>
394+
<delete dir="${pyro.dir}" failonerror="${failonerror}"/>
382395

383-
<delete dir="${pyro.dir}" failonerror="${failonerror}"/>
396+
</then>
397+
</if>
384398

385399
</target>
386400

@@ -417,6 +431,7 @@
417431
<property name="pyro.dir" value="${app.dir}/pyro"/>
418432
<property name="laravel.dir" value="${app.dir}/laravel"/>
419433
<property name="env.file" value="${app.dir}/.env"/>
434+
<property name="setup" value="true"/>
420435

421436
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
422437
# D A T A B A S E P R O P E R T I E S

local.properties

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@
1212
# | | | | | | \ \ \ `-.-.-' /
1313
# |_____| |_____| |_____| \____\ '-_ _-'
1414
# `------'
15-
# PyroCMS Deploy Tool v1.1
15+
# PyroCMS Deploy Tool v1.2
1616
#
1717
################################################################################
1818
#
1919
# Build properties: change the following properties for this project
2020
#
2121
################################################################################
2222

23+
2324
#---------------------------------------
2425
# PyroCMS repository and default branch
2526
#---------------------------------------
@@ -36,7 +37,7 @@ env.APP_URL=${env.APPLICATION_NAME}.dev
3637
env.ADMIN_USERNAME=admin
3738
env.ADMIN_EMAIL=admin@admin.com
3839
env.ADMIN_PASSWORD=secret
39-
env.DB_DATABASE=autopyro
40+
env.DB_DATABASE=mcwap
4041
env.DB_USERNAME=root
4142
env.DB_PASSWORD=root
4243
env.DB_CONNECTION=mysql
@@ -117,6 +118,8 @@ env.APP_ADDONS=
117118
# @var DB_DROP, if true, drop the database, env.DB_DATABASE if exists
118119
# @var LIQUIBASE, if true, download libraries and setup for use (http://www.liquibase.org/)
119120
#---------------------------------------
121+
122+
120123
env.DEBUG=true
121124
env.DB_DROP=true
122125
env.LIQUIBASE=false

vagrant.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# | | | | | | \ \ \ `-.-.-' /
1515
# |_____| |_____| |_____| \____\ '-_ _-'
1616
# `- - - '
17-
# PyroCMS Deploy Tool v1.1
17+
# PyroCMS Deploy Tool v1.2
1818
#
1919
# This vagrant build file is still work in progress.
2020
#

0 commit comments

Comments
 (0)