Added a drush package action and task #1

Merged
merged 5 commits into from Aug 1, 2013

Projects

None yet

2 participants

@danquah

No description provided.

@xendk xendk commented on an outdated diff Aug 1, 2013
ci.drakefile.drushrc.php
@@ -125,6 +125,13 @@
),
);
+/**
+ * Fileset that contains everything.
+ */
+$filesets['root'] = array(
@xendk
xendk Aug 1, 2013

Should be named "all".

@xendk xendk commented on an outdated diff Aug 1, 2013
ci.drakefile.drushrc.php
@@ -309,6 +316,37 @@
);
/*
+ * Package a build into a timestamped zip-file placed in the root of the site.
+ */
+$tasks['package'] = array(
+ 'action' => 'package',
+ 'files' => fileset('root'),
+ 'output-dir' => context_optional('package-output-dir', context('[@self:site:root]')),
+ 'basename' => context_optional('package-basename', 'package'),
+ 'prefix' => context_optional('package-prefix', date('Y-m-d-His')),
+);
+
+/*
+ * Package a build into a zip-file.
+ */
+$actions['package'] = array(
@xendk
xendk Aug 1, 2013

Too generic. There might come other packaging commands for tar.gz, etc.

"package-zip" is better.

@xendk xendk commented on an outdated diff Aug 1, 2013
ci.drakefile.drushrc.php
+
+ // Add files to the archive.
+ drush_log(dt('Packaging to @file', array('@file' => $output)), 'status');
+ foreach ($context['files'] as $file) {
+ $zip->addFile($file->fullPath(), $file->path());
+ }
+ $zip->close();
+ return TRUE;
+}
+
+/**
+ * Returns a human-readable status.
+ *
+ * Nabbed from http://www.php.net/manual/en/class.ziparchive.php#108601
+ */
+function drake_get_zip_status_string($status) {
@xendk
xendk Aug 1, 2013

Should be drake_ci_get_zip_status_string.

@xendk xendk merged commit 5fcb306 into xendk:master Aug 1, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment