5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-28 14:16:22 +00:00
panel/.gitlab-ci.yml

100 lines
2 KiB
YAML
Raw Permalink Normal View History

2024-01-08 21:18:15 +00:00
.apk-add: &apk-add
- "apk add go-task diffutils"
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:
- "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\""
2024-01-08 21:18:15 +00:00
- "apk add brotli"
- *apk-add
2024-01-08 21:15:36 +00:00
- *disable-hainish
2023-04-15 15:23:43 +00:00
script:
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:
- "go-task 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:
- "go-task haml-lint"