> For the complete documentation index, see [llms.txt](https://cocktailcloud.gitbook.io/cocktail-cloud-online-en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cocktailcloud.gitbook.io/cocktail-cloud-online-en/ci-cd/pipeline.md).

# Setting up a Pipeline

## 1. Setting up a Pipeline <a href="#id-1" id="id-1"></a>

### 1-1. Creating a Pipeline

1\) To create a pipeline, click on the '+ Create Pipeline' button located in the top right corner of the \[CI/CD] - \[Pipeline] tab.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FeuFPCBv2OdurW68vCYzC%2Fimage.png?alt=media&amp;token=c4c85ce0-edcd-4678-b65d-7a53487ccf74" alt=""><figcaption><p>[Screen] Initial Pipeline Creation Screen</p></figcaption></figure>

2\) After entering the pipeline creation information, click the 'Save' button located in the top right corner.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FGMGRgK1LSIxS3TcPO7ZW%2Fimage.png?alt=media&amp;token=a8527912-dd22-4c8a-b8da-3cc5fb01fa2e" alt=""><figcaption><p>[Screen] Pipeline Creation Information Input Screen</p></figcaption></figure>

<table><thead><tr><th width="176">Item (* is required)</th><th>content</th></tr></thead><tbody><tr><td>Name*</td><td>Enter the pipeline name to create</td></tr><tr><td>Version*</td><td>Input the version for the pipeline</td></tr><tr><td>Service Map*</td><td>Select the service map to execute the pipeline</td></tr></tbody></table>

3\) Click the "Add Resource" button in the deployment resources section to apply the items you want to configure for the pipeline.

{% hint style="info" %}

* Workloads need to be created by default
  {% endhint %}

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2Fpau4lEMZz8t73QRvNX8N%2Fimage.png?alt=media&amp;token=27afa6d0-230e-46f6-a140-d307fa6ba183" alt=""><figcaption><p>[Screen] Add Deployment Resources to the Pipeline</p></figcaption></figure>

4\) After selecting the workload to add from the workload section, click the "Save" button

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2Fq3lpwCQLZAlHj2W7TRgQ%2Fimage.png?alt=media&amp;token=458a9b5f-a1bd-4667-a62b-bd65b70636bb" alt=""><figcaption><p>[Screen] Select Workload in Add Deployment Resources</p></figcaption></figure>

5\) Once the workload is registered, confirm that the container images registered with the workload are automatically added.

{% hint style="warning" %}

* Only images built using the image build feature in Cocktail are integrated
  {% endhint %}

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FHUmXdmHYRy2njk3QYi4x%2Fimage.png?alt=media&amp;token=bff741da-cb31-45aa-8479-5bbc7589cd35" alt=""><figcaption><p>[Screen] Registering Workload for Pipeline</p></figcaption></figure>

6\) After selecting the service to add from the service exposure section, click the "Save" button.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FOHoem2zmkSKGQ14ZtDro%2Fimage.png?alt=media&amp;token=f12eed9b-f68d-47c1-ba7f-dd978c17c75e" alt=""><figcaption><p>[Screen] Selecting Service Exposure in Add Deployment Resources</p></figcaption></figure>

7\) After selecting the Ingress to add from the Ingress section, click the "Save" button.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2F34Icv8Nls6MreSlcRkH2%2Fimage.png?alt=media&amp;token=300a19a1-db4f-413a-be8a-ce216a5fcce8" alt=""><figcaption><p>[Screen] Selecting Ingress in Add Deployment Resources</p></figcaption></figure>

8\) After completing the registration of all resources, click the "Run" button located in the top right corner.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2F2GJWKBdwzZ2SxUAbRdR6%2Fimage.png?alt=media&amp;token=8f373aa6-effd-496a-be30-ed98531e691c" alt=""><figcaption><p>[Screen] Screen after registering all resources for the pipeline</p></figcaption></figure>

