2024-05-09 15:20:55 +00:00
|
|
|
stages:
|
|
|
|
- "test"
|
|
|
|
- "deploy"
|
2024-01-08 21:18:15 +00:00
|
|
|
.apk-add: &apk-add
|
2024-01-11 20:24:51 +00:00
|
|
|
- "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"
|
2024-01-11 20:18:58 +00:00
|
|
|
- ".bundle"
|
2024-05-02 18:49:20 +00:00
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- "Gemfile.lock"
|
2024-01-08 21:30:22 +00:00
|
|
|
.cache-node: &cache-node
|
|
|
|
- paths:
|
|
|
|
- "node_modules"
|
2024-05-02 18:49:20 +00:00
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- "yarn.lock"
|
2024-01-08 21:30:22 +00:00
|
|
|
.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"
|
2024-01-08 18:26:19 +00:00
|
|
|
HAINISH: ""
|
2023-04-15 15:23:43 +00:00
|
|
|
cache:
|
2024-05-09 15:18:25 +00:00
|
|
|
push:
|
2024-05-09 15:20:55 +00:00
|
|
|
stage: "test"
|
2024-05-09 15:18:25 +00:00
|
|
|
only:
|
|
|
|
- "rails"
|
|
|
|
except:
|
|
|
|
- "schedules"
|
|
|
|
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_CI_PUSH_TOKEN:${GITLAB_CI_PUSH_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git\""
|
|
|
|
script:
|
|
|
|
- "git commit --allow-empty -m \"ci: test [skip ci]\""
|
|
|
|
- "git push -o ci.skip origin HEAD:${CI_COMMIT_BRANCH}"
|
2023-04-15 15:23:43 +00:00
|
|
|
assets:
|
2024-01-08 21:00:52 +00:00
|
|
|
stage: "deploy"
|
2024-01-08 21:55:49 +00:00
|
|
|
only:
|
|
|
|
- "rails"
|
2024-05-02 19:34:41 +00:00
|
|
|
- "production.panel.sutty.nl"
|
|
|
|
- "panel.sutty.nl"
|
2024-05-15 18:46:03 +00:00
|
|
|
- "panel.testing.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:
|
2024-05-02 19:18:34 +00:00
|
|
|
- *apk-add
|
2024-01-11 20:24:51 +00:00
|
|
|
- "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}\""
|
2024-05-09 15:03:38 +00:00
|
|
|
- "git remote set-url --push origin \"https://GITLAB_CI_PUSH_TOKEN:${GITLAB_CI_PUSH_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git\""
|
2024-01-11 20:24:51 +00:00
|
|
|
- "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"
|
2024-01-08 21:15:36 +00:00
|
|
|
- *disable-hainish
|
2024-01-11 20:24:51 +00:00
|
|
|
- "gitlab_ci_log_section --name apk --end"
|
2023-04-15 15:23:43 +00:00
|
|
|
script:
|
2024-01-11 20:24:51 +00:00
|
|
|
- "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]\""
|
2024-05-02 19:34:54 +00:00
|
|
|
- "git push -o ci.skip origin HEAD:${CI_COMMIT_BRANCH}"
|
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-12 20:44:26 +00:00
|
|
|
- "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:
|
2024-01-12 20:44:26 +00:00
|
|
|
- "go-task haml-lint"
|