This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

(VM Deployment) Adding Build/Deployment

    The user can create a new build pipeline in an already created DevOps Console project, build the source, create an image, and deploy it to a VM server (VM Deployment) through the following procedure.

    The VM server group/VM server added through Adding VM Server Group/VM Server (Option) will be used in Setting up Deploy to VM Stage.

    Starting to Add Build/Deployment

    To start adding build/deployment, follow the procedure below.

    1. Click the Project card on the Main page. It will move to the Project Dashboard page.

    Adding Code Repository (Option)

    Notice
    Proceed only if a new code repository is needed.

    To add a code repository, follow the procedure below.

    1. Code Repository page, click the Add Code Repository button in the top right corner. It will move to the Add Code Repository page.
    2. On the Add Code Repository page, enter/set each item.
    3. Click the Connection Test button.
    4. Click the Save button.
    ItemDescription
    Repository TypeSelect the repository to use
    • Registered Tool: You can select and use the types of SCM Repository tools available to the user (Github, Gitlab, etc.).
    • DevOps Code: Available if you have applied for DevOps Code use in the Samsung Cloud Platform Console.
    • Unregistered Tool: You can use it by entering the domain of an unregistered tool. The unregistered tool item only appears when the App template is Environment Only (without source code).
    New/Existing UsageSelect Create New Repository or Use Existing Repository
    Repository InformationEnter repository information
    • When creating a new repository, the URL is composed of the project group name/project name.
    Authentication InformationEnter authentication information.
    Repository InformationEnter repository information
    • You can use a code repository that is not registered as a tool in the DevOps Console.
    • An additional URL check process is required.
    Table. Add Code Repository Input Items

    Adding Image Repository (Option)

    Notice
    Proceed only if a new image repository is needed.

    To add an image repository, follow the procedure below.

    App. Adding Image Repository

    1. Image Repository page, click the App Image Repository Addition button in the top right. Move to the App Image Repository Addition page.
    2. On the App Image Repository Addition page, enter/settings for each item.
    3. Click the Connection Test button.
    4. Click the Save button.
    ItemDescription
    Repository Type SelectionSelect the image repository type.
    If you want to use an image repository not registered in Devops Console, select the Image Registry type.
    Repository Creation SelectionChoose whether to create a new repository or use an existing one.
    • If you selected Docker hub or Image Registry type earlier, you can only select Use Existing Repository.
    Registered ToolEnter repository information.
    Unregistered ToolEnter repository information
    • You can register an image repository that has not been registered as a tool in DevOps Console.
    • Click the URL Check button to proceed with the verification process.
    • You can only select Use Existing Repository.
    Table. App Image Repository Addition Input Items

    Adding Pull-only Image Repository

    1. Image Repository page, click the Add Pull-only Image Repository button at the top right. It moves to the Add Pull-only Image Repository page.
    2. On the Add Pull-only Image Repository page, enter/set each item.
    3. Click the Connection Test button.
    4. Click the Save button.

    Adding Artifact Repository (Option)

    Notice

    Proceed only if a new artifact repository is needed.

    If used as a rollback artifact repository, only Nexus with raw(hosted) repository type is available.

    To add an artifact repository, follow these steps:

    1. Artifact Repository page, click the Add Artifact Repository button in the top right corner. It will move to the Add Artifact Repository page.
    2. On the Add Artifact Repository page, enter/set each item.
    3. Click the Connection Test button.
    4. Click the Save button.
    ItemDescription
    Repository Creation OptionSelect whether to create a new repository or use an existing one.
    Basic Information InputEnter Base URL, select repository type, and enter repository/authentication information.
    Table. Input Items for Adding an Artifact Repository

    Adding VM Server Group/VM Server (Option)

    Notice
    Proceed only if a new VM server group/VM server is needed.

    To add a VM server group, follow these steps:

    1. Main page, click the Management icon at the top right. Move to the Tenant Dashboard page.
    2. Click the Deployment Target > VM Server Group menu from the left menu. Move to the VM Server Group page.
    3. On the VM Server Group page, click the Add button. Move to the Add VM Server Group page.
    4. Enter the basic information and click the Save button to complete the VM server group settings.
    ItemDescription
    Server Group NameEnter the name of the VM server group.
    DescriptionEnter a description.
    TypeSelect the type of VM server group
    • SSH: Deployment is performed through SSH commands during VM deployment.
    • Agent: Deployment is performed using an agent during VM deployment. (Agent Connection)
    VM Server
    • Add: Add the VM server to be included in the VM server group.
    • Delete: Check the checkbox of the VM server to be deleted from the VM server group and click Delete to delete it.
    Table. Input Items for Adding a VM Server Group

    Adding VM Server

    To add a VM server, you need Manager permissions for the corresponding VM server group.

    Note
    The VM server addition popup window may open differently depending on the type of VM server group.

    To add a VM server, follow these steps:

    1. Click the Manage icon in the top right corner of the Main page. You will be taken to the Tenant Dashboard page.
    2. Click the Deployment Target > VM Server Group menu from the left menu. You will be taken to the VM Server Group page.
    3. Click the VM server group where you want to add the VM server from the VM server group list on the VM Server Group page. You will be taken to the VM Server Group Details page.
    4. Click the Add button on the VM Server Group Details page. You will be taken to the Add VM Server page.
    5. Enter the basic information on the Add VM Server page and click the Add button to complete the VM server settings.
    ItemDescription
    Server NameEnter the name of the VM server.
    DescriptionEnter a description.
    IPEnter the IP address.
    SSH PortEnter the port of the VM server to use for SSH connection.
    OSEnter the operating system.
    LocationSelect a location.
    Authentication InformationEnter the authentication information of the VM server to use for SSH connection.
    Secret KeyThis is a secret key to authenticate the VM server where the agent is installed.
    Table. Input Items for Adding a VM Server

    Adding Build Pipeline

    To add a build pipeline, follow the procedure below.

    1. Main page, click the Project card. Move to the Project Dashboard page.
    2. Click the Build/Deployment > Build Pipeline menu in the left menu. Move to the Build Pipeline page.
    3. On the Build Pipeline page, click the Add Pipeline button at the top right. Move to the Add Pipeline page.
    4. Enter/set each item on the Add Pipeline page.
    5. Click the Next button.
    ItemDescription
    ClassificationSelect development or operation classification
    Jenkins URLSelect Jenkins to add a build pipeline from the list.
    Build AgentSelect the agent (build environment) where the build pipeline will run.
    Click the Info icon to view the list of tools provided by the agent.
    Build Environment OSDisplays the OS information of the environment where the build agent runs.
    Folder TypeSelect the folder type.
    • Existing folder: Add a pipeline under an existing folder in Jenkins.
    • New folder: Create a new folder in Jenkins and add a pipeline under it.
    FolderSelect a folder from the list or enter the name of the new folder to be created.
    Pipeline NameEnter the pipeline name.
    Parameter SettingSet the parameters to be used in the pipeline.
    Environment Variable SettingSet the environment variables to be used in the pipeline.
    Stage SettingSet the stages to be used in the pipeline.
    Build Result Email Recipient SettingSet the recipient to receive the result email after the pipeline is completed (success/failure).
    Table. Build Pipeline Addition Setting Items

    Setting up Parameters

    To set parameters to use when running a pipeline, follow these steps:

    1. Parameters card should be clicked.
    2. Add button should be clicked to add parameters.
    3. Apply button should be clicked to complete parameter settings.

    Setting up Environment Variables

    To set environment variables to be used in the pipeline, follow the procedure below.

    1. Environment Variables section, click. The Environment Variable Registration page opens on the right.
    2. A list of pre-registered Environment Variables appears, and select the checkbox of the environment variable to be used.
    3. Check the Selected Environment Variables and click the Apply button to complete the environment variable setting.

    Setting up Build Result Email Recipients

    To set up the recipient to receive the build result by email, follow the procedure below.

    1. Email Recipient area, click. The Add Email Recipient page opens on the right.
    2. In the Search area, search for and add the recipient.
    3. Click the Apply button to complete the email recipient setting.

    Setting up Additional Stages

    Setting up Checkout Stage

    To add a Checkout stage, follow these steps:

    1. Click the New Stage area. The Stage Settings page opens on the right.
    2. On the Stage Settings page, select Checkout as the Stage Type.
    3. Enter the information and click the Apply button. (You can select the code repository added in Adding a Code Repository (Option) from the URL.)
    ItemDescription
    URLSelect the code repository to perform checkout.
    Branch NameEnter the branch name to checkout.
    Table. Checkout Stage Input Items

    Setting up Build Stage

    To add a Build stage, follow these steps:

    1. Click the plus icon to add a new stage.
    2. Click the new stage area. The Stage Settings page opens on the right.
    3. On the Stage Settings page, select Build as the Stage Type.
    4. On the Stage Settings page, enter the information and click the Apply button.
    ItemDescription
    LanguageSelect the programming language used by the application.
    Build ToolSelect the Build tool used for application building.
    Provides default Shell commands based on the selected Build tool.
    Shell CommandEnter the command to use for application building.
    All commands available in the Shell can be used.
    Table. Build Stage Input Items

    Setting up Docker Build Stage

    To add a Docker Build stage, follow these steps:

    1. Plus icon을 클릭하여 새로운 스테이지를 추가하세요.
    2. New Stage 영역을 클릭하세요. Stage Settings 페이지가 오른쪽에 열립니다.
    3. Stage Type으로 Docker Build를 선택하세요.
    4. 정보 입력 후 Apply 버튼을 클릭하세요. (Registry URL에서 Adding Image Repository (Option)에서 추가한 이미지 저장소를 선택할 수 있습니다.)
    Item
    DescriptionExample
    Registry URL (docker push)Select the image repository where the completed Docker build result image will be pushed.
    IDID value of the account to be used in the image repository
    Image Tag PatternThe Docker image tag will be automatically generated based on the selected pattern.
    • {YYYYMMDD}: year, month, day
    • {HHMMSS}: hour, minute, second
    • {BUILD_NUM}: current build pipeline execution number
    • {YYYYMMDD}.{HHMMSS}: 20200414.150938
    • {YYYYMMDD}.{BUILD_NUM}: 20220414.13
    Add Base Image RepositoryThe Add Base Image Repository popup window will open.
    Registry URL (docker pull)If the image repository providing the base image (Dockerfile’s FROM clause, docker pull) used in the Dockerfile and the image repository of the Registry URL (docker push) are different, select the image repository for docker pull.
    Image Build ToolDisplays the image build tool.
    Pre-build CommandIf there are commands that must be executed before building the Docker image, write them in Shell command format.cp target/*.jar docker/
    Image Build FolderIf the Docker image build needs to be executed in a specific folder, select the checkbox and enter the folder path.docker
    DockerfileEnter the Dockerfile file name.Dockerfile
    Image Build OptionsIf additional options are required for the image build tool, enter them.--no-cache
    Build CommandDisplays the actual image build command to be executed.
    Post-build CommandIf there are commands that must be executed after building the Docker image, write them in Shell command format.rm -rf docker/*.jar
    Table. Docker Build Stage Input Items

    Setting up Deploy to VM Stage

    To add the Deploy to VM stage, follow the procedure below.

    1. Click the + icon to add a new stage.
    2. Click the New Stage area. The Stage Setting page will open on the right.
    3. On the Stage Setting page, select Deploy to VM as the Stage Type.
    4. Enter information on the Stage Setting page and click the Apply button.
    ItemDescription
    Deployment ConfigurationSelect the deployment configuration method
    • Deployment target setting (using SSH command/Agent): Deploy using SSH command or Agent.
    • Direct script writing: Users directly input all commands for deployment.
    Deployment GroupSelect the deployment group
    Deployment InformationContents saved in the deployment group are automatically set.
    Manual DeploymentSelect the default value for manual deployment
    • Please select the default setting value for manual deployment-related parameters when running the pipeline.
    Table. Deploy to VM Stage Input Items

    Checking the Final Pipeline Script

    1. Check the actual build pipeline script to be created. Modify the script directly if necessary.
    2. Click the Complete button to complete adding the pipeline.

    Result of Adding Pipeline

    Note
    The added pipeline will not be executed automatically. If execution is required, run the pipeline directly.