Blog of zasdaym

YAML processing with yq

Nowadays many configurations are done via YAML format. GitLab CI, GitHub Actions, Hugo, Docker compose, and of course Kubernetes. A YAML processor like yq will be useful when working with tools like kubectl that can output YAML. Basic features For examples in basic features section, we use a file deployment.yaml with the following content: apiVersion: v1 kind: Deployment metadata: name: hello-world spec: template: spec: containers: - name: hello image: hello:v0.0.1 - name: world image: world:v0....

July 27, 2021

Bash script tips

For some small tasks, sometimes Bash script (shell script in general) is better than a full-blown program using programming languages. Here are some personal tips to write a Bash script: Exit on fail Use set -o errexit to make the script exit when it fails. If some commands are allowed to fail, command1 || echo "command1 is failed, but continuing" can be used. Prevent access to undeclared variables Use set -o nounset to exit when the script tries to use undeclared variables....

July 20, 2021

Γειά σου Κόσμε!

Γειά σου Κόσμε!

June 27, 2021