Skip to content

Instantly share code, notes, and snippets.

@cdenneen
Forked from heliocentric/.gitlab-ci.yml
Created April 2, 2018 13:49
Show Gist options
  • Save cdenneen/ac4ea572a6cc98a642629cef394716b1 to your computer and use it in GitHub Desktop.
Save cdenneen/ac4ea572a6cc98a642629cef394716b1 to your computer and use it in GitHub Desktop.
---
.cache_bundler: &cache_bundler
cache:
untracked: true
key: "$CI_BUILD_REF_NAME"
paths:
- '.vendor'
- 'vendor'
.setup_bundler_env: &setup_bundler_env
before_script:
# For FIPS compatibility
- gem install bundler -v '~> 1.14.0'
- rm -f Gemfile.lock
- bundle install --no-binstubs --path .vendor "${FLAGS[@]}"
.syntax_checks: &syntax_checks
script:
- bundle exec rake syntax
- bundle exec rake check:dot_underscore
- bundle exec rake check:test_file
- bundle exec rake pkg:check_version
- bundle exec rake compare_latest_tag
.spec_tests: &spec_tests
script:
- bundle exec rake spec
stages:
- syntax
- unit
- acceptance
- deploy
puppet-syntax:
stage: syntax
tags:
- docker
image: ruby:2.4
<<: *cache_bundler
<<: *setup_bundler_env
<<: *syntax_checks
# Puppet 4
unit-test-ruby-2.1.9:
stage: unit
tags:
- docker
image: ruby:2.1.9
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests
# Puppet 5
unit-test-ruby-2.4.1:
stage: unit
tags:
- docker
image: ruby:2.4
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests
# For PE LTS Support
# See: https://puppet.com/misc/puppet-enterprise-lifecycle
puppet4.7-syntax:
stage: syntax
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '4.7'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *syntax_checks
unit-test-puppet4.7-ruby-2.1:
stage: unit
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '4.7'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests
puppet4.7-syntax:
stage: syntax
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '4.7'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *syntax_checks
unit-test-puppet4.7-ruby-2.1:
stage: unit
tags:
- docker
image: ruby:2.1
variables:
PUPPET_VERSION: '4.7'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests
puppet5-syntax:
stage: syntax
tags:
- docker
image: ruby:2.4
variables:
PUPPET_VERSION: '5.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *syntax_checks
unit-test-puppet5-ruby-2.4:
stage: unit
tags:
- docker
image: ruby:2.4
variables:
PUPPET_VERSION: '5.0'
<<: *cache_bundler
<<: *setup_bundler_env
<<: *spec_tests
compliance-test:
stage: acceptance
tags:
- beaker
<<: *cache_bundler
<<: *setup_bundler_env
script:
- bundle exec rake beaker:suites
code-manager-deploy:
stage: deploy
tags:
- docker
image: ruby:2.4
<<: *cache_bundler
<<: *setup_bundler_env
script:
# Stub just to show the preferred pipeline
- 'true'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment