Skip to content

Latest commit

 

History

History
91 lines (55 loc) · 2.78 KB

build.md

File metadata and controls

91 lines (55 loc) · 2.78 KB

Build Step

  • Click on Add Stage to get started with the pipeline creation
  • Select the type of stage as Build

Screenshot 2022-09-09 at 10 53 12 AM

  • Configure the Stage Settings as below
    • Name: build test and run
    • Make sure to turn on clone codebase.

configure_the_stage_setting

Setup the Connector as follows

Select Connectors -> Click on + New Connector

Connector Type: Github

Screenshot 2022-09-09 at 10 55 35 AM

Name: python-sample-connector

URL Type : Repository

Connection Type: HTTP

GitHub Repository URL: Paste the link of your forked repository

Username: (Your Github Username)

Personal Access Token: Check out how to create personal access token

Secret Name: Git-Token

Secret Value: PAT value generated in Github

Click on Save.

This will allow the repository to be fetched click on it and click Apply Selected

Make Enable API access (ON) with the secret token created

Click on Connect through Harness Platform.

To develop more understanding on Connectors check out the docs here

Go the Infrastructure settings of stage and click on Hosted by Harness.

Then go to Execution (In this step we are going to compile the code)

infrastructure_setting(build_test_and_run)

Code Compilation

  • Click on Add step

  • Go to Build and click on Run

  • Change the settings as following

  • Name: Code compile

  • Container Registry -> Choose New connector

    • Click on Docker Registry
    • Change the settings as following
      • Overview
        • Name- docker quickstart
      • Details
        • Docker registry url - https://index.docker.io/v1/
        • Provider type - Docker Hub
        • Authentication - Username and Password
        • Username - Docker hub username
        • Secret Token - Check out how to create docker PAT
      • Connect to Provider
        • Choose to connect through the Harness Platform
        • It will take sometime to verify your credentials.
  • Image: python:3.10.6-alpine

  • Shell: Sh

  • Command: python -m compileall ./

  • Then click Apply changes

Code_Compilation_CI

Next we are going to create Image and Push the image to docker registry

Click on Create Image and Push to Docker Registry