Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store manager version and build time #630

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions components/manager/scripts/create.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import os
from datetime import datetime
from os.path import join, dirname

from cloudify import ctx
Expand Down Expand Up @@ -147,5 +148,15 @@ def restore_agent_resources(agents_dir):
)


def store_manager_version():
version = os.environ.get('MANAGER_VERSION', '')
build_date = datetime.now().strftime('%Y-%m-%d %H:%M')
motd = ' '.join(['Cloudify Manager', version,
'(bootstrap {0})'.format(build_date)])
# easiest way to sudo-append to file without changing its chmod...
utils.sudo(['bash', '-c', "echo '{0}' >> /etc/motd".format(motd)])


execute_before_bootstrap()
deploy_manager_sources()
store_manager_version()
5 changes: 5 additions & 0 deletions inputs/manager-inputs.yaml
@@ -1,4 +1,9 @@
inputs:
#############################
# Version Label
#############################
manager_version:
default: 4.2.0-.dev1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it weird for the version to appear in the inputs?


#############################
# Security Settings
Expand Down
4 changes: 3 additions & 1 deletion types/manager-types.yaml
Expand Up @@ -47,6 +47,8 @@ node_types:
default: components/manager/scripts/create.py
hide_output: *hide_output
fabric_env: *simple_fabric_env
MANAGER_VERSION:
default: { get_attribute: [manager_configuration, manager_version] }
delete:
implementation: fabric.fabric_plugin.tasks.run_script
inputs:
Expand All @@ -71,7 +73,7 @@ node_types:
public_ip:
default: ''
manager_version:
default: 4.0.0
default: { get_input: manager_version }
cloudify:
description: >
Configuration for Cloudify Manager
Expand Down