Skip to content

Commit

Permalink
Allow script to skip the insital stage of deploy, clone pyro, require…
Browse files Browse the repository at this point in the history
… plugins and packages
  • Loading branch information
websemantics committed Nov 25, 2016
1 parent 70c8846 commit 3efeea1
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 65 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
)))
(o o)
---- PyroCMS Deploy Tool --- ooO--(_)--Ooo ----
---- PyroCMS Deploy Tool v1.2 --- ooO--(_)--Ooo ----
```

> 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.
## Get Started

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.
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.

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

Expand Down Expand Up @@ -57,6 +56,14 @@ ant

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

A setup switch `setup` is available for you to only install Pyro.

```bash
ant -Dsetup=false
```

The deploy process will skip cloning PyroCMS repo, requiring plugins and composer packages.

## Todo Module

This is a simple module that is used to demonstrate features of Auto-pyro and [Pyro Builder](https://github.com/websemantics/builder-extension),
Expand Down Expand Up @@ -131,7 +138,7 @@ Here's a quick list of the PyroCOM Environment properties,
| DB_DATABASE | `pyro` | Set to `pyro` by default |
| DB_USERNAME | `root` | Change as appropriate |
| DB_PASSWORD | `root` | Change as appropriate |
| DB_DRIVER | `mysql` | Set to `mysql` by default |
| DB_CONNECTION | `mysql` | Set to `mysql` by default |
| DB_HOST | `localhost` | Set to `localhost` by default |
| APP_KEY | `r!a#n^d*o?m` | Auto generated |
| APP_ENV | `local` | Change as appropriate |
Expand Down
131 changes: 73 additions & 58 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# | | | | | | \ \ \ `-.-.-' /
# |_____| |_____| |_____| \____\ '-_ _-'
# `- - - '
# PyroCMS Deploy Tool v1.1
# PyroCMS Deploy Tool v1.2
#
# This build file is desgined to automate the installation process
# of PyroCMS 3 apps, their addons, underlying framework (i.e. Laravel,
Expand Down Expand Up @@ -305,28 +305,35 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->

<target name="composer-dependencies" depends="require-pyro" description="Require and remove composer packages">

<if>
<equals arg1="${setup}" arg2="true"/>
<then>

<echo message="Run composer ..."/>
<echo message="Run composer ..."/>

<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
<arg line="install"/>
</exec>
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
<arg line="install"/>
</exec>

<for list="${env.COMPOSER.require}" param="package">
<sequential>
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
<arg line="require @{package}"/>
</exec>
</sequential>
</for>
<for list="${env.COMPOSER.require}" param="package">
<sequential>
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
<arg line="require @{package}"/>
</exec>
</sequential>
</for>

<for list="${env.COMPOSER.remove}" param="package">
<sequential>
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
<arg line="remove @{package}"/>
</exec>
</sequential>
</for>
<for list="${env.COMPOSER.remove}" param="package">
<sequential>
<exec dir="${app.dir}" executable="${env.COMPOSER.bin}">
<arg line="remove @{package}"/>
</exec>
</sequential>
</for>

</then>
</if>

</target>

Expand All @@ -338,49 +345,56 @@

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

<echo message="Clone a fresh copy of pyrocms ... "/>

<exec dir="${app.dir}" executable="${env.GIT.bin}">
<arg line="clone"/>
<arg line="-b"/>
<arg line="${env.PYRO.branch}"/>
<arg line="${env.PYRO.repo}"/>
<arg line="${pyro.dir}"/>
</exec>

<echo message="Move PyroCMS files into the project folder ..."/>

<!-- move root folders -->
<for list="${env.PYRO_FOLDERS}" param="folder">
<sequential>
<move file="${pyro.dir}/@{folder}" todir="${app.dir}" includeEmptyDirs="yes" failonerror="${failonerror}" quiet="${quiet}"/>
</sequential>
</for>

<!-- move folders inside public -->
<for list="${env.PUBLIC_FOLDERS}" param="folder">
<sequential>
<move file="${pyro.dir}/public/@{folder}" todir="${app.dir}/public" includeEmptyDirs="yes" failonerror="${failonerror}" quiet="${quiet}"/>
</sequential>
</for>
<if>
<equals arg1="${setup}" arg2="true"/>
<then>

