Skip to content

Latest commit

 

History

History
43 lines (28 loc) · 1.48 KB

README.md

File metadata and controls

43 lines (28 loc) · 1.48 KB

simple-ci-pipeline-runner

Demo

This project is a exercise to understand Pipeline pattern using Channels. Pipeline has 3 stages - Clone - Test - Build

  • Clone: In this stage the URL of the repository that is to be cloned as passed as argument, The repository is cloned with a random file name in the current working directory.

  • Test: This stage is a optional , The current working directory is switched to the cloned project directory , The directory name is passed downstream through context. And the configured command for the tests is run.

  • Build: In this stage the command configured for build is run and this marks the end of the pipeline

  • The possible arguments that a task can take is given in the below struct

    type TaskArgs struct {
        RepositoryURL string `json:"repository_url,omitempty"`
        Command       string `json:"command,omitempty"`
    }
  • Below is the Pipeline object
type Pipeline struct {
	Tasks map[TaskStage]TaskArgs
	Err   *Error
}

Note

This is not production ready , This code directly runs on the host machine which is serious security issue and there are multiple features missing and flaws are there , This is just a way to put the pipeline pattern into action.

Additional Links

Repo used to run the pipeline

Pipeline pattern reading