diff --git a/README.md b/README.md index 4d3eef7..cdcbfae 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,10 @@ The Okteto namespace to use. If not specified it will use the namespace specifie Log level used. Supported values are: `debug`, `info`, `warn`, `error`. (defaults to warn) +### `destroy-volumes` + +Set to `true` to destroy the persistent volumes created by the development environment (defaults to `false`). + # Example usage This example runs the login action, activates a namespace, and triggers the Okteto pipeline and deletes it diff --git a/action.yml b/action.yml index 59a4de7..0fa59ad 100644 --- a/action.yml +++ b/action.yml @@ -10,6 +10,10 @@ inputs: log-level: description: "Log level string. Valid options are debug, info, warn, error" required: false + destroy-volumes: + description: "Set to true to destroy the persistent volumes created by the development environment" + required: false + default: 'false' runs: using: "docker" image: "Dockerfile" @@ -17,6 +21,7 @@ runs: - ${{ inputs.name }} - ${{ inputs.namespace }} - ${{ inputs.log-level }} + - ${{ inputs.destroy-volumes }} branding: color: 'green' - icon: 'settings' \ No newline at end of file + icon: 'settings' diff --git a/entrypoint.sh b/entrypoint.sh index 41f935b..1fa570e 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,6 +4,7 @@ set -e name=$1 namespace=$2 log_level=$3 +destroy_volumes=$4 params="" if [ ! -z $namespace ]; then @@ -26,6 +27,9 @@ if [ "${RUNNER_DEBUG}" = "1" ]; then log_level="--log-level debug" fi +if [ "$destroy_volumes" = "true" ]; then + volume_flag="-v" +fi -echo running: okteto pipeline destroy $log_level --name "${name}" ${params} --wait -okteto pipeline destroy $log_level --name "${name}" ${params} --wait +echo running: okteto pipeline destroy $log_level --name "${name}" ${params} $volume_flag --wait +okteto pipeline destroy $log_level --name "${name}" ${params} $volume_flag --wait