简体   繁体   中英

CodeDeploy - How to add user input in CodeDeploy script

I'm trying to add a an user input in CodeDeploy script. Here is my code

#!/bin/bash
# start service application
read -p "Please Enter Path For Configuration File:" -r config_path
java -jar Testing-1.0-SNAPSHOT-jar-with-dependencies.jar ${config_path} > /dev/null 2> /dev/null < /dev/null &

I'm using the > /dev/null 2> /dev/null < /dev/null & because it's a long-running process, and I want CodeDeploy to continue after the process starts. But right now, it doesn't ask me to enter the path for config file, nor show any error. Any help is much appreciated.

Unfortunately this is not functionality that is supported within the CodeDeploy hook scripts.

The only arguments that are passed into the script are the environment variables that CodeDeploy has published, these are below:

  • LIFECYCLE_EVENT : This variable contains the name of the lifecycle event associated with the script.
  • DEPLOYMENT_ID : This variables contains the deployment ID of the current deployment.
  • APPLICATION_NAME : This variable contains the name of the application being deployed. This is the name the user sets in the console or AWS CLI.
  • DEPLOYMENT_GROUP_NAME : This variable contains the name of the deployment group. A deployment group is a set of instances associated with an application that you target for a deployment.
  • DEPLOYMENT_GROUP_ID : This variable contains the ID of the deployment group in AWS CodeDeploy that corresponds to the current deployment

You might be able to use one of these to control the logic you're trying to determine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM