Skip to content

Commit

Permalink
Merge pull request #125 from palantirnet/tasks-to-targets
Browse files Browse the repository at this point in the history
Rename 'tasks' directory to 'targets'
  • Loading branch information
becw authored Jan 11, 2019
2 parents 429ba83 + db740c5 commit bf3f9a2
Show file tree
Hide file tree
Showing 14 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Additional changes include:

* Rewritten install process. This code is now all in one location, and configuration prompts for values that are not generally changed from the defaults have been removed. Templates for Behat and CircleCI are more dynamic, and templates for configuring Pantheon and Platform.sh hosting have been added.
* Rewritten artifact build process. This code should now be more readable, reliable, and adaptable. Artifacts are available from the default `build.xml` file, and are suitable for deployment on Acquia, Pantheon, or generic hosting environments.
* Rewritten Acquia tasks, including downloading a recent database backup.
* Rewritten Acquia targets, including downloading a recent database backup.

[Here's the list of issues associated with the 2.0 milestone.](https://github.com/palantirnet/the-build/issues?utf8=%E2%9C%93&q=milestone%3A2.0)

Expand Down
4 changes: 2 additions & 2 deletions bin/the-build-installer
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# Wrapper for our install command; at least this way it's somewhat discoverable.
# Previously:
# vendor/bin/phing -f vendor/palantirnet/the-build/tasks/install.xml
# vendor/bin/phing -f vendor/palantirnet/the-build/targets/install.xml

# Relative path to this script.
SCRIPT=$(readlink "$0")
Expand All @@ -14,7 +14,7 @@ REPOPATH=$(cd `dirname $SCRIPTPATH` && cd ../../../ && pwd)

if [ "$REPOPATH" = `pwd` ]; then
# Run our install task.
$SCRIPTPATH/../../../bin/phing -f $SCRIPTPATH/../tasks/install.xml
$SCRIPTPATH/../../../bin/phing -f $SCRIPTPATH/../targets/install.xml
else
echo "Please run this command from your project root."
fi
8 changes: 4 additions & 4 deletions defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ build:
# currently only used when setting up the settings.php file for a Drupal site.
host: other

# Drupal configuration used by tasks/drupal.xml
# Drupal configuration used by targets/drupal.xml
drupal:
# Relative path to the Drupal web root. This is co-dependent with the composer installer
# configuration in your `composer.json`. Use caution when changing this value.
Expand All @@ -39,7 +39,7 @@ drupal:
# Configuration values for a Drupal site build. The values in this section
# must be customized for each Drupal multisite installation that you add.
#
# This site configuration is partial; it will be completed in tasks/the-build.xml by
# This site configuration is partial; it will be completed in targets/the-build.xml by
# loading any missing values from drupal.sites._defaults.
#
# To add a Drupal multisite installation, copy these default values into
Expand Down Expand Up @@ -138,7 +138,7 @@ drupal:
#file:


# Configuration for tasks/artifact.xml
# Configuration for targets/artifact.xml
artifact:
# The path of the working directory where the artifact should be built.
directory: artifacts/build
Expand Down Expand Up @@ -175,7 +175,7 @@ artifact:
remote_name: origin


# Configuration for tasks/acquia.xml
# Configuration for targets/acquia.xml
acquia:
# Directory for storing downloaded database backups.
backups: artifacts/backups
Expand Down
12 changes: 6 additions & 6 deletions defaults/install/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@

<project name="@projectname@" default="build">

<!-- Add property loading and tasks from palantirnet/the-build. -->
<import file="vendor/palantirnet/the-build/tasks/the-build.xml" />
<!-- Add property loading and targets from palantirnet/the-build. -->
<import file="vendor/palantirnet/the-build/targets/the-build.xml" />


<!-- Make these additional targets available by default. -->
<import file="vendor/palantirnet/the-build/tasks/drupal.xml" />
<import file="vendor/palantirnet/the-build/targets/drupal.xml" />


<!-- Additional optional targets. -->
<import file="vendor/palantirnet/the-build/tasks/artifact.xml" />
<import file="vendor/palantirnet/the-build/tasks/acquia.xml" />
<import file="vendor/palantirnet/the-build/tasks/styleguide.xml" />
<import file="vendor/palantirnet/the-build/targets/artifact.xml" />
<import file="vendor/palantirnet/the-build/targets/acquia.xml" />
<import file="vendor/palantirnet/the-build/targets/styleguide.xml" />


<!-- Default target: build -->
Expand Down
2 changes: 1 addition & 1 deletion docs/artifacts.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Alternatively, you may chose to not set the `artifact.git.remote_branch` propert

## Concepts

This section describes a generalized artifact build process. This is the process implemented in [tasks/artifact.xml](../tasks/artifact.xml), and usage is described above.
This section describes a generalized artifact build process. This is the process implemented in [targets/artifact.xml](../targets/artifact.xml), and usage is described above.

### Definitions

Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Cool! This phing-ism is what allows us to do environment-specific property layer
```
phing build -Dbuild.env=circleci
```
1. Set the `build.dir`, `projectname`, `build.thebuild.dir`, and `build.env` core properties in `tasks/the-build.xml`
1. Set the `build.dir`, `projectname`, `build.thebuild.dir`, and `build.env` core properties in `targets/the-build.xml`
1. Load properties from the project's `.the-build/build.[environment].yml`
1. Load properties from the project's `.the-build/build.yml`
1. Load default property values from the-build's own `defaults.yml` file
Expand Down
2 changes: 1 addition & 1 deletion docs/drupal_multisite.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Multisite builds are supported under `the-build`. When you have multiple sites configured in your `.the-build/build.yml` file, and you run targets like `build` and `install` that act on a specific site, you will be prompted to select a site.

These site-specific targets declare a dependency on the `set-site` target in [tasks/the-build.xml](../tasks/the-build.xml), which sets up the site properties in `drupal.site.*`. This allows targets to reference the same properties (e.g. `${drupal.site.uri}`) for each site, rather than needing to reference a site-specific property (e.g. `${drupal.sites.default.uri}`, `${drupal.sites.intranet.uri}`).
These site-specific targets declare a dependency on the `set-site` target in [targets/the-build.xml](../targets/the-build.xml), which sets up the site properties in `drupal.site.*`. This allows targets to reference the same properties (e.g. `${drupal.site.uri}`) for each site, rather than needing to reference a site-specific property (e.g. `${drupal.sites.default.uri}`, `${drupal.sites.intranet.uri}`).

Default values for all sites are set in the `drupal.sites._defaults.*` properties, but individual sites can override them.

Expand Down
2 changes: 1 addition & 1 deletion docs/tasks.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Custom Tasks
# Custom Phing Tasks

## IncludeResourceTask [🔗](../src/TheBuild/IncludeResourceTask.php)

Expand Down
2 changes: 1 addition & 1 deletion tasks/acquia.xml → targets/acquia.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Targets for working with Acquia.
Include this file in your build.xml with:
<import file="vendor/palantirnet/the-build/tasks/acquia.xml" />
<import file="vendor/palantirnet/the-build/targets/acquia.xml" />
@see defaults.yml
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions tasks/drupal.xml → targets/drupal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Targets for managing Drupal.
Include this file in your build.xml with:
<import file="vendor/palantirnet/the-build/tasks/drupal.xml" />
<import file="vendor/palantirnet/the-build/targets/drupal.xml" />
@see defaults.yml
Expand Down Expand Up @@ -326,7 +326,7 @@ Or, you can specify the export file directly:
<!--
Set up the Drupal site directory.
-->
<phing buildfile="${build.thebuild.dir}/tasks/install.xml" target="drupal-sites-directory">
<phing buildfile="${build.thebuild.dir}/targets/install.xml" target="drupal-sites-directory">
<property name="drupal.site.dir" value="${_multisite.dir}" override="true" />
<property name="drupal.site.uri" value="${_multisite.uri}" override="true" />
</phing>
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion tasks/styleguide.xml → targets/styleguide.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Targets for managing the style guide.
Include this file in your build.xml with:
<import file="vendor/palantirnet/the-build/tasks/styleguide.xml" />
<import file="vendor/palantirnet/the-build/targets/styleguide.xml" />
@see defaults.properties.yml
Expand Down
6 changes: 3 additions & 3 deletions tasks/the-build.xml → targets/the-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Contains the-build's environment-specific property loading.
This file is included in the build.dist.xml template with:
<import file="vendor/palantirnet/the-build/tasks/the-build.xml" />
<import file="vendor/palantirnet/the-build/targets/the-build.xml" />
Copyright 2016, 2017, 2018 Palantir.net, Inc.
-->
Expand Down Expand Up @@ -130,8 +130,8 @@
<copyproperties fromPrefix="drupal.sites.${build.site}" toPrefix="drupal.site" override="true" />

<!-- Validate that required Drupal site properties are present. -->
<fail unless="drupal.site.dir" msg="The 'drupal.sites.${build.site}.dir' property must be set in order to run build tasks." />
<fail unless="drupal.site.uri" msg="The 'drupal.sites.${build.site}.uri' property must be set in order to run build tasks." />
<fail unless="drupal.site.dir" msg="The 'drupal.sites.${build.site}.dir' property must be set in order to run build targets." />
<fail unless="drupal.site.uri" msg="The 'drupal.sites.${build.site}.uri' property must be set in order to run build targets." />

<!-- Fill in defaults for Drupal site properties. -->
<property name="drupal.site.config_sync_directory" value="../config/sites/${drupal.site.dir}" />
Expand Down

0 comments on commit bf3f9a2

Please sign in to comment.