codefresh-contrib / rollout_step_monitor

Step to monitor a Rollout Step in a Codefresh's GitOps Runtime

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rollout Step Monitor

Step to monitor a Rollout Step in a Codefresh's GitOps Runtime

Development

  • To activate venv
python3 -m venv venv --clear
source venv/bin/activate
  • Download all dependencies
pip install --upgrade pip
pip install -r requirements.txt
  • Update list of requirements:
pip freeze > requirements.txt

Running it

Create a variables.env file with the following content:

ENDPOINT=https://g.codefresh.io/2.0/api/graphql
CF_API_KEY=XYZ
RUNTIME=<the_runtime_name>
NAMESPACE=<the_namespace>
APPLICATION=<the_app_name>
ROLLOUT=<the_rollout_name>
COMMIT_SHA=<the_commit_sha_of_the_release>
STEP_INDEX=<step_index_starting_from_zero>
  • Running in shell:
export $( cat variables.env | xargs ) && python monitor_rollout_step.py
  • Running as a container:
export image_name="`yq .name service.yaml`"
export image_tag="`yq .version service.yaml`"
export registry="franciscocodefresh" ## Docker Hub
docker build -t ${image_name} .
docker run --rm --env-file variables.env ${image_name}
  • Pushing the image:
docker tag ${image_name} ${registry}/${image_name}:${image_tag}
docker push ${registry}/${image_name}:${image_tag}

About

Step to monitor a Rollout Step in a Codefresh's GitOps Runtime

License:MIT License


Languages

Language:Python 96.9%Language:Dockerfile 3.1%