A set of utilities to help with gitlab-ci Pipelines.
- The top level of a project has either build.sbt or a pom.xml
- Gitlab has the following variables set:
- DOCKER_REGISTRY
- DOCKER_REGISTRY_USER
- DOCKER_REGISTRY_PASS
- DOCKER_NAMESPACE
- NEXUS_HOST
- NEXUS_USER
- NEXUS_PASS
- KUBE_CONFIG
- builder_image_update
- Installs: apt-transport-https, Python, jq, yq, kubectl
- builder_image_install_sbt
- Installs sbt and sets up
$HOME/.sbt/.credentials
- Installs sbt and sets up
- builder_image_install_docker
- Installs Docker client and calls
builder_image_docker_registry_login
- Installs Docker client and calls
- builder_image_docker_registry_login
- Logs in to private Docker Registry
- project_get_variable
- Takes a project variable name (ie. project.name) and calls
project_get_sbt_variable
orproject_get_mvn_variable
.
- Takes a project variable name (ie. project.name) and calls
- project_get_sbt_variable
- Takes a project variable name (ie. project.name) and gets its value from build.sbt.
- project_get_mvn_variable
- Takes a project variable name (ie. project.name) and gets its value from pom.xml
- docker_image_build
- Takes a Dockerfile and a K8s Deployment file and builds an image.
- Assumes that the first image mentioned in K8s deployment spec is the intended image name.
- Takes a Dockerfile and a K8s Deployment file and builds an image.
- docker_image_push
- Takes a K8s Deployment file and pushes the docker image to the private docker registry.
- Assumes that the first image mentioned in K8s deployment spec is the intended image name.
- Takes a K8s Deployment file and pushes the docker image to the private docker registry.
- kube_resource_prep
- Takes a K8s deployment file, replaces all Shell env variables with their respective values
- kube_apply_and_wait
- Takes a K8s deployment file, calls
kube_apply
andkube_deployment_wait
- Takes a K8s deployment file, calls
- kube_apply
- Takes a K8s deployment file and runs kubectl apply
- kube_deployment_wait
- Takes a K8s deployment file and waits for 5 minutes or until all pods have been updated.
- If Not all pods are running and available, exit with failure.