Skip to main content
Version: 3.21

GitLab CI/CD

GitLab CI/CD is a tool built into GitLab platform for software development through the continuous methodologies:

  1. Continuous Integration (CI);

  2. Continuous Delivery (CD);

  3. Continuous Deployment (CD);

Continuous Integration works by pushing small code chunks to your application's codebase hosted in a Git repository, and to every push, run a pipeline of scripts to build, test, and validate the code changes before merging them into the main branch.

Continuous Delivery and Deployment consist of a step further CI, deploying your application to production at every push to the default branch of the repository.

These methodologies allow you to catch bugs and errors early in the development cycle, ensuring that all the code deployed to production complies with the code standards you established for your app.

How GitLab integration works

Installing GitLab plugin

info

Ask our support team for to receive the senhasegura GitLab plugin download link.

To install the senhasegura GitLab plugin, follow these steps:

  1. Access a project in your GitLab account;

  2. Add the binary and senhasegura-mapping.json file into the project repository;

    info

    The senhasegura-mapping.json file can be used to report the senhasegura DSM which variables should be faced as secret.

  3. Edit the .gitlab-ci.yml file in your project folder;

  4. At the before_script section, add the following code:

    chmod +x senhasegura`\newline` ./senhasegura ${APP} ${SYSTEM} ${ENVIRONMENT}`\newline` source .runb.vars`\newline` rm .runb.vars 
  5. Save the config file;

  6. Access the senhasegura menu Settings ➔ CI/CD ➔ Variables;

  7. Register the variables APP, ENVIRONMENT e SYSTEM;

    GitLab variables
    info

    The variables APP, ENVIRONMENT and SYSTEM will be used to identify and report to senhasegura DSM , what is the application and in which environment and system it will be running.

  8. Execute the GitLab pipeline to finish;

Secret injection in GitLab pipelines

After installing the plugin in the project, follow the steps to inject the secrets into your pipeline:

  1. Access the senhasegura menu CI/CD ➔ Pipelines;

  2. Click at Run Pipeline button;

  3. Into the next step, click at Run Pipeline;

  4. Then click at Deploy button to display the execution result;

Plugin senhasegura GitLab output