bit-pipe-deploy
v0.0.58
Published
Scripts for building and uploading images. It's used as a cli tool for bitbucket-pipelines. The `bpd` script requires a configuration file, which contains addresses to the cluster and registry address. The script generates a `build.sh` file which is execu
Downloads
12
Readme
Bitbucket Pipelines Deployment Scripts
Scripts for building and uploading images. It's used as a cli tool for bitbucket-pipelines.
The bpd
script requires a configuration file, which contains addresses to the cluster and registry address. The script generates a build.sh
file which is executed afterwards directly from the pipeline. The output from buils.sh
generates a changes.json
file. This file contains the image address to the uploaded image. Ths file is commited via git to the deployment repository. The changes.json
file is then read by the bpp
(bit-pipe-publish) script which updates the kubernetes workloads.
pipelines:
branches:
development:
- step:
name: Build API
image: lmaftuleac/bpd:0.0.55
services:
- docker
script:
- bpd --app=api
- bash build.sh
install
npm install bit-pipe-deploy --global
config.bpd.json
structure:
{
"deployment" : {
"repository":"[email protected]:opentechdev/deploy-v2.git"
},
"branch" : {
"master": {
...
},
"development": {
...
}
}
}
branch configuration accepts two kinds of confguration
- single project repository
- monorepo repository
single project config:
"master": {
"registryAddress": "europe-west6-etc",
"registryName": "opentech-projid/opentech",
"registryAccessKey" : "$GKE_CREDENTIALS",
"imagePrefix" : "rejection",
"cluster": "opentech-gcloud",
"namespace": "default",
"workload" : "website",
"dockerfile": "Dockerfile"
}
monorepo config:
"master": {
"registryAddress": "europe-west6-etc",
"registryName": "opentech-projectid/opentech",
"registryAccessKey" : "$GKE_CREDENTIALS",
"imagePrefix" : "google-scraper",
"cluster": "opentech-gcloud",
"namespace": "default",
"monorepo": {
"apps": [
{
"name" : "api",
"dir": "apps/api",
"dockerfile": "docker/api.dockerfile",
"workload": "api"
},
{
"name" : "api",
"dir": "apps/client",
"dockerfile": "docker/client.dockerfile",
"workload": "client"
}
]
}
}