The scripts contained here allow you to build an image of a new or existing connector, and deploy that image into your Kubernetes cluster on your CP4S environment. The are also options for deploying an existing image from a Docker registry and for building an image locally so that you may publish it to a registry of your choice.
The following needs to be installed on your local machine:
- Python 3
- Docker
- OpenShift CLI (
oc
) - Kubernetes CLI (
kubectl
) - OpenSSL (
openssl
)
-
Open a terminal
-
CD into
deployment
folder of this project:cd ./deployment/
-
Log into your CP4S cluster:
cloudctl login -a <ICP CLUSTER URL> -u <USERNAME> -p <PASSWORD> -n <NAMESPACE>
-
Optionally, log in to custom registry for build scenario "B"
-
Run build and/or deployment scripts using the following arguments:
./build.sh <MODE*> <CONNECTOR_NAME*> [-t <IMAGE_TAG>] [-v <CONNECTOR_VERSION>] [-r <REMOTE_REGISTRY>] [-n <NAMESPACE>] [-d]
Argument Required Description Example MODE Required Values: "local" - the docker image will be built but not pushed, or "remote": the image is pushed to remote registry CONNECTOR_NAME Required the name of the connector and the connector source folder. -t
MAGE_TAGOptional the container image tag, default "Test". -v
CONNECTOR_VERSIONOptional the connector release version, default "1.0.0.0". -r
REMOTE_REGISTRYOptional a custom registry url (including repository path if necessary, excluding IMAGE:TAG). Used only in MODE
being "remote".docker.io/cp4s-connectors
,sec-isc-team-isc-icp-docker-local.artifactory.swg-devops.com
-n
NAMESPACEOptional the namespace of the CP4S. If not specified, the current namespace of the logged in cluster will be used. Used only in MODE
being "remote".DEPLOY FLAG -d
Optional If added, the deploy.sh
script will be executed at the end of the build, providedMODE
being "remote"../build.sh remote <CONNECTOR_NAME> [-t <IMAGE_TAG>] [-v <CONNECTOR_VERSION>] [-n <NAMESPACE>] [-d]
(Ex:
./build.sh remote azure -d -n cp4s
) (Ex:./build.sh remote azure -t Test -v="1.9.0.0"
)./build.sh remote <CONNECTOR_NAME> [-t <IMAGE_TAG>] [-v <CONNECTOR_VERSION>] [-r <REMOTE_REGISTRY>] [-n <NAMESPACE>] [-d]
(Ex:
./build.sh aws remote -r docker.io/cp4s-connectors -t="Dev_0.1.2" -v "1.9.0.0" -d
)./build.sh local <CONNECTOR_NAME> [<IMAGE_TAG>] [<CONNECTOR_VERSION>]
(Ex:
./build.sh local aws
) (Ex:./build.sh local aws -t Test -v="1.9.0.0"
)./deploy.sh <CONNECTOR_NAME*> <REGISTRY_IMAGE_PATH*> <CONNECTOR_VERSION*> [<NAMESPACE>]
(Ex:
./deploy.sh aws "image-registry.openshift-image-registry.svc:5000/cp4s/isc-car-connector-atp:Test" 1.9.0.0 -n cp4s
)Argument Required Description Example CONNECTOR_NAME Required The name of the connector and the connector source folder. REGISTRY_IMAGE_PATH Required Image full path (including registry domain, repository path and IMAGE:TAG) sec-isc-team-isc-icp-docker-local.artifactory.swg-devops.com/cp4s/isc-car-connector-aws:1.8.0.0_1.2.0
CONNECTOR_VERSION Required The connector release version "1.0.0.0" -n
NAMESPACEOptional The namespace of the CP4S. If not specified, the current namespace of the logged in cluster will be used.