Ciinabox Jenkins Pipeline Updates

This update adds some extra functionality to some AMI baking methods around AMI lookup from SSM parameters as well as additional chef options to the AMI verify method.

lookupAMI

step {
  lookupAMI(
    region: 'ap-southeast-2',
    ssm: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-ebs',
    env: 'MY_AMI_ID'
  )
  echo "found latest amazon linux 2 AMI: ${MY_AMI_ID}"
}

packer

verifyAMIv2

The following example spins up a base amazon linux 2 AMI and runs the my-cookbook::app recipe before validating the inspec test suite amzn2. This allows the ability to run your inspec tests before baking the AMI with packer

steps {
  verifyAMIv2(
    role: 'App',
    cookbook: 'my-cookbook',
    amiLookupSSM: '/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-ebs',
    suite: 'amzn2',
    runlist: ['app']
  )
}

PR: https://github.com/base2Services/ciinabox-pipelines/pull/117