9\) When the \[run popup] appears, enter the content for the execution note regarding this pipeline version, then click the "Save" button.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2F3xXk4VPPTUMatUB553qq%2Fimage.png?alt=media&amp;token=493b801b-e98b-4e9f-9992-a4ccf802260b" alt=""><figcaption><p>[Screen] Inputting Pipeline Execution Notes</p></figcaption></figure>

10\) Once the pipeline execution is complete, the release version will be indicated correctly in the top left corner.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FnCDr5n9RARcwgjtWjPEN%2F%EC%8A%A4%ED%81%AC%EB%A6%B0%EC%83%B7%202024-01-30%20161244.png?alt=media&amp;token=77951c9d-16d3-49c0-81f4-9851bca7c1c9" alt=""><figcaption><p>[Screen] Screen after Pipeline Execution Completion</p></figcaption></figure>

## 2. Modify Pipeline <a href="#id-2" id="id-2"></a>

{% hint style="danger" %}

* When modifying each workload, service exposure, and Ingress in the \[Service Map] tab, changes are not reflected in the pipeline. You need to make modifications directly in the pipeline.
* Modifying the pipeline ensures that each workload and deployment resource is updated to the latest version
  {% endhint %}

1\) Select the pipeline name that needs modification in the \[Pipeline] tab.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FZ6wlpks0087B23EdQGVF%2Fimage.png?alt=media&amp;token=608a57d8-bfab-43bf-adc1-f236520cefa6" alt=""><figcaption><p>[Screen] Pipeline List</p></figcaption></figure>

2\) Click the "Create Pipeline Version" button in the top right corner of the pipeline, enter the version, and then click "Create".

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FvK3UkbvhikKrR4yh8ysS%2Fimage.png?alt=media&amp;token=b6fb8bba-0eb1-4127-862e-de388d07198b" alt=""><figcaption><p>[Screen] Pipeline Version Creation</p></figcaption></figure>

### 2-1. If there are changes in the source requiring rebuilding of images <a href="#id-2-1" id="id-2-1"></a>

1\) Activate the "Build Run" button on the right side of the \[Image Build] section, then click "Run".

{% hint style="info" %}

* The image build is re-executed and immediately reflected in the workload
  {% endhint %}

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FcZ04SXvqEm4YGbQoJIv1%2F%EC%8A%A4%ED%81%AC%EB%A6%B0%EC%83%B7%202024-01-30%20161452.png?alt=media&amp;token=a536f180-b07f-46b3-98db-180e0a15a903" alt=""><figcaption><p>[Screen] Screen with Build Execution Enabled and in Progress</p></figcaption></figure>

2\) The image is rebuilt, and you can check the progress of each step in the process.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2Fk72TemmOSpdGLGp0nlFi%2Fimage.png?alt=media&amp;token=b9f0a6a6-8c35-445f-b564-b311e948a087" alt=""><figcaption><p>[Screen] Image Build Process</p></figcaption></figure>

3\) When the image is rebuilt through the pipeline, verify that the image name in the workload is updated to the tag of the image built through the pipeline.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FC2ZCQsbtPn1ah0ihdlE5%2F%EC%8A%A4%ED%81%AC%EB%A6%B0%EC%83%B7%202024-01-30%20161933.png?alt=media&amp;token=f88d4aad-2f70-4802-88db-448689cbb366" alt=""><figcaption><p>[Screen] Confirmation of Image Tag Change</p></figcaption></figure>

### 2-2. If there are changes to the workload, such as replicas or other configurations <a href="#id-2-2.-replicas" id="id-2-2.-replicas"></a>

{% hint style="info" %}

* Deactivate the "Build Run" button on the right side of the \[Image Build] section (no image changes required)
  {% endhint %}

