Skip to content

Commit 80ade08

Browse files
committed
Checkout the latest tagged module version
Checkout the latest tagged module version when installing the agent. This has to be done separately for dnf & sles. We can't use `puppet module install` in the install task, because puppet hasn't been installed yet. As a result of this change, we have to clone the entire repo, rather than using depth=1, since there's no guarantee that the latest commit will be tagged. Also update the commented out git clone commands in the upgrade scripts. Those can be useful if you need to test that an unreleased change in a module dependency won't break this module.
1 parent 0e52e65 commit 80ade08

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

docker/install/dnf/Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ COPY metadata.json ./
3333

3434
# Installing dependencies from source. These versions should be within the range
3535
# of `dependencies` in metadata.json.
36-
RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib --branch v9.7.0
37-
RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-inifile ../inifile --branch v6.2.0
38-
RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-apt ../apt --branch v10.0.1
39-
RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-facts ../facts --branch 1.7.0
36+
RUN git clone --tags https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib && \
37+
$(cd ../stdlib && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
38+
RUN git clone --tags https://github.com/puppetlabs/puppetlabs-inifile ../inifile && \
39+
$(cd ../inifile && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
40+
RUN git clone --tags https://github.com/puppetlabs/puppetlabs-apt ../apt && \
41+
$(cd ../apt && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
42+
RUN git clone --tags https://github.com/puppetlabs/puppetlabs-facts ../facts && \
43+
$(cd ../facts && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
4044

4145
# Now move the project directory's files into the image. That way, if these
4246
# files change, caching will skip everything before this.

docker/install/sles/Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,14 @@ COPY metadata.json ./
2727

2828
# Installing dependencies from source. These versions should be within the range
2929
# of `dependencies` in metadata.json.
30-
RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib --branch v9.7.0
31-
RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-inifile ../inifile --branch v6.2.0
32-
RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-apt ../apt --branch v10.0.1
33-
RUN git clone --depth 1 https://github.com/puppetlabs/puppetlabs-facts ../facts --branch 1.7.0
30+
RUN git clone --tags https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib && \
31+
$(cd ../stdlib && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
32+
RUN git clone --tags https://github.com/puppetlabs/puppetlabs-inifile ../inifile && \
33+
$(cd ../inifile && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
34+
RUN git clone --tags https://github.com/puppetlabs/puppetlabs-apt ../apt && \
35+
$(cd ../apt && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
36+
RUN git clone --tags https://github.com/puppetlabs/puppetlabs-facts ../facts && \
37+
$(cd ../facts && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
3438

3539
# Now move the project directory's files into the image. That way, if these
3640
# files change, caching will skip everything before this.

docker/upgrade/dnf/Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,14 @@ RUN /opt/puppetlabs/puppet/bin/puppet module install --modulepath $module_path -
7070

7171
# Installing dependencies from source. These versions should be within the range
7272
# of `dependencies` in metadata.json.
73-
#RUN git clone https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib --branch 9.7.0
74-
#RUN git clone https://github.com/puppetlabs/puppetlabs-inifile ../inifile --branch 6.2.0
75-
#RUN git clone https://github.com/puppetlabs/puppetlabs-apt ../apt --branch 10.0.1
76-
#RUN git clone https://github.com/puppetlabs/puppetlabs-facts ../facts --branch 1.7.0
73+
# RUN git clone --tags https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib && \
74+
# $(cd ../stdlib && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
75+
# RUN git clone --tags https://github.com/puppetlabs/puppetlabs-inifile ../inifile && \
76+
# $(cd ../inifile && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
77+
# RUN git clone --tags https://github.com/puppetlabs/puppetlabs-apt ../apt && \
78+
# $(cd ../apt && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
79+
# RUN git clone --tags https://github.com/puppetlabs/puppetlabs-facts ../facts && \
80+
# $(cd ../facts && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
7781

7882
# Check that all dependencies are installed.
7983
RUN /opt/puppetlabs/puppet/bin/puppet module --modulepath $module_path list --tree

docker/upgrade/sles/Dockerfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,14 @@ RUN /opt/puppetlabs/puppet/bin/puppet module install --modulepath $module_path -
6464

6565
# Installing dependencies from source. These versions should be within the range
6666
# of `dependencies` in metadata.json.
67-
#RUN git clone https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib --branch 9.7.0
68-
#RUN git clone https://github.com/puppetlabs/puppetlabs-inifile ../inifile --branch 6.2.0
69-
#RUN git clone https://github.com/puppetlabs/puppetlabs-apt ../apt --branch 10.0.1
70-
#RUN git clone https://github.com/puppetlabs/puppetlabs-facts ../facts --branch 1.7.0
67+
# RUN git clone --tags https://github.com/puppetlabs/puppetlabs-stdlib ../stdlib && \
68+
# $(cd ../stdlib && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
69+
# RUN git clone --tags https://github.com/puppetlabs/puppetlabs-inifile ../inifile && \
70+
# $(cd ../inifile && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
71+
# RUN git clone --tags https://github.com/puppetlabs/puppetlabs-apt ../apt && \
72+
# $(cd ../apt && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
73+
# RUN git clone --tags https://github.com/puppetlabs/puppetlabs-facts ../facts && \
74+
# $(cd ../facts && git checkout $(git describe --tags $(git rev-list --tags --max-count=1)))
7175

7276
# Check that all dependencies are installed.
7377
RUN /opt/puppetlabs/puppet/bin/puppet module --modulepath $module_path list --tree

0 commit comments

Comments
 (0)