AWS codepipeline 克隆问题
AWS codepipeline cloning issues
我一直在尝试使用代码部署和 bitbucket 存储库创建 CI/CD。
管道是成功的,但我没有在 ec2 中寻找任何代码。我只能在 ec2 中看到节点模块。
如果有人遇到同样的问题或者可以帮助我解决这些问题,那就太好了。
appspec.yml
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/gt
hooks:
ApplicationStart:
- location: scripts/start_server.sh
runas: root
start_server.sh
sudo apt-get update
# install the application using npm
# we need to traverse to where the application bundle is copied too.
#some comments
#added commets
sudo su
rm -rf /home/ubuntu/gt
mkdir /home/ubuntu/gt
echo installing application with npm
cd /home/ubuntu/gt
sudo apt-get install -y npm
echo installing pm2
npm install pm2 -g
sudo yarn
pm2 delete gt
pm2 start npm --name 'gt' -- start
I am not seeking any codes into ec2
这可能是因为您正在删除文件夹的所有内容:
rm -rf /home/ubuntu/gt
因为您的 ApplicationStart
在 files
之后运行。因此,无论您在 files
中复制什么,都会在 ApplicationStart
中被删除。执行顺序请看here.
我一直在尝试使用代码部署和 bitbucket 存储库创建 CI/CD。 管道是成功的,但我没有在 ec2 中寻找任何代码。我只能在 ec2 中看到节点模块。 如果有人遇到同样的问题或者可以帮助我解决这些问题,那就太好了。
appspec.yml
version: 0.0
os: linux
files:
- source: /
destination: /home/ubuntu/gt
hooks:
ApplicationStart:
- location: scripts/start_server.sh
runas: root
start_server.sh
sudo apt-get update
# install the application using npm
# we need to traverse to where the application bundle is copied too.
#some comments
#added commets
sudo su
rm -rf /home/ubuntu/gt
mkdir /home/ubuntu/gt
echo installing application with npm
cd /home/ubuntu/gt
sudo apt-get install -y npm
echo installing pm2
npm install pm2 -g
sudo yarn
pm2 delete gt
pm2 start npm --name 'gt' -- start
I am not seeking any codes into ec2
这可能是因为您正在删除文件夹的所有内容:
rm -rf /home/ubuntu/gt
因为您的 ApplicationStart
在 files
之后运行。因此,无论您在 files
中复制什么,都会在 ApplicationStart
中被删除。执行顺序请看here.