diff --git a/.gitlab-ci.yaml b/.gitlab-ci.yaml new file mode 100644 index 0000000..9ae8e7f --- /dev/null +++ b/.gitlab-ci.yaml @@ -0,0 +1,96 @@ +--- +# Example of a CI/CD pipeline for a Puppet module +stages: + - QA🚦 + - Test🚥 + +variables: + RAKE: rake -f /Rakefile + +default: + image: + name: ghcr.io/voxpupuli/vobox:7.29.1-main + entrypoint: [""] + +### QA🚦 +.qa: + stage: QA🚦 + +qa-check: + extends: .qa + script: + - $RAKE check + +qa-lint: + extends: .qa + script: + - $RAKE lint + +qa-metadata_lint: + extends: .qa + script: + - $RAKE metadata_lint + +qa-puppet-strings: + extends: .qa + script: + - $RAKE strings:validate:reference + +qa-rubocop: + extends: .qa + script: + - $RAKE rubocop + +qa-syntax: + extends: .qa + script: + - $RAKE syntax + +qa-gateway: + stage: QA🚦 + image: alpine:latest + script: + - echo "QA Gateway" + variables: + GIT_STRATEGY: none + needs: + - qa-check + - qa-lint + - qa-metadata_lint + - qa-puppet-strings + - qa-rubocop + - qa-syntax + +### Test🚥 +.test: + stage: Test🚥 + needs: + - qa-gateway + +test-unit: + extends: .test + script: + - $RAKE spec + artifacts: + expire_in: "30 days" + when: always + paths: + - "rspec.xml" + reports: + junit: "rspec.xml" + +test-acceptance: + extends: .test + script: + - $RAKE beaker + +test-gateway: + stage: Test🚥 + image: alpine:latest + script: + - echo "Test Gateway" + variables: + GIT_STRATEGY: none + needs: + - test-unit + - test-acceptance diff --git a/README.md b/README.md index 5787ca1..11631c6 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,12 @@ This container should be used to test voxpupuli puppet modules. It has the voxpupuli-test, -acceptance, -release gems and all dependencies installed. +### Versions + +Too see which gems and versions are included in the container, see: + +[build_versions.json](build_versions.json) + ## Example usage ```shell @@ -17,6 +23,10 @@ docker run -it --rm -v $(pwd):/repo voxpupuli/voxbox spec # rake spec docker run -it --rm -v $(pwd):/repo --entrypoint bash voxpupuli/voxbox # get shell ``` +## Example Gitlab CI configuration + +see [.gitlab-ci.yml](.gitlab-ci.yml) + ## Version Schema The version schema has the following layout: