--- /dev/null
+---
+
+- name: undo last commit from failed release
+ command: git reset --soft HEAD~1 chdir=remoto
+ when: (clean and last_commit.stdout == tag_name)
+
+- name: git checkout {{ branch }} branch
+ command: git checkout {{ branch }} chdir=remoto
+
+- name: remove local tag
+ command: git tag -d v{{ version }} chdir=remoto
+ ignore_errors: yes
+
+- name: remove remote tag
+ command: git push jenkins :refs/tags/v{{ version }} chdir=remoto
+ ignore_errors: yes
+
+- name: force push changes to jenkins git repo
+ command: git push -f jenkins {{ branch }} chdir=remoto
--- /dev/null
+---
+
+- name: check if remoto repo exists
+ stat: path='./remoto'
+ register: 'cdep_repo'
+
+- name: clone the remoto repository
+ git: repo=git@github.com:ceph/remoto dest=remoto
+ when: cdep_repo.stat.exists is defined and cdep_repo.stat.exists == false
+
+- name: rename origin to jenkins
+ command: git remote rename origin jenkins chdir=remoto
+ ignore_errors: yes
+
+- name: fetch the latest from remote
+ command: git fetch jenkins chdir=remoto
+
+- name: ensure local repo is in sync with remote
+ command: git reset --hard jenkins/{{ branch }} chdir=remoto
+
+- name: check if we are re-pushing the release commit
+ command: git log -1 --pretty=%B chdir=remoto
+ register: 'last_commit'
+
+ # we probably messed up the previous commit+tag, so we chose to use 'clean'
+ # that will rollback that commit, delete the local and remote tag, and force
+ # push the new changes
+- include: clear_version.yml
+ when: (clean and last_commit.stdout == tag_name)
+
+ # if the last commit wasn't one that we already did, then go ahead and make
+ # the changes + tag for the release. Otherwise, just skip because it was
+ # already done for this release
+- include: release.yml
+ when: (tag_name != last_commit.stdout)
--- /dev/null
+---
+
+- name: fetch the latest from remote
+ command: git fetch jenkins chdir=remoto
+
+- name: ensure local repo is in sync with remote
+ command: git reset --hard jenkins/{{ branch }} chdir=remoto
+
+- name: git checkout {{ branch }} branch
+ command: git checkout {{ branch }} chdir=remoto
+
+- name: set the debian version
+ command: dch -v {{ version }} -D stable "New upstream release" chdir=remoto
+ environment:
+ DEBEMAIL: "{{ debemail }}"
+ DEBFULLNAME: "{{ debfullname }}"
+
+- name: set the version in the spec file
+ lineinfile: dest=remoto/remoto.spec
+ regexp="Version{{':'}}\s+"
+ line="Version{{':'}} {{ version }}"
+ state=present
+
+- name: commit the version changes
+ command: git commit -a -m "{{ version }}" chdir=remoto
+
+ # from script: /srv/ceph-build/tag_release.sh
+ # Contents of tag_release.sh
+ # FIXME: this used to be a signed tag:
+ # command: git tag -s "v{{ version }}" -u 17ED316D -m "v{{ version }}" chdir=remoto
+- name: tag and commit the version
+ command: git tag "v{{ version }}" -m "v{{ version }}" chdir=remoto
+ environment:
+ GNUPGHOME: ~/build/gnupg.ceph-release
+ DEBEMAIL: "{{ debemail }}"
+ DEBFULLNAME: "{{ debfullname }}"
+
+- name: push changes to jenkins git repo
+ command: git push jenkins {{ branch }} chdir=remoto
+
+ # FIXME: this used to be set when signing the tag:
+ # environment:
+ # GNUPGHOME: ~/build/gnupg.ceph-release
+- name: push the newly created tag
+ command: git push jenkins v{{ version }} chdir=remoto