Commit 5b8be008 by Calen Pennington

Don't truncate version shas when tagging AWS resources.

It's hard to know when a repo will get big enough that any given
truncation won't be long enough.
parent 91430449
...@@ -73,9 +73,9 @@ ...@@ -73,9 +73,9 @@
description: "AMI built via edX continuous delivery pipeline - Ansible version: {{ ansible_version }}" description: "AMI built via edX continuous delivery pipeline - Ansible version: {{ ansible_version }}"
# used a JSON object here as there is a string interpolation in the keys. # used a JSON object here as there is a string interpolation in the keys.
tags: "{ tags: "{
'version:{{ play }}':'{{ app_repo }} {{ app_version[:7] }}', 'version:{{ play }}':'{{ app_repo }} {{ app_version }}',
'version:configuration':'{{ configuration_repo }} {{ configuration_version[:7] }}', 'version:configuration':'{{ configuration_repo }} {{ configuration_version }}',
'version:configuration_secure':'{{ configuration_secure_repo }} {{ configuration_secure_version[:7] }}', 'version:configuration_secure':'{{ configuration_secure_repo }} {{ configuration_secure_version }}',
'play':'{{ play }}', 'play':'{{ play }}',
'cache_id':'{{ cache_id }}', 'cache_id':'{{ cache_id }}',
'environment':'{{ edx_environment }}', 'environment':'{{ edx_environment }}',
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
region: "{{ ec2_region }}" region: "{{ ec2_region }}"
resource: "{{ ami_register.image_id }}" resource: "{{ ami_register.image_id }}"
tags: tags:
version:edxapp_theme: "{{ edxapp_theme_source_repo }} {{ edxapp_theme_version[:7] }}" version:edxapp_theme: "{{ edxapp_theme_source_repo }} {{ edxapp_theme_version }}"
when: edxapp_theme_version is defined and edxapp_theme_source_repo is defined when: edxapp_theme_version is defined and edxapp_theme_source_repo is defined
- name: Fetch tags on the AMI - name: Fetch tags on the AMI
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
tags: tags:
"version:alton" : "{{ alton_source_repo }} {{ alton_checkout.after |truncate(7,True,'')}}" "version:alton" : "{{ alton_source_repo }} {{ alton_checkout.after }}"
when: alton_checkout.after is defined when: alton_checkout.after is defined
tags: tags:
- deploy - deploy
...@@ -8,5 +8,5 @@ ...@@ -8,5 +8,5 @@
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
tags: tags:
"version:certs" : "{{ CERT_REPO }} {{ certs_checkout.after|truncate(7,True,'') }}" "version:certs" : "{{ CERT_REPO }} {{ certs_checkout.after }}"
when: certs_checkout.after is defined when: certs_checkout.after is defined
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
tags: tags:
"version:edx_platform" : "{{ edx_platform_repo }} {{ edxapp_platform_checkout.after|truncate(7,True,'') }}" "version:edx_platform" : "{{ edx_platform_repo }} {{ edxapp_platform_checkout.after }}"
when: edxapp_platform_checkout.after is defined when: edxapp_platform_checkout.after is defined
- name: tag instance with edxapp theme version - name: tag instance with edxapp theme version
...@@ -15,5 +15,5 @@ ...@@ -15,5 +15,5 @@
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
tags: tags:
"version:edxapp_theme" : "{{ edxapp_theme_source_repo }} {{ edxapp_theme_checkout.after|truncate(7,True,'') }}" "version:edxapp_theme" : "{{ edxapp_theme_source_repo }} {{ edxapp_theme_checkout.after }}"
when: edxapp_theme_checkout.after is defined when: edxapp_theme_checkout.after is defined
...@@ -7,5 +7,5 @@ ...@@ -7,5 +7,5 @@
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
tags: tags:
"version:forum" : "{{ forum_source_repo }} {{ forum_checkout.after|truncate(7,True,'') }}" "version:forum" : "{{ forum_source_repo }} {{ forum_checkout.after }}"
when: forum_checkout.after is defined when: forum_checkout.after is defined
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
tags: tags:
"version:xserver" : "{{ xserver_source_repo }} {{ xserver_checkout.after|truncate(7,True,'') }}" "version:xserver" : "{{ xserver_source_repo }} {{ xserver_checkout.after }}"
when: xserver_checkout.after is defined when: xserver_checkout.after is defined
- name: Tag instance for xserver grader - name: Tag instance for xserver grader
...@@ -15,5 +15,5 @@ ...@@ -15,5 +15,5 @@
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
tags: tags:
"version:xserver_grader" : "{{ XSERVER_GRADER_SOURCE }} {{ xserver_grader_checkout.after|truncate(7,True,'') }}" "version:xserver_grader" : "{{ XSERVER_GRADER_SOURCE }} {{ xserver_grader_checkout.after }}"
when: xserver_grader_checkout.after is defined when: xserver_grader_checkout.after is defined
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
resource: "{{ ansible_ec2_instance_id }}" resource: "{{ ansible_ec2_instance_id }}"
region: "{{ ansible_ec2_placement_region }}" region: "{{ ansible_ec2_placement_region }}"
tags: tags:
"version:xsy" : "{{ xsy_source_repo }} {{ xsy_checkout.after |truncate(7,True,'')}}" "version:xsy" : "{{ xsy_source_repo }} {{ xsy_checkout.after }}"
when: xsy_checkout.after is defined when: xsy_checkout.after is defined
tags: tags:
- deploy - deploy
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment