Skip to content

Commit

Permalink
Merge pull request #71 from thetribeio/feat/keep-releases-and-clean-f…
Browse files Browse the repository at this point in the history
…ailed-releases

feat: clean failed releases and add param keep_releases
  • Loading branch information
jvasseur authored Aug 21, 2024
2 parents 3a2e728 + c3c2a66 commit 3004c44
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deploy/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
clean_before: false
keep_releases: 5
7 changes: 7 additions & 0 deletions deploy/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
release: '{{ now(utc=True, fmt="%Y%m%d%H%M%S") }}'
run_once: true

- name: Clean failed releases
deploy_helper:
path: '{{ path }}'
state: clean
when: clean_before

- name: Initialize the deploy
deploy_helper:
path: '{{ path }}'
Expand Down Expand Up @@ -85,6 +91,7 @@
path: '{{ deploy_helper.project_path }}'
release: '{{ deploy_helper.new_release }}'
state: finalize
keep_releases: '{{ keep_releases }}'

- name: Run after_finalize commands
shell: '{{ item }}' # noqa command-instead-of-shell no-changed-when
Expand Down

0 comments on commit 3004c44

Please sign in to comment.