[go: up one dir, main page]

Skip to content

Use composite identity credentials for convert_to_gitlab_ci graph

What does this MR do and why?

This MR add the option of using service account for the Duo Workflow action component. It sets it to true for the "Convert Jenkins to GitLab CI/CD" action.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. Configure GDK to work with Duo Workflow: https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/duo_workflow.md
  2. Enable the feature flag
Feature.enable(:duo_workflow_in_ci)
  1. In the Duo Workflow enabled project, create a file called Jenkinsfile, example content:
Example Jenkinsfile
pipeline {
    agent any

    stages {
        stage('Build') {
            steps {
                echo 'Building the application...'
                echo 'Compiling source code'
                echo 'Build completed successfully!'
                sh 'cat Jenkinsfile' // Display the content of the Jenkinsfile
                sh 'sleep 2' // Small delay to simulate work
            }
        }

        stage('Test') {
            steps {
                echo 'Running tests...'
                echo 'Unit tests passed'
                echo 'Integration tests passed'
                echo 'All tests completed successfully!'
                sh 'sleep 3' // Small delay to simulate work
            }
        }

        stage('Deploy') {
            steps {
                echo 'Deploying to staging environment...'
                echo 'Deployment in progress...'
                sh 'sleep 2' // Small delay to simulate work
                echo 'Application deployed successfully!'
            }
        }
    }

    post {
        success {
            echo 'Pipeline executed successfully!'
        }
        failure {
            echo 'Pipeline execution failed!'
        }
        always {
            echo 'This will always run, regardless of build status'
        }
    }
}
4. Open the just created file and verify the button "Convert to GitLab CI/CD" is present and in accordance with the screenshot.
  1. Click on the button, a pipeline should start if you have runners configured.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #549514 (closed)

Edited by Fred de Gier

Merge request reports

Loading