Cake.GitLabAPICI 0.1.5

A cake addin for running GitLab pipelines and jobs via the GitLab API

Install-Package Cake.GitLabAPICI -Version 0.1.5
dotnet add package Cake.GitLabAPICI --version 0.1.5
<PackageReference Include="Cake.GitLabAPICI" Version="0.1.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cake.GitLabAPICI --version 0.1.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Functions

This version of the addin contains two functions ExecuteGitLabPipeline and ExecuteGitLabJob. The functions call the GitLab API and intialise the pipeline or job. Then the API is polled while the job is pending until an outcome is obtained (e.g. success, failed, cancelled).

ExecuteGitLabPipeline

Parameters

GitLabUri - The base URI for the GitLab API (CI_API_V4_URL).
GitLabToken - The PRIVATE_TOKEN for the request header.
ProjectId - The integer project id of the repository for which you want to run the pipeline for.
Branch - The name of the branch you want to run the pipeline for.
TriggerToken - The pipeline trigger token. This must be added to the GitLab CICD settings for the repository you want to run the pipeline for in GitLab.

Example usage

var pipelineId = ExecuteGitLabPipeline(gitLabApiUri, gitLabJobToken, 123, "master", pipelineTriggerToken);

ExecuteGitLabJob

Parameters

GitLabUri - The base URI for the GitLab API (CI_API_V4_URL).
GitLabToken - The PRIVATE_TOKEN for the request header.
ProjectId - The integer project id of the repository for which you want to run the job for.
Branch - The name of the branch you want to run the pipeline for.
TriggerToken - The pipeline trigger token. This must be added to the GitLab CICD settings for the repository you want to run the job for in GitLab.
PipelineId - The id of the pipeline you want to run the job for (the return value of the ExecuteGitLabPipeline function).
JobName - The name of the job you want to run.

Example usage

ExecuteGitLabJob(gitLabApiUri, gitLabJobToken, 123, "master", pipelineTriggerToken, pipelineId, "myjob");

Functions

This version of the addin contains two functions ExecuteGitLabPipeline and ExecuteGitLabJob. The functions call the GitLab API and intialise the pipeline or job. Then the API is polled while the job is pending until an outcome is obtained (e.g. success, failed, cancelled).

ExecuteGitLabPipeline

Parameters

GitLabUri - The base URI for the GitLab API (CI_API_V4_URL).
GitLabToken - The PRIVATE_TOKEN for the request header.
ProjectId - The integer project id of the repository for which you want to run the pipeline for.
Branch - The name of the branch you want to run the pipeline for.
TriggerToken - The pipeline trigger token. This must be added to the GitLab CICD settings for the repository you want to run the pipeline for in GitLab.

Example usage

var pipelineId = ExecuteGitLabPipeline(gitLabApiUri, gitLabJobToken, 123, "master", pipelineTriggerToken);

ExecuteGitLabJob

Parameters

GitLabUri - The base URI for the GitLab API (CI_API_V4_URL).
GitLabToken - The PRIVATE_TOKEN for the request header.
ProjectId - The integer project id of the repository for which you want to run the job for.
Branch - The name of the branch you want to run the pipeline for.
TriggerToken - The pipeline trigger token. This must be added to the GitLab CICD settings for the repository you want to run the job for in GitLab.
PipelineId - The id of the pipeline you want to run the job for (the return value of the ExecuteGitLabPipeline function).
JobName - The name of the job you want to run.

Example usage

ExecuteGitLabJob(gitLabApiUri, gitLabJobToken, 123, "master", pipelineTriggerToken, pipelineId, "myjob");

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.1.5 1,418 8/29/2019
0.1.4 46 8/29/2019
0.1.3 42 8/29/2019
0.1.2 59 8/28/2019
0.1.1 58 8/27/2019
0.1.0 47 8/27/2019