Skip to content

Commit

Permalink
Merge pull request #140 from Ouest-France/podman
Browse files Browse the repository at this point in the history
ajout option envsubst
  • Loading branch information
mxmorin authored Nov 4, 2024
2 parents cf57a20 + 53776da commit 3ecaace
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 6 additions & 4 deletions cdpcli/clidriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
[--with-carto] [--carto-repo=<repo:branch>]
[--conftest-repo=<repo:dir:branch>] [--no-conftest] [--conftest-namespaces=<namespaces>]
[--docker-image-kubectl=<image_name_kubectl>] [--docker-image-helm=<image_name_helm>] [--docker-image-aws=<image_name_aws>] [--docker-image-conftest=<image_name_conftest>]
[--volume-from=<host_type>]
[--volume-from=<host_type>] [--envsubst]
cdp conftest [(-v | --verbose | -q | --quiet)] (--deploy-spec-dir=<dir>)
[--conftest-repo=<gitlab repo>] [--no-conftest] [--volume-from=<host_type>] [--conftest-namespaces=<namespaces>] [--docker-image-conftest=<image_name_conftest>]
cdp validator-server [(-v | --verbose | -q | --quiet)] [(-d | --dry-run)] [--sleep=<seconds>]
Expand Down Expand Up @@ -86,6 +86,7 @@
--deploy=<type> 'release' or 'snapshot' - Maven command to deploy artifact.
--docker-image-maven=<image_name_maven> Docker image which execute mvn command [default: maven:3.5.3-jdk-8].
--docker-build-target=<target_name> Specify target in multi stage build
--envsubst Substitute env vars in resources templates. BE CAREFUL : Command line is size limited
--goals=<goals-opts> Goals and args to pass maven command.
--helm-version=<version> Major version of Helm. [default: 3]
--helm-migration=<true|false> Do helm 2 to Helm 3 migration
Expand Down Expand Up @@ -1211,7 +1212,8 @@ def add_env_vars(self, values_cdp):
return values_cdp

def envsubst_values(self, dir):
tmp_chart_dir = "/tmp"
valuesFile = "all_resources.yaml"
self._cmd.run('/usr/bin/envsubst "$(printf \'${%%s} \' $(env | cut -d\'=\' -f1))" < %s/%s > %s/%s.new && mv %s/%s.new %s/%s' %
if self._context.opt['--envsubst']:
tmp_chart_dir = "/tmp"
valuesFile = "all_resources.yaml"
self._cmd.run('/usr/bin/envsubst "$(printf \'${%%s} \' $(env | cut -d\'=\' -f1))" < %s/%s > %s/%s.new && mv %s/%s.new %s/%s' %
(dir, valuesFile, tmp_chart_dir, valuesFile,tmp_chart_dir, valuesFile, dir, valuesFile), no_test = True)
6 changes: 3 additions & 3 deletions scripts/uninstall_pending_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ if [ "$RELEASE" == "" -o "$NAMESPACE" == "" ]; then
usage
fi

RELEASEV3=$(helm3 list -n ${NAMESPACE} --pending -f "^${RELEASE}$" | grep "pending-install")
RELEASEV3=$(helm3 list -n ${NAMESPACE} --pending -f "^${RELEASE}$" | grep "pending-")
if [ $? -eq 0 ]; then
echo "La release est en cours d'installation ..."
echo "Suppression de la release ..."
echo "La release ${RELEASE} est en cours d'installation ..."
echo "Suppression de la release ${RELEASE} ..."
helm3 uninstall $RELEASE -n ${NAMESPACE}
fi

0 comments on commit 3ecaace

Please sign in to comment.