From 98ab6b4453bdb13fcb15fb8edafc68cb273fcee8 Mon Sep 17 00:00:00 2001
From: Hordur Freyr Yngvason <hfyngvason@gitlab.com>
Date: Thu, 2 Jul 2020 21:49:42 +0000
Subject: [PATCH] Update Auto DevOps auto-build-image to v0.3.0

Adds the ability to override the default Dockerfile path via the
DOCKERFILE_PATH CI variable.

- Upstream change: https://gitlab.com/gitlab-org/cluster-integration/auto-build-image/-/merge_requests/47
- Feature request: https://gitlab.com/gitlab-org/gitlab/-/issues/212211
---
 changelogs/unreleased/update-auto-build-image-to-0-3-0.yml | 5 +++++
 doc/topics/autodevops/customize.md                         | 6 ++++++
 lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml           | 2 +-
 3 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100644 changelogs/unreleased/update-auto-build-image-to-0-3-0.yml

diff --git a/changelogs/unreleased/update-auto-build-image-to-0-3-0.yml b/changelogs/unreleased/update-auto-build-image-to-0-3-0.yml
new file mode 100644
index 0000000000000..a8f5534f043ad
--- /dev/null
+++ b/changelogs/unreleased/update-auto-build-image-to-0-3-0.yml
@@ -0,0 +1,5 @@
+---
+title: Add custom Dockerfile paths to Auto DevOps Build stage with DOCKERFILE_PATH
+merge_request: 35662
+author: thklein
+type: added
diff --git a/doc/topics/autodevops/customize.md b/doc/topics/autodevops/customize.md
index 253d5e5646361..679edbdfe40b7 100644
--- a/doc/topics/autodevops/customize.md
+++ b/doc/topics/autodevops/customize.md
@@ -41,11 +41,16 @@ If your goal is to use only a single custom buildpack, you should provide the pr
 
 ## Custom `Dockerfile`
 
+> Support for `DOCKERFILE_PATH` was [added in GitLab 13.2](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/35662)
+
 If your project has a `Dockerfile` in the root of the project repository, Auto DevOps
 builds a Docker image based on the Dockerfile, rather than using buildpacks.
 This can be much faster and result in smaller images, especially if your
 Dockerfile is based on [Alpine](https://hub.docker.com/_/alpine/).
 
+If you set the `DOCKERFILE_PATH` CI variable, Auto Build looks for a Dockerfile there
+instead.
+
 ## Passing arguments to `docker build`
 
 Arguments can be passed to the `docker build` command using the
@@ -311,6 +316,7 @@ applications.
 | `CANARY_ENABLED`                        | From GitLab 11.0, used to define a [deploy policy for canary environments](#deploy-policy-for-canary-environments-premium). |
 | `CANARY_PRODUCTION_REPLICAS`            | Number of canary replicas to deploy for [Canary Deployments](../../user/project/canary_deployments.md) in the production environment. Takes precedence over `CANARY_REPLICAS`. Defaults to 1. |
 | `CANARY_REPLICAS`                       | Number of canary replicas to deploy for [Canary Deployments](../../user/project/canary_deployments.md). Defaults to 1. |
+| `DOCKERFILE_PATH`                       | From GitLab 13.2, allows overriding the [default Dockerfile path for the build stage](#custom-dockerfile) |
 | `HELM_RELEASE_NAME`                     | From GitLab 12.1, allows the `helm` release name to be overridden. Can be used to assign unique release names when deploying multiple projects to a single namespace. |
 | `HELM_UPGRADE_VALUES_FILE`              | From GitLab 12.6, allows the `helm upgrade` values file to be overridden. Defaults to `.gitlab/auto-deploy-values.yaml`. |
 | `HELM_UPGRADE_EXTRA_ARGS`               | From GitLab 11.11, allows extra arguments in `helm` commands when deploying the application. Note that using quotes won't prevent word splitting. |
diff --git a/lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml b/lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml
index b55504614824a..8bbe1047179d6 100644
--- a/lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml
+++ b/lib/gitlab/ci/templates/Jobs/Build.gitlab-ci.yml
@@ -1,6 +1,6 @@
 build:
   stage: build
-  image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image:v0.2.3"
+  image: "registry.gitlab.com/gitlab-org/cluster-integration/auto-build-image:v0.3.0"
   variables:
     DOCKER_TLS_CERTDIR: ""
   services:
-- 
GitLab