diff --git a/ansible/roles/build_with_dockerfile/tasks/main.yml b/ansible/roles/build_with_dockerfile/tasks/main.yml index 858daa33..d61c1d15 100644 --- a/ansible/roles/build_with_dockerfile/tasks/main.yml +++ b/ansible/roles/build_with_dockerfile/tasks/main.yml @@ -1,5 +1,10 @@ --- # commands to build an image from a repo that contains a Dockerfile +- name: Ensure Tag Deploy For Prod + tags: deploy + when: not git_branch | match("^v([0-9]+)\.([0-9]+)\.([0-9]+)$") and node_env=="production-delta" + fail: msg="only tag can be deployed on prod not {{ git_branch }}" + - name: create build folder become: true file: diff --git a/ansible/roles/builder/tasks/main.yml b/ansible/roles/builder/tasks/main.yml index f58d2c49..1a4d1589 100644 --- a/ansible/roles/builder/tasks/main.yml +++ b/ansible/roles/builder/tasks/main.yml @@ -1,5 +1,11 @@ --- # commands to build an image +# +- name: Ensure Tag Deploy For Prod + tags: deploy + when: not git_branch | match("^v([0-9]+)\.([0-9]+)\.([0-9]+)$") and node_env=="production-delta" + fail: msg="only tag can be deployed on prod not {{ git_branch }}" + - name: create build folder become: true file: diff --git a/ansible/roles/git_repo/tasks/main.yml b/ansible/roles/git_repo/tasks/main.yml index b5c0c71e..982668ad 100644 --- a/ansible/roles/git_repo/tasks/main.yml +++ b/ansible/roles/git_repo/tasks/main.yml @@ -1,4 +1,9 @@ --- +- name: Ensure Tag Deploy For Prod + tags: deploy + when: not git_branch | match("^v([0-9]+)\.([0-9]+)\.([0-9]+)$") and node_env=="production-delta" + fail: msg="only tag can be deployed on prod not {{ git_branch }}" + - name: Display Git Repo Name debug: msg: "application Installed: {{ app_name }}, branch : {{ git_branch }} "