Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / consolidation / robo / src / Task / Docker / Build.php
diff --git a/vendor/consolidation/robo/src/Task/Docker/Build.php b/vendor/consolidation/robo/src/Task/Docker/Build.php
new file mode 100644 (file)
index 0000000..11eb92a
--- /dev/null
@@ -0,0 +1,55 @@
+<?php
+namespace Robo\Task\Docker;
+
+/**
+ * Builds Docker image
+ *
+ * ```php
+ * <?php
+ * $this->taskDockerBuild()->run();
+ *
+ * $this->taskDockerBuild('path/to/dir')
+ *      ->tag('database')
+ *      ->run();
+ *
+ * ?>
+ *
+ * ```
+ *
+ * Class Build
+ * @package Robo\Task\Docker
+ */
+class Build extends Base
+{
+    /**
+     * @var string
+     */
+    protected $path;
+
+    /**
+     * @param string $path
+     */
+    public function __construct($path = '.')
+    {
+        $this->command = "docker build";
+        $this->path = $path;
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function getCommand()
+    {
+        return $this->command . ' ' . $this->arguments . ' ' . $this->path;
+    }
+
+    /**
+     * @param string $tag
+     *
+     * @return $this
+     */
+    public function tag($tag)
+    {
+        return $this->option('-t', $tag);
+    }
+}