Skip to content

old tags shall not pass #550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions ansible/roles/builder/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,26 @@
accept_hostkey: yes
force: yes

- name: get new tags from remote
tags: deploy
become: true
shell: "git fetch --tags"
args:
chdir: "{{ build_dir }}/{{ name }}/repo"

- name: get latest tag name
tags: deploy
become: true
shell: "git describe --tags `git rev-list --tags --max-count=1`"
args:
chdir: "{{ build_dir }}/{{ name }}/repo"
register: latest_tag

- name: ensure latest tag is deployed
tags: deploy
fail: msg="Cannot deploy {{ git_branch }} because latest is {{latest_tag.stdout}}. Bypass with `-t i_am_deploying_an_old_tag`"
when: node_env=="production-delta" and latest_tag.stdout != git_branch and i_am_deploying_an_old_tag is not defined

- name: copy dockerfile to build folder
tags: deploy
become: true
Expand Down