<!-- move root folder files -->
<for list="${env.ROOT_FILES}" param="file">
<sequential>
<move file="${pyro.dir}/@{file}" todir="${app.dir}" failonerror="${failonerror}" quiet="${quiet}"/>
</sequential>
</for>
<echo message="Clone a fresh copy of pyrocms ... "/>

<exec dir="${app.dir}" executable="${env.GIT.bin}">
<arg line="clone"/>
<arg line="-b"/>
<arg line="${env.PYRO.branch}"/>
<arg line="${env.PYRO.repo}"/>
<arg line="${pyro.dir}"/>
</exec>

<echo message="Move PyroCMS files into the project folder ..."/>

<!-- move root folders -->
<for list="${env.PYRO_FOLDERS}" param="folder">
<sequential>
<move file="${pyro.dir}/@{folder}" todir="${app.dir}" includeEmptyDirs="yes" failonerror="${failonerror}" quiet="${quiet}"/>
</sequential>
</for>

<!-- move folders inside public -->
<for list="${env.PUBLIC_FOLDERS}" param="folder">
<sequential>
<move file="${pyro.dir}/public/@{folder}" todir="${app.dir}/public" includeEmptyDirs="yes" failonerror="${failonerror}" quiet="${quiet}"/>
</sequential>
</for>

<!-- move root folder files -->
<for list="${env.ROOT_FILES}" param="file">
<sequential>
<move file="${pyro.dir}/@{file}" todir="${app.dir}" failonerror="${failonerror}" quiet="${quiet}"/>
</sequential>
</for>

<!-- move files from public folder -->
<move todir="${app.dir}/public">
<fileset dir="${pyro.dir}/public">
<include name="**/*.*"/>
</fileset>
</move>

<!-- move files from public folder -->
<move todir="${app.dir}/public">
<fileset dir="${pyro.dir}/public">
<include name="**/*.*"/>
</fileset>
</move>
<echo message="Remove PyroCMS temporary folder ..."/>

<echo message="Remove PyroCMS temporary folder ..."/>
<delete dir="${pyro.dir}" failonerror="${failonerror}"/>

<delete dir="${pyro.dir}" failonerror="${failonerror}"/>
</then>
</if>

</target>

Expand Down Expand Up @@ -417,6 +431,7 @@
<property name="pyro.dir" value="${app.dir}/pyro"/>
<property name="laravel.dir" value="${app.dir}/laravel"/>
<property name="env.file" value="${app.dir}/.env"/>
<property name="setup" value="true"/>

<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# D A T A B A S E P R O P E R T I E S
Expand Down
7 changes: 5 additions & 2 deletions local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
# | | | | | | \ \ \ `-.-.-' /
# |_____| |_____| |_____| \____\ '-_ _-'
# `------'
# PyroCMS Deploy Tool v1.1
# PyroCMS Deploy Tool v1.2
#
################################################################################
#
# Build properties: change the following properties for this project
#
################################################################################


#---------------------------------------
# PyroCMS repository and default branch
#---------------------------------------
Expand All @@ -36,7 +37,7 @@ env.APP_URL=${env.APPLICATION_NAME}.dev
env.ADMIN_USERNAME=admin
env.ADMIN_EMAIL=[email protected]
env.ADMIN_PASSWORD=secret
env.DB_DATABASE=autopyro
env.DB_DATABASE=mcwap
env.DB_USERNAME=root
env.DB_PASSWORD=root
env.DB_CONNECTION=mysql
Expand Down Expand Up @@ -117,6 +118,8 @@ env.APP_ADDONS=
# @var DB_DROP, if true, drop the database, env.DB_DATABASE if exists
# @var LIQUIBASE, if true, download libraries and setup for use (http://www.liquibase.org/)
#---------------------------------------


env.DEBUG=true
env.DB_DROP=true
env.LIQUIBASE=false
Expand Down
2 changes: 1 addition & 1 deletion vagrant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# | | | | | | \ \ \ `-.-.-' /
# |_____| |_____| |_____| \____\ '-_ _-'
# `- - - '
# PyroCMS Deploy Tool v1.1
# PyroCMS Deploy Tool v1.2
#
# This vagrant build file is still work in progress.
#
Expand Down

0 comments on commit 3efeea1

Please sign in to comment.