Aller au contenu

Drifts#

This section describe how to manage the pipelines used to monitor configurations drifts both on staging and prod lines.

Update configurations zones lists#

To create the pipelines, we use a CUE variable which list zones each configuration is applied on.

This variable is stored in : ci/zones_for_each_configuration.cue

To update the file, run the script ci/scripts/generate_cue_zones_by_configurations.sh

# load nix shell
nix-shell

# go to the script folder
cd ci/scripts/

# run the script
./generate_cue_zones_by_configuration.sh

# commit the change
cd ..

git add zones_for_each_configuration.cue
git commit -m "drifts: update zones_for_each_configuration (my_zone)"

Update concourse pipelines#

generate pipelines#

cd ci/contexts/ngot

# staging
cue export -t in_ci -t infra_zone=infra-stg -e 'pipelines["ngot-staging-alerts-by-configurations"].pipeline' >> pipeline-ngot-staging-alerts.json

# prod
cue export -t in_ci -t infra_zone=infra-prd -e 'pipelines["ngot-prod-alerts-by-configurations"].pipeline' >> pipeline-ngot-prod-alerts.json

Si au lancement de cette commande, vous avez un Killed

Étapes pour ajouter un fichier de swap temporaire#

sudo fallocate -l 20G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Vérification avec la commande: free -h

Retirer le swap temporaire#

sudo swapoff /swapfile
sudo rm /swapfile

apply pipeline#

# staging

fly switch -z infra-stg -n deploy
fly login
fly set-pipeline -c pipeline-ngot-staging-alerts.json -p ngot-staging-alerts-by-configurations

# prod

fly switch -z infra-prd -n deploy
fly login
fly set-pipeline -c pipeline-ngot-prod-alerts.json -p ngot-prod-alerts-by-configurations