From c13cb2394273449d21c1e2f82e0fa83647ff4028 Mon Sep 17 00:00:00 2001 From: Maidul Islam Date: Sun, 5 Feb 2023 19:21:07 -0800 Subject: [PATCH] Add gitlab integ docs --- docs/integrations/cicd/gitlab.mdx | 34 +++++++++++++++++++++++++++++++ docs/mint.json | 1 + 2 files changed, 35 insertions(+) create mode 100644 docs/integrations/cicd/gitlab.mdx diff --git a/docs/integrations/cicd/gitlab.mdx b/docs/integrations/cicd/gitlab.mdx new file mode 100644 index 000000000..b84d90e07 --- /dev/null +++ b/docs/integrations/cicd/gitlab.mdx @@ -0,0 +1,34 @@ +--- +title: "Gitlab Pipeline" +--- + +To integrate Infisical secrets into your Gitlab CI/CD setup, three steps are required. + +## Generate service token +To expose Infisical secrets in Gitlab CI/CD, you must generate a service token for the specific project and environment in Infisical. For instructions on how to generate a service token, refer to [this page](../../getting-started/dashboard/token) + +## Set Infisical service token in Gitlab +To provide Infisical CLI with the service token generated in the previous step, go to **Settings > CI/CD > Variables** in Gitlab and create a new **INFISICAL_TOKEN** variable. Enter the generated service token as its value. + +## Configure Infisical in your pipeline +Edit your .gitlab-ci.yml to include the installation of the Infisical CLI. This will allow you to use the CLI for fetching and injecting secrets into any script or command within your Gitlab CI/CD process. + +#### Example +```yaml +image: ubuntu + +stages: + - build + - test + - deploy + +build-job: + stage: build + script: + - apt update && apt install -y curl + - curl -1sLf 'https://dl.cloudsmith.io/public/infisical/infisical-cli/setup.deb.sh' | bash + - apt-get update && apt-get install -y infisical + - infisical run -- npm run build + +... +``` \ No newline at end of file diff --git a/docs/mint.json b/docs/mint.json index 441769152..fd334b5ab 100644 --- a/docs/mint.json +++ b/docs/mint.json @@ -227,6 +227,7 @@ "group": "CI/CD", "pages": [ "integrations/cicd/githubactions", + "integrations/cicd/gitlab", "integrations/cicd/circleci" ] },