Manage schema with GitLab CI/CD
To integrate your FSL workflow with GitLab CI/CD, create a .gitlab-ci.yml
file and add the following code:
# Define the stages in the pipeline
stages:
- build
- test
- deploy
# Job definitions
build_job:
stage: build
image : node:18
script:
- npm install
- npm install -g fauna-shell
only:
- main
test_job:
stage: test
image : node:18
script:
- fauna schema push --force --secret $FAUNA_SECRET_KEY
- npm test
- fauna schema push --dir=./cleanup/ --force --secret $FAUNA_SECRET_KEY
only:
- main
variables:
FAUNA_SECRET_KEY: $FAUNA_SECRET_KEY
Make sure you set FAUNA_SECRET_KEY
and FAUNA_SHELL_SECRET_KEY
as CI/CD
variables in your GitLab project settings.
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!