Passing base64 encoded file in url breaks the file
Summary
We are passing updated file in url encoded in base64. Passed file in gitlab isn't the same as the updated source file.
Steps to reproduce
Try to update docker images in ansible-roles/elasticsearch
project. In vars/main.yml
file there are some jinja2 code which may break the file passed by url.
Expected behavior
Docker images in file gets updated
Actual behavior
Docker images in file gets updated but file is broken at some point
Relevant logs and/or screenshots
_elasticsearch_backup_command: >-
docker run --rm
--name elasticsearch_backup_{{ _elasticsearch_backup_index }}
{{ _elasticsearch_backup_container_image }}
--input={{ _elasticsearch_url }}/{{ _elasticsearch_backup_index }}
--output=$
{%- if elasticsearch_backup_compress %}
| gzip > {{ _elasticsearch_backup_file_path }}.gz
{% else %}
[\XX\ؘX\ٚ[W]_BH[Y _B[\XX\ܙ\ܙW[\ܘ\W\XܞN\[\XX\\\ܙK^[XW]W[YK\
WZXܛ]ZY_K[\XX\ܙ\ܙWٚ[N[\XX\
AND SO ON...
Possible fixes
Use urlenccode
with encodeb64
when passing file in url