Skip to content

klovercloud-ci-cd/documentation

Repository files navigation

Installation guide:

Available versions:

Versions Kubernetes
v0.0.1-beta v1.22.2

Incase of minikube:

minikube start --kubernetes-version=<supported kubernetes version>

// For example minikube start --kubernetes-version=v1.22.2

Alternatively, By applying descriptors , platform can be installed. In that case, user must replace variables with appropriate value manually.

Getting started

This is the example, we are following. Fork this repository or create a repository following constraints (directory where pipeline file should exist).

Service account is attached with this pipeline. Service account contains two secrets; one for repository and one for registry.

Registry secret example:

apiVersion: v1
data:
  password: <your_registry_password>
  username: <your_registry_username>
kind: Secret
metadata:
  annotations:
    tekton.dev/docker-0: https://index.docker.io/
  name: image-sec
  namespace: tekton
type: kubernetes.io/basic-auth

Repository secret example:

apiVersion: v1
data:
  password: <your_repository_password>
  username: <your_repository_username>
kind: Secret
metadata:
  annotations:
    tekton.dev/git-0: https://github.com/
  name: repo-sec
  namespace: tekton
type: kubernetes.io/basic-auth

Service account example:

apiVersion: v1
kind: ServiceAccount
metadata:
  name: test-sa
  namespace: tekton
secrets:
  - name: image-sec
  - name: repo-sec

Install cli

Linux:

cd ~/
mkdir klovercloud
vi ~/.bashrc

Add the following line and save

export KCPATH=$HOME/klovercloud/
source ~/.bashrc

Windows:

Create klovercloud directory inside c drive

SET KCPATH=C:\klovercloud\

[N:B:] in case of windows please restart.

Prerequisites:

Cli to use klovercloud-ci apis!

Find more information at: https://github.com/klovercloud-ci-cd/ctl

Usage:
  cli [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  describe    Describe resource [company/repository/application]
  help        Help about any command
  list        List resources [company/repository/application/process]
  login       Login using email and password
  logout      Logout user from the cli
  logs        Get logs by process ID
  register    Register user
  trigger     Notify git
  update      Update resource [user/repository/application]

Flags:
  -h, --help      help for cli
  -v, --version   version for cli

Use "cli [command] --help" for more information about a command.

Login:

cli login -o apiserver={apiserver_url} -o security={security_url}
Enter email:
Enter Password:

Append Repository:

cli create -r file={file}

File Example:

{
  "repositories": [
    {
      "type": "GITHUB/BITBUCKET",
      "token": "your_repository_token"
    }
  ]
}

List Repository:

cli list -r

Output:

+-------------+------------+--------------------------------------+--------+
| API VERSION |    KIND    |                  ID                  |  TYPE  |
+-------------+------------+--------------------------------------+--------+
| api/v1      | Repository | 3dc74cf2-a6c3-43e2-b088-cefe1a79ac11 | GITHUB |
+-------------+------------+--------------------------------------+--------+

Optionally you can set default repository:

 cli set repo={repository_id}

[N:B:] If default repository is set, user don't need to provide repository id.

Append Application:

cli create -a file={file} repo={repository_id}

File Example:

{
     "applications": [
        {
            "_metadata": {
                "name": "test1"
            },
            "url": "https://github.com/klovercloud-ci-cd/test-app"
        }
    ]
}

List Application:

cli list -a repo={repository_id}

Output:

+-------------+-------------+--------------------------------------+-------+---------------------+------------------+------------------------------------------------------------+
| API VERSION |    KIND     |                  ID                  | NAME  |       LABELS        | ISWEBHOOKENABLED |                            URL                             |
+-------------+-------------+--------------------------------------+-------+---------------------+------------------+------------------------------------------------------------+
| api/v1      | Application | ec3fa8ac-1242-4812-819d-54ebb8203332 | test  | compId: 12345       | false            | https://github.com/klovercloud-ci-cd/testapp               |
|             |             |                                      |       | teamId: 90000093333 |                  |                                                            |
|             |             |                                      |       |                     |                  |                                                            |
+-------------+-------------+--------------------------------------+-------+---------------------+------------------+------------------------------------------------------------+

Pipeline will be triggered for every repository update of specific branches.

List process:

cli list -p repo={Repository_ID} app={Application_ID}

Logs:

cli logs processid={Process_ID}

Logout:

cli logout

Welcome to KloverCloud CI/CD. Please feel free to contribute.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages