In aws code pipeline I am getting Problem guys.
This is the error in aws code pipeline.
And This is the Code which Its works.
appspec.yml
version: 0.0
os: linux
files:
- source: ./
destination: /var/www/html/
hooks:
BeforeInstall:- location: scripts/install_dependencies.sh
timeout: 300
runas: root
- location: scripts/install_dependencies.sh
install_dependencies.sh
#!/bin/bash
rm -rf /var/www/html/*
if ! command -v nginx > /dev/null; then
apt update -y
apt install nginx -y
systemctl enable nginx
systemctl start nginx
exit 0
else
echo “Nginx is already installed”
fi
her I you see The error of code pipeline it telling like there is already .dotfiles so I cant able to replace it.
So here I need to Delete all the .dotfiles in that path(code pipeline delete only normal files not .dotfiles) Before the hooks run.
I just Tried to remove all the files in that path of the folder but actually Files path only runs first so before that I will need to execute. rm -r /var/www/html/
THARUN G is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.