CLI that provides functions to simplify interactions with containerized platforms and tools
npm install @ibmgaragecloud/cloud-native-toolkit-cliCommand-line tool to simplify activities related to working with cloud environments.
To install the latest version of igc into /usr/local/bin, run the following:
``shell`
curl -sL https://cli.cloudnativetoolkit.dev/install.sh | sh
If you would like to install a different version of the CLI and/or put it in a different directory, use the following:
`shell`
curl -sL https://cli.cloudnativetoolkit.dev/install.sh | RELEASE=1.32.0 DEST_DIR=~/bin sh
Install the latest CLI by running:
``
npm i -g @ibmgaragecloud/cloud-native-toolkit-cli
Note: If you had previously installed the cli from @garagecatalyst, you will need to remove it first:
``
npm rm -g @garage-catalyst/ibm-garage-cloud-cli
Release candidate commands are made available for early use and testing via the beta release
of the CLI. The beta release of the CLI can be installed by running:
``
npm i -g @ibmgaragecloud/cloud-native-toolkit-cli@beta
To return to the non-beta version of the cli, simply run:
``
npm i -g @ibmgaragecloud/cloud-native-toolkit-cli
Run the following to list the available commands:
``
igc --help
Lists the vlans for a particular resource group and region. The commandibmcloud login
expects that an has already been performed to set up the
environment.
Opens the Developer Dashboard in the default browser. The namespace where the dashboard has been
deployed can be provided with the -n flag. If not provided, tools will be used as the default.
If a default browser has not been configured then the url to the Dashboard will be printed out.
Example usage
`bash`
igc dashboard
Prints the urls and credentials for the Cloud Native Toolkit tools deployed into the cluster. The
command works by reading particular ConfigMaps and Secrets in a template namespace in the cluster-n
that identify the tools. The template namespace is provided by using the flag. If not provided,tools
the template namespace defaults to . The tools reported include Jenkins, SonarQube, ArgoCD, etc.
The command expect that the cluster login has already been performed.
Example usage
`bash`
igc credentials -n my-namespace
- lists the tools urls and credentials from the my-namespace namespace
Lists the ingress and/or route urls for the provided namespace. The namespace is provided
with the -n flag. If no namespace is provided, dev is used as the default. The results areExit
provided in an interactive menu. If one of the endpoints is selected it will display the url and
launch it in the default browser. Selecting will display the full list and exit.
The command expect that the cluster login has already been performed.
Example usage
`bash`
igc endpoint -n tools
- lists the ingresses and routes in the tools namespace
Creates a namespace (if it doesn't exist) and prepares it for use by copying in
pull secrets from the default namespace and config maps and secrets from the
template namespace (defaults to tools if not provided). The template namespace-t
can be provided with the flag. When run against OpenShift, this command willproject
actually create a which will result in the creation of a namespace as well.
The namespace command will also add the pull secrets to a serviceAccount. The name-z
of the service account can be provided with the flag. If not provided then default
will be used.
Optionally, the namespace command can also set up the Jenkins environment and/or Tekton
environment through the use of the --jenkins flag and --tekton flag. When provided,--jenkins
the flag will install Jenkins into the namespace (only available on OpenShift)--tekton
and set up the Jenkins serviceAccount. The flag will copy the available Taskstools
and Pipelines from the template namespace (defaults to if not provided).
The command expect that the cluster login has already been performed.
Example usage
`bash`
igc namespace my-namespace
- Creates the namespace my-namespace and updates the default service account in
that namespace
`bash`
igc namespace another-namespace -z my-sa --jenkins
- Creates the namespace another-namespace and the service account my-sa as
well as configuring the Jenkins environment
`bash`
igc namespace last-namespace -t my-tools --tekton
- Creates the namespace last-namespace and updates the default service accountmy-tools
as well as configuring the Tekton Tasks and Pipelines using as the template
namespace
Registers a project as a Jenkins or Tekton pipeline by creating a Secret to hold
the Git authentication information, calling the Jenkins API or applying the appropriate
configuration yaml, creating a web-hook to trigger the pipeline when changes are pushed,
and triggering the initial build.
Note: This command is intended to be run within the repository directory of a project for
which a pipeline should be generated.
By default the pipeline deploys into the dev namespace. The namespace can be changed by passing-n
it in using the flag. If the target namespace does not exist, the command will fail with aigc namepace
message to create the namespace using
The pipeline command supports either jenkins or tekton pipelines using the flags:
- --jenkins or
- --tekton
A default pipeline type has not been set. If neither of the flags is provided then a prompt will
be shown to select one.
The command will prompt for the username and personal access token that should stored in
the secret to access the Git repository. Those values can be provided a the command-line using the
-u and -p flags, respectively.
Example usage
`bash`
igc pipeline --jenkins
- Creates a Jenkins pipeline in the dev namespace and will prompt for the git credentials.
`bash`
igc pipeline -n my-dev -u gituser -p gitpat --tekton
- Creates a Tekton pipeline in the existing my-dev namespace and uses gituser and gitpat
for the git credentials
Configures a tool into the template namespace. The template namespace is provided with the -ntools
argument. If not provided, the template namespace will be . The tool-config takes the
name of the tool as the first (and only) positional parameter.
Configuration for the tool
can be provided with the --url, --username, and --password optional flags. If the urlusername
is provided then a ConfigMap will be created. If the and/or password are provided
then a Secret will be created,
Example usage
`bash`
igc tool-config my-tool --url https://url.com/my-tool --username admin --password password
- configures a tool named my-tool with url https://url.com/my-tool, username of admin, andpassword
password of
"Enables" an existing project with the DevOps artifacts. The CLI reads the
list of
available pipelines and applies the selected pipeline to your code repo. This
command is
intended to be run within a git repository directory of a project for
which a pipeline should be enabled.
`bash`
igc enable
Once the project has been enabled you will need to run igc pipeline to
register the git repo as a pipeline with your target development cluster.
The enable command adds a number of files to the local filesystem, including but not limited to:
- Helm chart
- Jenkinsfile
After enable is called, the generated files should be committed and pushed to the git repository.
The default pipeline repo is https://cloud-native-toolkit.github.io/garage-pipelines/, but a different one can be used by providing the --repo argument. The source for the provided pipeline repo can be found at https://github.com/ibm-garage-cloud/garage-pipelines to use as a template.
`bash`
npm test
`bash`
npm start
`bash``
npm run igc