Skip to content

Commit 58b847a

Browse files
committed
Adding a way to manually set the app version from the command line
1 parent 0cdab4c commit 58b847a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aminatorplugins/provisioner/ansible.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ def add_plugin_args(self):
4949
ansible_config.add_argument('-ev', '--extra-vars', dest='extravars', help='A set of additional key=value variables to be used in the playbook',
5050
action=conf_action(self._config.plugins[self.full_name]))
5151

52+
ansible_config.add_argument('--app-version', dest='appversion', help='Manually set the application version number so it is tagging in the AMI',
53+
action=conf_action(self._config.plugins[self.full_name]))
5254

5355

5456
def _write_local_inventory(self):
@@ -125,7 +127,7 @@ def _store_package_metadata(self):
125127
config = self._config.plugins[self.full_name]
126128
metadata = {}
127129
metadata['name'] = context.package.arg
128-
metadata['version'] = ''
130+
metadata['version'] = config.get('appversion', '')
129131
metadata['release'] = ''
130132
metadata['extra_vars'] = config.get('extravars', '')
131133
context.package.attributes = metadata

0 commit comments

Comments
 (0)