# Artifact

The integrated artifacts like GitHub, GitLab, GitRepo, and Bitbucket can be used in multiple stages of the Pipelines. The integrated accounts can be used to automate triggers by providing access to artifacts which are used in the pipeline execution process.

## GitHub

GitHub is a platform and cloud based service for software development and version control using Git. Refer to [GitHub](https://docs.github.com/en/get-started/quickstart/hello-world) for more information.&#x20;

{% hint style="info" %}
To know how to add a GitHub Integration [ Refer to this page](https://docs.opsmx.com/user-guide/data-sources).&#x20;
{% endhint %}

**To Add GitHub Repo in the Pipeline Stages**

The following steps provide details on how to access your GitHub repo and use it in the pipeline stages.&#x20;

1. Create a pipeline by following the steps provided in [Create Pipelines](https://docs.opsmx.com/user-guide/manage-pipelines/create-a-pipeline).&#x20;
2. Click **Configure** and select the pipeline to which you want to add your GitHub repo.
3. Click **Automated Triggers** from the options provided on the left.

   <figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FkMLKE5urDIF3LrGyn7rh%2Fimage.png?alt=media&#x26;token=8d9736db-49cb-4652-a24b-14fff4690a4e" alt=""><figcaption></figcaption></figure>
4. Click **Add Trigger** and select Git from the Type dropdown.
5. Select **GitHub** from the **Repo Type** dropdown.
6. In the **Organization or User field**, enter the organization name or your GitHub repo username
7. In the **Project** field, enter your GitHub project name.
8. In the **Branch** field, enter the branch name in the given format.&#x20;

{% hint style="info" %}
If branch name is specified, it pushes to the branches that match this Java Regular Expression and only that branch is triggered. Leave the branch name empty to trigger builds for every branch.&#x20;
{% endhint %}

9. Enter the secret branch name (this is an optional field)

{% hint style="info" %}
If specified, it verifies GitHub as the sender of this trigger. See [GitHub docs](https://developer.github.com/webhooks/securing/) for more information.
{% endhint %}

10. In the **Artifact Constraints**, by default deploy is displayed. To add your artifact, from the dropdown select **Define a new artifact**. Artifacts are required for the trigger to execute. Only one of the artifacts needs to be present for the trigger to execute.&#x20;

    <figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FOR3DmVXEJNNfmHTRrBsX%2Fimage.png?alt=media&#x26;token=77aef108-4f05-4a02-8de3-41d6b4fc8414" alt=""><figcaption></figcaption></figure>
11. Enter a **Display Name** for the artifact.&#x20;
12. In the **Account** dropdown, select your account.
13. In the **File path** field enter the filepath of your github project that you want to integrate.
14. Check the **Use prior execution**, if you want to match against an artifact in the prior pipeline execution's context. This ensures that you will always be using the most recently supplied artifact to this pipeline, and is generally a safe choice.
15. Check the **Use default artifact** checkbox, if your artifact is not supplied from a trigger, or it wasn't found in a prior execution. See the [reference](https://www.spinnaker.io/reference/artifacts/in-pipelines) for more information.&#x20;
16. Click **Save Artifact** to save the changes.&#x20;
17. Check the **Trigger Enabled** checkbox to trigger this.
18. Click **Save Changes** to save the changes or **Revert** to discard the changes.&#x20;

Your GitHub repo is added in the pipeline stage and can be triggered from here.&#x20;

## GitLab&#x20;

GitLab is a DevOps software package which can develop, secure, and operate software. Refer to [GitLab](https://docs.gitlab.com/ee/) for more information.&#x20;

{% hint style="info" %}
To know how to add a GitLab Integration [ Refer to this page](https://docs.opsmx.com/user-guide/data-sources).&#x20;
{% endhint %}

**To Add GitLab in the Pipeline Stages**

The following steps provide details on how to access your GitLab repo and use it in the pipeline stages.&#x20;

1. Create a pipeline by following the steps provided in [Create Pipelines](https://docs.opsmx.com/user-guide/manage-pipelines/create-a-pipeline).&#x20;
2. Click **Configure** and select the pipeline to which you want to add your GitLab repo.
3. Click **Automated Triggers** from the options provided on the left.
4. Click **Add Trigger** and select **Git** from the Type dropdown.

   <figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2Fsb0Bl6RxdExDhwejpDrG%2Fimage.png?alt=media&#x26;token=9bc95d1d-3989-4d45-b836-3a075ab62d6f" alt=""><figcaption></figcaption></figure>
5. Select **GitLab** from the **Repo Type** dropdown.
6. In the **Organization or User field**, enter the organization name or your GitLab repo username
7. In the **Project** field, enter your GitLab project name.
8. In the **Branch** field, enter the branch name in the given format.&#x20;

{% hint style="info" %}
If branch name is specified, it pushes to the branches that match this Java Regular Expression and only that branch is triggered. Leave the branch name empty to trigger builds for every branch.&#x20;
{% endhint %}

9. Enter the secret branch name (this is an optional field)
10. In the **Artifact Constraints**, by default deploy is displayed. To add your artifact, from the dropdown select **Define a new artifact**. Artifacts are required for the trigger to execute. Only one of the artifacts needs to be present for the trigger to execute.&#x20;

    <figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FOR3DmVXEJNNfmHTRrBsX%2Fimage.png?alt=media&#x26;token=77aef108-4f05-4a02-8de3-41d6b4fc8414" alt=""><figcaption></figcaption></figure>
11. Enter a **Display Name** for the artifact.&#x20;
12. In the **Account** dropdown, select your account.
13. In the **File path** field enter the filepath of your gitlab project that you want to integrate.
14. Check the **Use prior execution**, if you want to match against an artifact in the prior pipeline execution's context. This ensures that you will always be using the most recently supplied artifact to this pipeline, and is generally a safe choice.
15. Check the **Use default artifact** checkbox, if your artifact is not supplied from a trigger, or it wasn't found in a prior execution. See the [reference](https://www.spinnaker.io/reference/artifacts/in-pipelines) for more information.&#x20;
16. Click **Save Artifact** to save the changes.&#x20;
17. Check the **Trigger Enabled** checkbox to trigger this.
18. Click **Save Changes** to save the changes or **Revert** to discard the changes.&#x20;

Your GitLab repo is added in the pipeline stage and can be triggered from here. <br>

## Bitbucket&#x20;

Bitbucket cloud is a Git-based code and CI/CD tool optimized for teams using Jira. Refer to [Bitbucket](https://bitbucket.org/product/guides/getting-started/overview#a-brief-overview-of-bitbucket) for more information.&#x20;

{% hint style="info" %}
To know how to add a Bitbucket Integration [ Refer to this page](https://docs.opsmx.com/user-guide/data-sources).&#x20;
{% endhint %}

**To Add Bitbucket in the Pipeline Stages**

The following steps provide details on how to access your GitLab repo and use it in the pipeline stages.&#x20;

1. Create a pipeline by following the steps provided in [Create Pipelines](https://docs.opsmx.com/user-guide/manage-pipelines/create-a-pipeline).&#x20;
2. Click **Configure** and select the pipeline to which you want to add your BitBucket repo.
3. Click **Automated Triggers** from the options provided on the left.
4. Click **Add Trigger** and select **Git** from the Type dropdown.

   <figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FvOFIzsgBQodN0va0cOlR%2Fimage.png?alt=media&#x26;token=af3f2c0e-39d4-45de-a2ac-fd3e184dd3e4" alt=""><figcaption></figcaption></figure>
5. Select **BitBucket** from the **Repo Type** dropdown.
6. In the **Team or User field,** enter the team or user name.&#x20;
7. In the **Branch** field, enter the branch name in the given format.&#x20;

{% hint style="info" %}
If branch name is specified, it pushes to the branches that match this Java Regular Expression and only that branch is triggered. Leave the branch name empty to trigger builds for every branch.&#x20;
{% endhint %}

9. Enter the secret branch name (this is an optional field)
10. In the **Artifact Constraints**, by default deploy is displayed. To add your artifact, from the dropdown select **Define a new artifact**. Artifacts are required for the trigger to execute. Only one of the artifacts needs to be present for the trigger to execute.&#x20;

    <figure><img src="https://2047464521-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MBEa1hoX6SqpDj-ymNs%2Fuploads%2FOR3DmVXEJNNfmHTRrBsX%2Fimage.png?alt=media&#x26;token=77aef108-4f05-4a02-8de3-41d6b4fc8414" alt=""><figcaption></figcaption></figure>
11. Enter a **Display Name** for the artifact.&#x20;
12. In the **Account** dropdown, select your account.
13. In the **File path** field enter the filepath of your bitbucket project that you want to integrate.
14. Check the **Use prior execution**, if you want to match against an artifact in the prior pipeline execution's context. This ensures that you will always be using the most recently supplied artifact to this pipeline, and is generally a safe choice.
15. Check the **Use default artifact** checkbox, if your artifact is not supplied from a trigger, or it wasn't found in a prior execution. See the [reference](https://www.spinnaker.io/reference/artifacts/in-pipelines) for more information.&#x20;
16. Click **Save Artifact** to save the changes.&#x20;
17. Check the **Trigger Enabled** checkbox to trigger this.
18. Click **Save Changes** to save the changes or **Revert** to discard the changes.&#x20;

Your Bitbucket account is added in the pipeline stage and can be triggered from here.
