2020-05-06 09:32:26 +00:00
|
|
|
# Workaround to enable usage of mixed SSH and Docker GitLab CI runners
|
|
|
|
.template_pre: &template_pre
|
|
|
|
stage: pre
|
|
|
|
extends:
|
|
|
|
- .tags_docker
|
|
|
|
- .rules_singletest
|
|
|
|
before_script:
|
2020-09-25 12:53:55 +00:00
|
|
|
- source /etc/profile.d/rvm.sh # ensure RVM is loaded
|
2022-01-21 08:44:00 +00:00
|
|
|
- source /opt/rh/rh-nodejs*/enable # ensure Node.js is available
|
2020-05-06 09:32:26 +00:00
|
|
|
|
|
|
|
rubocop:
|
|
|
|
<<: *template_pre
|
|
|
|
script:
|
|
|
|
- bundle install -j $(nproc) --path vendor
|
2020-09-23 14:48:26 +00:00
|
|
|
- bundle exec rubocop --parallel
|
2020-05-06 09:32:26 +00:00
|
|
|
|
2021-06-17 14:19:07 +00:00
|
|
|
shellcheck:
|
|
|
|
<<: *template_pre
|
|
|
|
image: koalaman/shellcheck-alpine:stable
|
|
|
|
before_script:
|
|
|
|
- echo "Disable default before_script."
|
|
|
|
script:
|
2021-06-21 12:17:53 +00:00
|
|
|
- shellcheck -S warning $(find . -name "*.sh" -o -name "functions" | grep -v "/vendor/")
|
2021-06-17 14:19:07 +00:00
|
|
|
|
2021-06-23 11:35:27 +00:00
|
|
|
zeitwerk_check:
|
|
|
|
<<: *template_pre
|
|
|
|
extends:
|
|
|
|
- .tags_docker
|
|
|
|
- .services_postgresql
|
|
|
|
script:
|
|
|
|
- bundle install -j $(nproc) --path vendor
|
2021-06-30 08:24:58 +00:00
|
|
|
- bundle exec ruby .gitlab/configure_environment.rb
|
|
|
|
- source .gitlab/environment.env
|
2021-06-23 11:35:27 +00:00
|
|
|
- bundle exec rake zammad:db:init
|
|
|
|
- bundle exec rails zeitwerk:check
|
|
|
|
|
2021-07-20 13:31:46 +00:00
|
|
|
brakeman:
|
|
|
|
<<: *template_pre
|
|
|
|
artifacts:
|
|
|
|
expire_in: 1 week
|
|
|
|
paths:
|
2021-12-17 13:24:30 +00:00
|
|
|
- tmp/brakeman-report.html
|
2021-07-20 13:31:46 +00:00
|
|
|
when: on_failure
|
|
|
|
script:
|
|
|
|
- bundle install -j $(nproc) --path vendor
|
|
|
|
- bundle exec brakeman -o /dev/stdout -o tmp/brakeman-report.html
|
|
|
|
|
2020-05-06 09:32:26 +00:00
|
|
|
coffeelint:
|
|
|
|
<<: *template_pre
|
|
|
|
script:
|
2021-11-15 15:41:10 +00:00
|
|
|
- coffeelint --rules ./.coffeelint/rules/* app/
|
2020-05-06 09:32:26 +00:00
|
|
|
|
|
|
|
bundle-audit:
|
|
|
|
<<: *template_pre
|
|
|
|
script:
|
|
|
|
- gem install bundler-audit
|
|
|
|
- bundle-audit update
|
|
|
|
- bundle-audit --ignore CVE-2015-9284
|
|
|
|
|
|
|
|
github:
|
|
|
|
<<: *template_pre
|
|
|
|
tags:
|
|
|
|
- deploy
|
2020-09-25 12:53:55 +00:00
|
|
|
before_script:
|
2021-12-17 13:24:30 +00:00
|
|
|
- '' # no RVM present in deploy ENV
|
2020-05-06 09:32:26 +00:00
|
|
|
script:
|
2021-12-17 13:24:30 +00:00
|
|
|
- git fetch --unshallow
|
2020-09-25 12:53:55 +00:00
|
|
|
- script/build/sync_repo.sh git@github.com:zammad/zammad.git
|
2021-02-25 17:46:39 +00:00
|
|
|
|
|
|
|
global_refresh_envs:
|
|
|
|
extends:
|
|
|
|
- .tags_docker
|
|
|
|
- .services_postgresql
|
|
|
|
stage: pre
|
|
|
|
# ensure that only one Job runs in the whole project (branches etc.)
|
|
|
|
resource_group: global_refresh_envs
|
|
|
|
# allow download via the web UI to restore ENVs in case global cache got deleted (see: `.gitlab-ci.yml`)
|
|
|
|
artifacts:
|
|
|
|
expire_in: 1 day
|
|
|
|
paths:
|
2021-12-17 13:24:30 +00:00
|
|
|
- fresh.env
|
2021-02-25 17:46:39 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_MERGE_REQUEST_ID
|
|
|
|
when: never
|
|
|
|
- if: '$CI_COMMIT_BRANCH =~ /^private/'
|
|
|
|
when: manual
|
|
|
|
allow_failure: true
|
2021-03-15 08:22:23 +00:00
|
|
|
- when: on_success
|
2021-02-25 17:46:39 +00:00
|
|
|
|
|
|
|
script:
|
|
|
|
- bundle exec rake zammad:ci:refresh_envs
|