Compare commits

...

8 commits

Author SHA1 Message Date
naskya 8e497b41cf
messed up 2024-05-06 18:44:28 +09:00
naskya bfdf73caeb
ci: fix permisson 2024-05-06 18:38:54 +09:00
naskya 5b18f9761c
ci: fix .git 2024-05-06 18:29:31 +09:00
naskya 641ff742bb
ci: add dependencies of sea-orm-cli 2024-05-06 18:26:50 +09:00
naskya e6121946aa
ci: another fix 2024-05-06 18:11:30 +09:00
naskya c6212ff8f4
ci: use CI_JOB_TOKEN 2024-05-06 18:06:56 +09:00
naskya d582a84c57
ci: install postgresql client 2024-05-06 17:58:26 +09:00
naskya a7978e2b08
ci: non-interactive shell option 2024-05-06 17:46:45 +09:00

View file

@ -29,8 +29,8 @@ variables:
default:
before_script:
- apk add build-base linux-headers curl ca-certificates python3 perl
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- apk add --update build-base linux-headers curl ca-certificates python3 perl postgresql-client
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
- . "${HOME}/.cargo/env"
- corepack enable
- corepack prepare pnpm@latest --activate
@ -43,11 +43,8 @@ auto_update:
script:
# setup git
- apk add git
- git config user.name "${GITLAB_USER_NAME}"
- git config user.email "${GITLAB_USER_EMAIL}"
- git remote set-url origin "${CI_MERGE_REQUEST_SOURCE_PROJECT_URL}"
- git fetch origin
- git switch "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
- git config user.name 'GitLab CI'
- git config user.email 'noreply@firefish.dev'
# update pnpm lockfile
- pnpm install
# commit
@ -55,7 +52,7 @@ auto_update:
if [ `git status -s | wc -l` -gt 0 ]; then
git add .
git commit --message 'chore: update lockfile'
git push --push-option=ci.skip origin "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
git push --push-option=ci.skip "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" "HEAD:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
fi
# run format
- pnpm run format
@ -64,9 +61,10 @@ auto_update:
if [ `git status -s | wc -l` -gt 0 ]; then
git add .
git commit --message 'chore: format'
git push --push-option=ci.skip origin "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
git push --push-option=ci.skip "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" "HEAD:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
fi
# update packages/backend-rs/src/model/entity
- apk install pkgconfig openssl openssl-dev libssl3
- cargo install sea-orm-cli
- pnpm --filter backend run build:debug
- pnpm run migrate
@ -96,7 +94,7 @@ auto_update:
if [ `git status -s | wc -l` -gt 0 ]; then
git add .
git commit --message 'chore (backend-rs): regenerate entity'
git push --push-option=ci.skip origin "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
git push --push-option=ci.skip "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" "HEAD:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
fi
# update packages/backend-rs/index.{js,d.ts}
- pnpm run build:debug
@ -107,5 +105,5 @@ auto_update:
if [ `git status -s | wc -l` -gt 0 ]; then
git add .
git commit --message 'chore (backend-rs): regenerate index'
git push --push-option=ci.skip origin "${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
git push --push-option=ci.skip "https://gitlab-ci-token:${CI_JOB_TOKEN}@firefish.dev/${CI_MERGE_REQUEST_SOURCE_PROJECT_PATH}" "HEAD:${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}"
fi