summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Duffield <tom@chef.io>2020-07-24 13:55:01 -0500
committerTom Duffield <tom@chef.io>2020-07-28 10:54:01 -0500
commitb604456f87fe99247a4af1b97fb3ef6c6e410bf2 (patch)
tree06d9fa99c84a90cb46d310c7cf9b570c2e8a02c7
parent395f9f54cef1e3cb7333d4f875e4c97e9a7123b3 (diff)
downloadchef-b604456f87fe99247a4af1b97fb3ef6c6e410bf2.tar.gz
Add further clarifications to usage of docker/build pipeline
* Add the new `built_in:promote_docker_images` action * Replace `built_in:build_docker_image` with `trigger_pipeline:docker/build` * Remove unnecessary logic from Dockerfile * Add inline comment context for dobi.yaml Signed-off-by: Tom Duffield <tom@chef.io>
-rw-r--r--.envrc2
-rw-r--r--.expeditor/config.yml14
-rwxr-xr-x.expeditor/update_version.sh12
-rw-r--r--Dockerfile8
-rw-r--r--dobi.yaml16
-rw-r--r--docs/dev/README.md1
-rw-r--r--docs/dev/how_to/building_docker_images.md11
7 files changed, 28 insertions, 36 deletions
diff --git a/.envrc b/.envrc
deleted file mode 100644
index 33ca95455a..0000000000
--- a/.envrc
+++ /dev/null
@@ -1,2 +0,0 @@
-# export IMAGE_REGISTRY="localhost:5000"
-# export VERSION=$(cat VERSION) \ No newline at end of file
diff --git a/.expeditor/config.yml b/.expeditor/config.yml
index 8a6f5c48d1..b2f0d22c68 100644
--- a/.expeditor/config.yml
+++ b/.expeditor/config.yml
@@ -84,17 +84,17 @@ merge_actions:
subscriptions:
# the omnibus/docker/gem chain
- # - workload: artifact_published:unstable:chef:{{version_constraint}}
- # actions:
- # - built_in:build_docker_image
- # - workload: artifact_published:current:chef:{{version_constraint}}
- # actions:
- # - built_in:tag_docker_image
+ - workload: artifact_published:unstable:chef:{{version_constraint}}
+ actions:
+ - trigger_pipeline:docker/build
+ - workload: artifact_published:current:chef:{{version_constraint}}
+ actions:
+ - built_in:promote_docker_images
- workload: artifact_published:stable:chef:{{version_constraint}}
actions:
- built_in:rollover_changelog
- bash:.expeditor/update_dockerfile.sh
- # - built_in:tag_docker_image
+ - built_in:promote_docker_images
- built_in:publish_rubygems
- built_in:promote_habitat_packages
- built_in:notify_chefio_slack_channels
diff --git a/.expeditor/update_version.sh b/.expeditor/update_version.sh
index d92c019ebb..3312cccbc0 100755
--- a/.expeditor/update_version.sh
+++ b/.expeditor/update_version.sh
@@ -11,13 +11,15 @@
set -evx
-sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"$(cat VERSION)\"/" chef-config/lib/chef-config/version.rb
-sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"$(cat VERSION)\"/" chef-bin/lib/chef-bin/version.rb
-sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"$(cat VERSION)\"/" chef-utils/lib/chef-utils/version.rb
-sed -i -r "s/VersionString\.new\(\".+\"\)/VersionString.new(\"$(cat VERSION)\")/" lib/chef/version.rb
+VERSION=$(cat VERSION)
+
+sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"${VERSION}\"/" chef-config/lib/chef-config/version.rb
+sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"${VERSION}\"/" chef-bin/lib/chef-bin/version.rb
+sed -i -r "s/^(\s*)VERSION = \".+\"/\1VERSION = \"${VERSION}\"/" chef-utils/lib/chef-utils/version.rb
+sed -i -r "s/VersionString\.new\(\".+\"\)/VersionString.new(\"${VERSION}\")/" lib/chef/version.rb
# Update the version for the dobi
-sed -i -r "s/^(\s*)VERSION: \".+\"/\1VERSION: \"$(cat VERSION)\"/" .expeditor/build.docker.yml
+sed -i -r "s/^(\s*)VERSION: \".+\"/\1VERSION: \"${VERSION}\"/" .expeditor/build.docker.yml
# Update the version inside Gemfile.lock
bundle update chef chef-config chef-utils --jobs=7 --conservative
diff --git a/Dockerfile b/Dockerfile
index d5a4792216..4312b9d94e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,20 +12,14 @@
#
# When a build is promoted to our "stable" channel .expeditor/update_dockerfile.sh is run to update the version
# in this file and also tag that image as "latest" on Docker Hub. Additionally major and minor tags will be
-# applied so 15.0.260 would be tagged as "latest", "15" and "15.0", as well as "15.0.260".
+# applied so 15.0.260 would be tagged as "latest", "stable", "15" and "15.0", as well as "15.0.260".
FROM busybox
LABEL maintainer="Chef Software, Inc. <docker@chef.io>"
-ARG EXPEDITOR_CHANNEL
ARG CHANNEL=stable
-ARG EXPEDITOR_VERSION
ARG VERSION=16.3.38
-# Allow the build arg below to be controlled by either build arguments
-ENV VERSION ${EXPEDITOR_VERSION:-${VERSION}}
-ENV CHANNEL ${EXPEDITOR_CHANNEL:-${CHANNEL}}
-
RUN wget "http://packages.chef.io/files/${CHANNEL}/chef/${VERSION}/el/6/chef-${VERSION}-1.el6.x86_64.rpm" -O /tmp/chef-client.rpm && \
rpm2cpio /tmp/chef-client.rpm | cpio -idmv && \
rm -rf /tmp/chef-client.rpm
diff --git a/dobi.yaml b/dobi.yaml
index bd831c3746..a113a1a4ab 100644
--- a/dobi.yaml
+++ b/dobi.yaml
@@ -1,8 +1,18 @@
-
-# Images
+# Chef Expeditor uses this file to build the chef/chef Docker image using Dobi (dnephin/dobi)
+#
+# If you wish to build the chef-infra-client Docker image, you do not need to use this file.
+# You can build the Docker image for yourself by simply running:
+#
+# docker build .
+#
+# For more information on how this file is used, please check out the Chef Expeditor docs:
+# https://expeditor.chef.io/docs/pipelines/docker/
image=chef:
image: '{env.IMAGE_REGISTRY}/chef'
context: .
tags:
- - '{env.VERSION}' \ No newline at end of file
+ - '{env.VERSION}'
+ annotations:
+ tags:
+ - expeditor:final-channel-tags={{major}},{{major}}.{{minor}} \ No newline at end of file
diff --git a/docs/dev/README.md b/docs/dev/README.md
index 0528285c42..20a756b1f4 100644
--- a/docs/dev/README.md
+++ b/docs/dev/README.md
@@ -10,7 +10,6 @@ A good first start is our [How Chef Infra Is Built](./design_documents/how_chef_
- [Branching and Backporting Changes](./how_to/branching_and_backporting.md)
- [Updating Dependencies](./how_to/updating_dependencies.md)
- [Bumping Major and Minor Versions](./how_to/bumping_minor_or_major_versions.md)
-- [Building Docker Images](./how_to/building_docker_images.md)
## Design Documents
diff --git a/docs/dev/how_to/building_docker_images.md b/docs/dev/how_to/building_docker_images.md
deleted file mode 100644
index d751fe8466..0000000000
--- a/docs/dev/how_to/building_docker_images.md
+++ /dev/null
@@ -1,11 +0,0 @@
-# Building Docker Images
-
-## Using [Dobi](https://dnephin.github.io/dobi/)
-
-If you are unfamiliar with Dobi, it is a build automation tool for Docker applications. You can check out a lot of what Dobi has to offer at the link above or [here](https://github.com/dnephin/dobi).
-
-### Local Development
-
-Uncomment the `.envrc` file and run `direnv reload`. Dobi will use those env variables through variable substitution when you want to build the docker images locally. If you are already using `direnv` you can just add those env variables to what you are using or just export the env variables locally.
-
-You can then run the specified task (if there are any) that you would like Dobi to do. Since there are not many build steps there is no need to specify robust tasks for Dobi here. All that is needed is simply to run `dobi chef` after exporting those env variables and Dobi will build, tag and push your image to your image registry. \ No newline at end of file