0

I would like to reference an inspec profile in a folder in the git repo. Something similar to what you can do in Kitchen:

  inspec_tests:
    - name: profile-name
      git: https://user@github.com/org/my_repo.git
      relative_path: inspec/sdp-base
kidbrax
  • 2,364
  • 3
  • 30
  • 38

2 Answers2

0

As of January 2021, it doesn't seem to be possible from the CLI: https://github.com/inspec/inspec/issues/1237#issuecomment-767672074

But you could make a local "wrapper" profile that declares the relative path of the remote profile:

https://docs.chef.io/inspec/profiles/#git

deric4
  • 1,095
  • 7
  • 11
0

I eventually got it to work like this using local files:

### Inspec testing
  provisioner "shell-local" {
    inline_shebang = "/usr/local/bin/zsh -e"
    environment_vars = ["RUBYOPT=-W0"]
    inline = [
      "print -- \"${build.SSHPrivateKey}\" > pkr_build_key",
      "chmod 0600 pkr_build_key",
      "inspec exec --sudo -i pkr_build_key -t ssh://${build.User}@${build.Host} test/inspec"
      ]
  }

My test files are in ./test/inspec using the standard config. So, I don't know how to do it from a URL but the workaround is obviously to have a local clone somewhere. I find that useful anyway.

Yegolev
  • 9
  • 6