1\) Select the workload name in the \[Deployment Resources] section.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FcdF0Olbqpl6vdj7o98HB%2F%EB%B9%8C%EB%93%9C%EC%8B%A4%ED%96%89%20%EB%B9%84%ED%99%9C%EC%84%B1%ED%99%94.png?alt=media&amp;token=92483306-f692-4c58-b545-bab56e925e01" alt=""><figcaption><p>[Screen] Screen with Build Execution Disabled</p></figcaption></figure>

2\) Make the necessary modifications by selecting the relevant parts, then click the "Save" button in the top right corner.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FhJ0PhhSC1z2qM8EQsnlX%2Fimage.png?alt=media&amp;token=de831523-1e39-4617-9ccd-de81071c83dd" alt=""><figcaption><p>[Screen] Workload Configuration Change Screen</p></figcaption></figure>

3\) After confirming the change in replicas from 1 to 2 in the workload, click the "Close" button in the top right corner.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2Fj0CXS4davkY7ZXfE31oK%2F%EC%8A%A4%ED%81%AC%EB%A6%B0%EC%83%B7%202024-01-30%20162418.png?alt=media&amp;token=0c2c54d8-3de4-4443-a6ba-555d06c91f27" alt=""><figcaption><p>[Screen] Information after Workload Configuration Change</p></figcaption></figure>

4\) Once you return to the pipeline modification section, click the "Run" button in the top right corner, and enter the changes in the execution note."

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FELHA9QqGOZsevNG733j8%2Fimage.png?alt=media&amp;token=09c325e5-3d70-4bbc-ae62-8d54a39d421d" alt=""><figcaption><p>[Screen] Screen after Clicking the "Run" Button</p></figcaption></figure>

5\) In the pipeline's \[Deployment Status] tab, verify that there are two pods running.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FodO6wtGDBCtSsyufQ1QP%2Fimage.png?alt=media&amp;token=1d5f9fbc-9993-4ba2-8b12-9d772d872c0a" alt=""><figcaption><p>[Screen] Pipeline Deployment Status</p></figcaption></figure>

## 3. Pipeline Rollback <a href="#id-3" id="id-3"></a>

{% hint style="info" %}

* If you need to rollback to a previous configuration while continuously registering versions through the pipeline.
  {% endhint %}

1\) Select the pipeline name that needs modification in the \[Pipeline] tab. Once changes are made in the modification section, click the "Rollback" button in the top right corner.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FjuhRVqtA4Yd375Dbycu9%2Fimage.png?alt=media&amp;token=4c2772d0-6575-4ea6-81d5-f5d8c4bbdf1a" alt=""><figcaption><p>[Screen] Pipeline Configuration Screen</p></figcaption></figure>

2\) When the \[Rollback Popup] window appears, review the execution notes of the versions created so far, select the desired version, then click the "Save" button.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FQQkViPuO6wt8xfTUX63C%2Fimage.png?alt=media&amp;token=ee39b0c8-68d3-45f0-b946-ec8868ecfb57" alt=""><figcaption><p>[Screen] Popup window with Execution Notes after Clicking Rollback</p></figcaption></figure>

3\) Once the rollback is completed successfully, confirm that the modified version has been changed to the rollback target (e.g., V3 -> V2)

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2Fg131LakgGEIeEUtVSgEI%2F%EC%8A%A4%ED%81%AC%EB%A6%B0%EC%83%B7%202024-01-30%20162931.png?alt=media&amp;token=6b944288-4112-4d2e-865d-be2063493288" alt=""><figcaption><p>[Screen] Confirmation of Rollback Version Change</p></figcaption></figure>

4\) Verify that the pod count has returned to normal, such as 2 -> 1.

<figure><img src="https://4196990571-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FL5As9l8R3RbLkQd6XsfL%2Fuploads%2FPUd6goeligirB5Ht1OgS%2Fimage.png?alt=media&amp;token=25735f53-5e9e-4122-b0a7-ed07dbdefcf2" alt=""><figcaption><p>[Screen] Pipeline Deployment Status</p></figcaption></figure>
