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

Add the CodeDeploy agent to the PATH #385

Open
nbro10 opened this issue Dec 20, 2023 · 1 comment
Open

Add the CodeDeploy agent to the PATH #385

nbro10 opened this issue Dec 20, 2023 · 1 comment

Comments

@nbro10
Copy link

nbro10 commented Dec 20, 2023

The title only describes one problem. In this issue, I'm reporting several issues.

I've used the instructions here to install the CodeDeploy agent.

(I know this is not the recommended way, but using the AWS System Manager seems more complicated. It's not just one click. You need to associate your EC2 with the AWS System Manager and do other stuff. To me, this looks already too complicated, so I don't even know why this is the recommended way.)

On Ubuntu, it seems that the agent is installed in /opt/codedeploy-agent/bin/codedeploy-agent. However, if we do codedeploy-agent --version we get a codedeploy-agent: command not found, which means we can't directly interact with the agent by just specifying the name, but we need to specify the full path, which is tedious.

Is there any reason why we wouldn't want to add the agent to the PATH? I think the only possible reason not to do this is that, if we decide to remove the agent, we may want to update the PATH. But can't this be done consistently?

The other problem is that /opt/codedeploy-agent/bin/codedeploy-agent --version does not return anything because there's no --version option, which is so weird. It seems that there are only the options to start, stop, etc., the agent/service. I think there could be other options, like ways to flush the logs, clean up old deployments, self-update the agent and also to remove the agent. Btw, why isn't there already a way to install the agent with apt or apt-get?

Another problem with CodeDeploy is that there's no way (apparently) to ignore errors in hooks in the appspec.yml. I really don't understand why this option doesn't at least exist for the ApplicationStop hook, which always fails the first time you're setting a new project. It's so tedious to always have to manual deploy until you get it right. I basically had to do this like 30 times so far because ApplicationStop sometimes fails because of what I've just said.

I've just started to use AWS CodeDeploy, but honestly I was expecting it to be more advanced and simpler to use. It looks unnecessary complicated mostly because it lacks many useful features (e.g. I should just need to do sudo apt install codedeploy-agent to install it, and after that I should be able to do codedeploy-agent --version).

@nbro10 nbro10 changed the title Add the CodeDeploy agent to the PATH and the agent has no version option Add the CodeDeploy agent to the PATH Dec 20, 2023
@psavides-aws
Copy link
Contributor

For application stop failures there is an option on create deployment to ignore application stop failures. See: https://docs.aws.amazon.com/cli/latest/reference/deploy/create-deployment.html

That setting is available in the console in the "Additional deployment behavior settings" box on the create deployment page.

For installation, we only ever intend to set this up as a daemon, so the best way to start/manage it is through systemctl utility. For example systemctl status codedeploy-agent. When installing through the instructions you linked, the agent systemd service will be automatically enabled and started.

For checking version, the way to do that right now is through cat /opt/codedeploy-agent/.version.

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

No branches or pull requests

2 participants