- "octocatalog-diff does not run r10k or librarian-puppet for you. if you have a Puppetfile you need to provide some sort of bootstrap script (
--bootstrap-script)" - Environment variables: https://github.com/github/octocatalog-diff/blob/master/doc/advanced-environment-variables.md
- includes
OCTOCATALOG_DIFF_TEMPDIR
- includes
Last active
November 13, 2019 23:30
-
-
Save op-ct/9ac271c85937cd58ee0906b4c8b25811 to your computer and use it in GitHub Desktop.
WIP: octocatalog-diff settings for local factsets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module OctocatalogDiff | |
| class Config | |
| def self.config | |
| settings = {} | |
| settings[:puppet_binary] = File.join( `bundle show puppet`.chomp, 'bin', 'puppet') | |
| settings[:hiera_path_strip] = '/etc/puppetlabs/code/environments' | |
| settings[:hiera_config] = 'hiera.yaml' | |
| settings[:fact_file] = 'spec/factsets/sampled.facts.json' | |
| settings[:from_env] = 'origin/master' | |
| settings[:basedir] = Dir.pwd | |
| # Needed to run r10k and deploy the environment | |
| settings[:bootstrap_script] = File.join(Dir.pwd,'scripts/octocatalog_diff_bootstrap.sh') | |
| # hack to keep executables out of /tmp | |
| ENV['OCTOCATALOG_DIFF_TEMPDIR'] ||= File.join(__dir__,'.OCTOCATALOG_DIFF_TEMPDIR') | |
| require 'fileutils' | |
| FileUtils.mkdir_p ENV['OCTOCATALOG_DIFF_TEMPDIR'] | |
| # Cache the master branch and catalogs in home directory. This will speed up the second | |
| # and subsequent octocatalog-diff runs against the same node on the same branch. It's safe | |
| # to leave this enabled, but if you know that you never want to do caching on your system, | |
| # comment these lines out so the tool doesn't spend the time maintaining the cache. | |
| settings[:cached_master_dir] = File.join(__dir__, '..', '.OCTOCATALOG_DIFF_CACHE') | |
| FileUtils.mkdir_p settings[:cached_master_dir] | |
| settings[:safe_to_delete_cached_master_dir] = settings[:cached_master_dir] | |
| settings | |
| end | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh -x | |
| #cp $BASEDIR/Gemfile.lock ./ | |
| rvm config-get > $BASEDIR/r1 | |
| gem env | tee f1 | |
| ls -l | |
| pwd | |
| bundle check --dry-run || bundle --local || bundle | |
| bundle exec r10k puppetfile install -v warn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment