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

[Question] How to get the app name in pre-deploy function #881

Closed
berksonj opened this issue Oct 29, 2020 · 1 comment
Closed

[Question] How to get the app name in pre-deploy function #881

berksonj opened this issue Oct 29, 2020 · 1 comment
Labels

Comments

@berksonj
Copy link

berksonj commented Oct 29, 2020

I am trying use the app's name in a pre-deploy function, in order to set a label.

My current script is below.

var preDeployFunction = function (captainAppObj, dockerUpdateObject) {
    return Promise.resolve()
        .then(function(){

            // label: version
            var key = "com.example.version";
            var val = captainAppObj.deployedVersion+ '';
            dockerUpdateObject.TaskTemplate.ContainerSpec.Labels[key] = val;

            // label: appname
            var key = "com.example.app_name";
            var val = "app name should go here"; // captainAppObj.something+ '';
            dockerUpdateObject.TaskTemplate.ContainerSpec.Labels[key] = val

            return dockerUpdateObject;
        });
};

Is there a way to access the app name via captainAppObj?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant