From fbb5c0f599d087db5b61b0e9e52252a878e36c24 Mon Sep 17 00:00:00 2001 From: Alfredo Deza Date: Mon, 30 Nov 2015 10:26:56 -0500 Subject: [PATCH] conditionally clear the previous commit and tag Signed-off-by: Alfredo Deza --- .../ceph-deploy-release/clear_version.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 ansible/roles/ceph-deploy-release/clear_version.yml diff --git a/ansible/roles/ceph-deploy-release/clear_version.yml b/ansible/roles/ceph-deploy-release/clear_version.yml new file mode 100644 index 00000000..7199829a --- /dev/null +++ b/ansible/roles/ceph-deploy-release/clear_version.yml @@ -0,0 +1,19 @@ +--- + +- name: undo last commit from failed release + command: git reset --soft HEAD~1 chdir=ceph-deploy + when: (clean and version in last_commit.stdout) + +- name: git checkout {{ branch }} branch + command: git checkout {{ branch }} chdir=ceph-deploy + +- name: remove local tag + command: git tag -d v{{ version }} chdir=ceph-deploy + ignore_errors: yes + +- name: remove remote tag + command: git push jenkins :refs/tags/v{{ version }} chdir=ceph-deploy + ignore_errors: yes + +- name: force push changes to jenkins git repo + command: git push -f jenkins {{ branch }} chdir=ceph-deploy -- 2.39.5