Skip to content

Commit 2313fa7

Browse files
committed
Use the docker host's bolt command and bolt project file
* The previously implementation used pdk which ships with an older version of bolt. This allows the user to use the local installation of bolt which is the same procedure as using peadm directly. * This also fixes a few issues around module dependencies and relying on the fixtures path. Users are no longer required to have pdk or run bundle commands. Since this uses pure bolt the entire process mimics that of a real installation and usage. * Updates install and upgrade scripts to use bolt commands
1 parent 5e139ba commit 2313fa7

File tree

4 files changed

+37
-23
lines changed

4 files changed

+37
-23
lines changed

Diff for: spec/docker/Puppetfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This Puppetfile is managed by Bolt. Do not edit.
2+
# For more information, see https://pup.pt/bolt-modules
3+
4+
# The following directive installs modules to the managed moduledir.
5+
moduledir '.modules'
6+
7+
mod 'puppet/format', '1.0.0'
8+
mod 'puppetlabs/bolt_shim', '0.3.2'
9+
mod 'puppetlabs/apply_helpers', '0.3.0'
10+
mod 'WhatsARanjit/node_manager', '0.7.5'
11+
mod 'puppetlabs/ruby_task_helper', '0.5.1'
12+
mod 'puppetlabs/stdlib', '7.1.0'
13+
mod 'nwops/container_inventory', '0.1.1'

Diff for: spec/docker/bolt-project.yaml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: peadm_docker_examples
3+
modules:
4+
- name: nwops/container_inventory
5+
version_requirement: ">= 0.1.1"
6+
- name: puppetlabs/stdlib
7+
version_requirement: ">= 6.5.0 < 8.0.0"
8+
- puppetlabs/ruby_task_helper
9+
- WhatsARanjit/node_manager
10+
- puppetlabs/apply_helpers
11+
- puppetlabs/bolt_shim
12+
- puppet/format

Diff for: spec/docker/install.sh

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
#!/usr/bin/env bash
2-
# bundle install or pdk bundle install
3-
# bundle exec rake spec_prep or pdk bundle exec rake spec_prep
42
# must be in the spec/docker directory
5-
echo 'Please choose a PE architecture to provision: '
3+
# must have bolt 3.18+ installed
64
downloads=$(realpath ./)
75
inventory_dir=$(realpath ./)
86
inventory_path=${inventory_dir}/inventory.yaml
97
base_repo=$(realpath ../../)
108
spec_path=$(realpath ../)
11-
fixtures_path=$spec_path/fixtures/modules
12-
num=$(ls ${fixtures_path} | wc -l)
13-
if [[ ! "$num" -gt "8" ]]; then
14-
echo "No fixtures, please run bundle exec rake spec_prep or pdk bundle exec rake spec_prep"
15-
exit 1
16-
fi
9+
bolt module install
10+
ln -nfs ../../../ ./.modules/peadm
1711
# The concurrency is set to 2 to keep CPU usage from skyrocketing during Large and XL deployments
12+
echo 'Please choose a PE architecture to provision: '
13+
1814
select opt in */
1915
do
2016
dir=$(realpath ${opt})
2117
name=$(basename $opt)
2218
cd $dir
2319
docker-compose up -d --build
24-
# nohup /usr/bin/live_audit.sh /root/bolt_scripts /tmp/backup &
25-
pdk bundle exec bolt plan run peadm::install --concurrency 2 \
20+
bolt plan run peadm::install --concurrency 2 \
2621
--inventory $inventory_path \
27-
--modulepath=$fixtures_path \
2822
--params @${dir}/params.json \
2923
--targets=$name
3024
break;
3125
done
26+
# --modulepath=./modules \

Diff for: spec/docker/upgrade.sh

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
#!/usr/bin/env bash
2-
# bundle install or pdk bundle install
3-
# bundle exec rake spec_prep or pdk bundle exec rake spec_prep
42
# must be in the spec/docker directory
3+
# must have bolt 3.18+ installed
54
echo 'Please choose a PE architecture to provision: '
65
downloads=$(realpath ./)
76
inventory_dir=$(realpath ./)
87
inventory_path=${inventory_dir}/inventory.yaml
98
base_repo=$(realpath ../../)
10-
spec_path=$(realpath ../)
11-
fixtures_path=$spec_path/fixtures/modules
12-
num=$(ls ${fixtures_path} | wc -l)
13-
if [[ ! "$num" -gt "8" ]]; then
14-
echo "No fixtures, please run bundle exec rake spec_prep or pdk bundle exec rake spec_prep"
15-
exit 1
16-
fi
9+
bolt module install
10+
# bolt will clobber the .modules directory so a new link is required
11+
ln -nfs ../../../ ./.modules/peadm
1712
# The concurrency is set to 2 to keep CPU usage from skyrocketing during Large and XL deployments
1813
select opt in */
1914
do
@@ -22,9 +17,8 @@ do
2217
cd $dir
2318
docker-compose up -d --build
2419
# nohup /usr/bin/live_audit.sh /root/bolt_scripts /tmp/backup &
25-
pdk bundle exec bolt plan run peadm::upgrade --concurrency 2 \
20+
bolt plan run peadm::upgrade --concurrency 2 \
2621
--inventory $inventory_path \
27-
--modulepath=$fixtures_path \
2822
--params @${dir}/upgrade_params.json \
2923
--targets=$name
3024
break;

0 commit comments

Comments
 (0)