Skip to content
Snippets Groups Projects
Commit 45c961fb authored by Matt Miller's avatar Matt Miller
Browse files

Run cookbook_publisher as a bundled gem if installed

parent 3fd576a5
No related branches found
No related tags found
No related merge requests found
Pipeline #24101851 passed
Loading
Loading
@@ -117,13 +117,18 @@ push-cookbook:
refs:
- master
- main
- mattmi/fix-cookbook-publisher
variables:
- "$OPS_CLONE_USERNAME"
- "$OPS_CLONE_PASSWORD"
script:
- rm -rf Gemfile Gemfile.lock || true
- git clone https://$OPS_CLONE_USERNAME:$OPS_CLONE_PASSWORD@ops.gitlab.net/gitlab-cookbooks/cookbook-publisher.git /tmp/cookbook-publisher
- cp /tmp/cookbook-publisher/publisher.rb /tmp/cookbook-publisher/Gemfile /tmp/cookbook-publisher/Gemfile.lock .
- if [[ "$(ruby -v | awk '{print $2}')" =~ ^2 ]]; then echo "Using cookbook-publisher lockfile" ; else rm Gemfile.lock ; fi
- bundle install
- bundle exec ruby publisher.rb
script: |
if grep 'cookbook_publisher' Gemfile
bundle && bundle exec cookbook_publisher
else
rm -rf Gemfile Gemfile.lock || true
git clone https://$OPS_CLONE_USERNAME:$OPS_CLONE_PASSWORD@ops.gitlab.net/gitlab-cookbooks/cookbook-publisher.git /tmp/cookbook-publisher
cp /tmp/cookbook-publisher/publisher.rb /tmp/cookbook-publisher/Gemfile /tmp/cookbook-publisher/Gemfile.lock .
if [[ "$(ruby -v | awk '{print $2}')" =~ ^2 ]]; then echo "Using cookbook-publisher lockfile" ; else rm Gemfile.lock ; fi
bundle install
bundle exec ruby publisher.rb
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment