问题
I installed third party tool (ecs deploy using pip install ecs-deploy
) .When I try to deploy using command ecs deploy demo-cluster demo-service
in command prompt its working fine when I try with jenkins to deploy getting error
/tmp/jenkins5062380414579854312.sh: line 13: ecs: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
回答1:
The Jenkins service runs typically runs under the user jenkins
.
You have installed the package as the ec2-user
. This means the jenkins
user may not have the package in its own path or have correct permissions to execute the file.
You can correct this one of two ways:
- Use
sudo
to elevate permissions and install it globally. Set the path in/etc/environment
- Interactively login as the
jenkins
user and install under that account.
回答2:
You need to run the full AWS CLI command:
aws ecs deploy --cluster demo-cluster --service demo-service
来源:https://stackoverflow.com/questions/60044044/jenkins-ecs-command-not-found