panel/.gitlab-ci.yml

105 lines
2.4 KiB
YAML
Raw Normal View History

2024-01-08 21:18:15 +00:00
.apk-add: &apk-add
- "apk add go-task diffutils gitlab_ci_log_section"
2024-01-08 21:15:36 +00:00
.disable-hainish: &disable-hainish
2024-01-08 21:32:33 +00:00
- "rm -f .env.development"
2024-01-08 21:30:22 +00:00
.cache-ruby: &cache-ruby
- paths:
- "vendor/ruby"
- ".bundle"
2024-01-08 21:30:22 +00:00
.cache-node: &cache-node
- paths:
- "node_modules"
.cache-task: &cache-task
- paths:
- ".task"
2024-01-11 14:22:13 +00:00
image: "registry.0xacab.org/sutty/sutty:3.17.3-3.1.4-rails"
2023-04-15 15:23:43 +00:00
variables:
RAILS_ENV: "production"
LC_ALL: "C.UTF-8"
HAINISH: ""
2023-04-15 15:23:43 +00:00
cache:
assets:
2024-01-08 21:00:52 +00:00
stage: "deploy"
2024-01-08 21:55:49 +00:00
only:
- "rails"
- "17.3.alpine.panel.sutty.nl"
2024-01-12 13:25:58 +00:00
except:
- "schedules"
2024-01-08 21:30:22 +00:00
cache:
- *cache-ruby
- *cache-node
- *cache-task
2023-04-15 15:23:43 +00:00
before_script:
- "gitlab_ci_log_section --name git --header=\"Configuring git\""
2023-04-15 15:23:43 +00:00
- "git config --global user.email \"${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}\""
- "git config --global user.name \"${GIT_USER_NAME:-$GITLAB_USER_NAME}\""
- "git remote set-url --push origin \"https://${GITLAB_USERNAME}:${GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git\""
- "gitlab_ci_log_section --name git --end"
- "gitlab_ci_log_section --name apk --header=\"Installing dependencies\""
2024-01-08 21:18:15 +00:00
- "apk add brotli"
- *apk-add
2024-01-08 21:15:36 +00:00
- *disable-hainish
- "gitlab_ci_log_section --name apk --end"
2023-04-15 15:23:43 +00:00
script:
- "gitlab_ci_log_section --name assets --header=\"Building\""
2024-01-08 18:07:59 +00:00
- "go-task assets"
2023-04-15 15:23:43 +00:00
after_script:
- "git add public && git commit -m \"ci: assets [skip ci]\""
- "git push -o ci.skip"
2024-01-08 20:36:39 +00:00
gem-audit:
2024-01-08 20:59:27 +00:00
stage: "test"
2024-01-08 21:55:49 +00:00
only:
- "schedules"
2024-01-08 21:30:22 +00:00
cache:
- *cache-ruby
2024-01-08 20:36:39 +00:00
before_script:
2024-01-08 21:18:15 +00:00
- *apk-add
2024-01-08 21:15:36 +00:00
- *disable-hainish
2024-01-08 20:36:39 +00:00
script:
- "go-task gem-audit"
node-audit:
2024-01-08 20:59:27 +00:00
stage: "test"
2024-01-08 21:55:49 +00:00
only:
- "schedules"
2024-01-08 21:30:22 +00:00
cache:
- *cache-node
2024-01-08 21:15:36 +00:00
before_script:
2024-01-08 21:18:15 +00:00
- *apk-add
2024-01-08 21:15:36 +00:00
- *disable-hainish
2024-01-08 20:36:39 +00:00
script:
2024-01-08 20:52:00 +00:00
- "apk add go-task"
2024-01-08 20:36:39 +00:00
- "go-task node-audit"
2024-01-08 20:52:00 +00:00
brakeman:
2024-01-08 20:59:27 +00:00
stage: "test"
2024-01-08 21:30:22 +00:00
cache:
- *cache-ruby
2024-01-08 20:52:00 +00:00
rules:
2024-01-08 21:15:36 +00:00
- if: "$CI_PIPELINE_SOURCE == 'merge_request_event'"
2024-01-08 20:52:00 +00:00
before_script:
2024-01-08 21:18:15 +00:00
- *apk-add
2024-01-08 21:15:36 +00:00
- *disable-hainish
2024-01-08 20:52:00 +00:00
script:
- "go-task bundle -- exec brakeman"
rubocop:
2024-01-08 20:59:27 +00:00
stage: "test"
2024-01-08 21:30:22 +00:00
cache:
- *cache-ruby
2024-01-08 20:52:00 +00:00
rules:
2024-01-08 21:15:36 +00:00
- if: "$CI_PIPELINE_SOURCE == 'merge_request_event'"
2024-01-08 20:52:00 +00:00
before_script:
2024-01-08 21:18:15 +00:00
- *apk-add
2024-01-08 21:15:36 +00:00
- *disable-hainish
2024-01-08 20:52:00 +00:00
script:
2024-01-08 21:43:12 +00:00
- "./bin/modified_files | ./bin/with_extension rb | xargs -r go-task bundle -- exec rubocop"
2024-01-08 20:52:00 +00:00
haml:
2024-01-08 20:59:27 +00:00
stage: "test"
2024-01-08 21:30:22 +00:00
cache:
- *cache-ruby
2024-01-08 20:52:00 +00:00
rules:
2024-01-08 21:15:36 +00:00
- if: "$CI_PIPELINE_SOURCE == 'merge_request_event'"
2024-01-08 20:52:00 +00:00
before_script:
2024-01-08 21:18:15 +00:00
- *apk-add
2024-01-08 21:15:36 +00:00
- *disable-hainish
2024-01-08 20:52:00 +00:00
script:
2024-01-08 21:43:12 +00:00
- "./bin/modified_files | ./bin/with_extension haml | xargs -r go-task bundle -- exec haml-lint"