Skip to content

Commit 388ecc9

Browse files
Merge pull request #527 from CodeNow/enforce-versions-for-prod
fail delta deployes if not a version
2 parents 2cd457f + d525719 commit 388ecc9

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

ansible/roles/build_with_dockerfile/tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
---
22
# commands to build an image from a repo that contains a Dockerfile
3+
- name: Ensure Tag Deploy For Prod
4+
tags: deploy
5+
when: not git_branch | match("^v([0-9]+)\.([0-9]+)\.([0-9]+)$") and node_env=="production-delta"
6+
fail: msg="only tag can be deployed on prod not {{ git_branch }}"
7+
38
- name: create build folder
49
become: true
510
file:

ansible/roles/builder/tasks/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
---
22
# commands to build an image
3+
#
4+
- name: Ensure Tag Deploy For Prod
5+
tags: deploy
6+
when: not git_branch | match("^v([0-9]+)\.([0-9]+)\.([0-9]+)$") and node_env=="production-delta"
7+
fail: msg="only tag can be deployed on prod not {{ git_branch }}"
8+
39
- name: create build folder
410
become: true
511
file:

ansible/roles/git_repo/tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
---
2+
- name: Ensure Tag Deploy For Prod
3+
tags: deploy
4+
when: not git_branch | match("^v([0-9]+)\.([0-9]+)\.([0-9]+)$") and node_env=="production-delta"
5+
fail: msg="only tag can be deployed on prod not {{ git_branch }}"
6+
27
- name: Display Git Repo Name
38
debug:
49
msg: "application Installed: {{ app_name }}, branch : {{ git_branch }} "

0 commit comments

Comments
 (0)