- job-template:
    name: 'gate-{name}-puppet-unit-{puppet_version}'
    node: '{node}'

    triggers:
      - zuul

    builders:
      - gerrit-git-prep
      - shell: |
          export PUPPET_GEM_VERSION='~> {puppet_version}'
          mkdir .bundled_gems
          export GEM_HOME=`pwd`/.bundled_gems
          bundle install
          echo {puppet_version} | grep '2.6' && git clone git://github.com/puppetlabs/puppetlabs-create_resources.git spec/fixtures/modules/create_resources || true
          bundle exec rake spec SPEC_OPTS='--format documentation'

    publishers:
      - console-log

- job-template:
    name: 'gate-{name}-puppet-lint'
    node: '{node}'

    triggers:
      - zuul

    builders:
      - gerrit-git-prep
      - puppet-lint

    publishers:
      - console-log

- job-template:
    name: 'gate-{name}-puppet-syntax'
    node: '{node}'

    triggers:
      - zuul

    builders:
      - gerrit-git-prep
      - puppet-syntax

    publishers:
      - console-log

- job-group:
    name: 'puppet-module-unit'
    puppet_version:
      - 2.6
      - 2.7
      - 3.0
      - 3.1
    jobs:
      - 'gate-{name}-puppet-unit-{puppet_version}'

- job-template:
    name: 'gate-{name}-puppet-unit-{puppet_version}'
    node: '{node}'

    triggers:
      - zuul

    builders:
      - gerrit-git-prep
      - shell: |
          export PUPPET_GEM_VERSION='~> {puppet_version}.0'
          mkdir .bundled_gems
          export GEM_HOME=`pwd`/.bundled_gems
          bundle install
          echo {puppet_version} | grep '2.6' && git clone git://github.com/puppetlabs/puppetlabs-create_resources.git spec/fixtures/modules/create_resources || true
          bundle exec rake spec SPEC_OPTS='--format documentation'

    publishers:
      - console-log

- job-template:
    name: 'gate-{name}-puppet-lint'
    node: '{node}'

    triggers:
      - zuul

    builders:
      - gerrit-git-prep
      - puppet-lint

    publishers:
      - console-log

- job-template:
    name: 'gate-{name}-puppet-syntax'
    node: '{node}'

    triggers:
      - zuul

    builders:
      - gerrit-git-prep
      - puppet-syntax

    publishers:
      - console-log

- job-group:
    name: 'puppet-module-unit'
    puppet_version:
      - 2.6
      - 2.7
      - 3.0
      - 3.1
    jobs:
      - 'gate-{name}-puppet-unit-{puppet_version}'

Fix puppet gem version in puppet-unit gates
Fix puppet gem version in puppet-unit gates

The version provided by puppet_version isn't restrictive enough.
Appending .0 to the puppet gem version makes sure the correct minor
version is installed by bundler.

Updating the list of puppet_version in the puppet-module-unit job-group
isn't a desired fix. It would have undesired side effects such as
renaming Jenkins jobs and misleading the user into thinking
puppet modules are tested against 2.6.0 when 2.6.x is actually used.

Change-Id: I8e19df76bf8483ea65dff5095ed1a03db408ecf6
Reviewed-on: https://review.openstack.org/30187
Reviewed-by: Dan Bode <00d761b23995d0adadf5b7f5eea7dc44b892ddb7@gmail.com>
Reviewed-by: Clark Boylan <635fc31d01fa593720982fa0568e87170cedbe2c@gmail.com>
Approved: Jeremy Stanley <98883b97e35b7bb1ac282bb863f2e9d917db0454@yuggoth.org>
Reviewed-by: Jeremy Stanley <98883b97e35b7bb1ac282bb863f2e9d917db0454@yuggoth.org>
Tested-by: Jenkins
