I have a Spring boot application, which i am not able to deploy to AWS Ubuntu instance using AWS Code Deploy
This is the appspec.yml
version: 0.0
os: linux
files:
- source: /
destination: /opt/ubuntu/server
permissions:
- object: /
pattern: "**"
owner: ubuntu
group: ubuntu
hooks:
ApplicationStop:
- location: stop_server.sh
timeout: 20
runas: root
ApplicationStart:
- location: start_server.sh
timeout: 300
runas: ubuntu
stop_server.sh file
#!/usr/bin/env bash
# Kill Java process
# Determine the pid
PID=`ps -C java -o pid=`
kill -9 $PID
start_srver.sh file
#!/usr/bin/env bash
cd /opt/ubuntu/server
rm -rf target/*
sudo mvn clean package
sudo mvn spring-boot:run -Drun.jvmArguments='-Dserver.port=8080' > /dev/null 2> /dev/null < /dev/null &
CodeDeploy is stucked in Install stage, error which i am getting is mvn command not found
i logged in to instance and checked mvn command is working fine, but with codedeploy agent its not working
i have set the path ~/.profile and ~/.bashrc file, but still not working
GitHub Location of the repository is Repository Link