This repository has been archived on 2024-10-01. You can view files and clone it, but cannot push or open issues or pull requests.
badhouseplants-net-old/scripts/deploy-app.pl
2023-04-25 10:05:52 +02:00

27 lines
1.1 KiB
Perl
Executable File

#! /usr/bin/perl
use strict;
use warnings;
my $chart_version = `cat chart/Chart.yaml | yq '.version'` or die;
chomp($chart_version);
my $git_branch = `git rev-parse --abbrev-ref HEAD`;
chomp($git_branch);
my $git_commit_sha = `git rev-parse HEAD`;
chomp($git_commit_sha);
my $main_branch = "main";
print
print $chart_version;
# - kubectl get -f ./kube/applicationset.yaml -o yaml > /tmp/appset.yaml
# - yq -i "del(.metadata.resourceVersion)" /tmp/appset.yaml
# - yq -i "del(.metadata.generation)" /tmp/appset.yaml
# - yq -i "del(.metadata.uid)" /tmp/appset.yaml
# - yq -i "del(.status)" /tmp/appset.yaml
# - yq -i "del(.spec.generators[].list.elements[] | select(.branch == \"$ARGO_APP_BRANCH\"))" /tmp/appset.yaml
# - yq -i "del(.spec.generators[].list.elements[] | select(.commit_sha == \"$ARGO_APP_IMAGE_TAG\"))" /tmp/appset.yaml
# - yq -i '. *= load("./kube/applicationset.yaml")' /tmp/appset.yaml
# - envsubst < ./kube/main.yaml > /tmp/elements.yaml
# - yq -i '.spec.generators[].list.elements += load("/tmp/elements.yaml")' /tmp/appset.yaml
# - kubectl apply -f /tmp/appset.yaml
#