繁体   English   中英

AWS 代码管道克隆问题

[英]AWS codepipeline cloning issues

我一直在尝试使用代码部署和 bitbucket 存储库创建 CI/CD。 管道是成功的,但我没有在 ec2 中寻找任何代码。 我只能看到ec2中的节点模块。 如果有人遇到同样的问题或者可以帮助我解决这些问题,那就太好了。

应用规范.yml

version: 0.0
os: linux
files:
  - source: /
    destination: /home/ubuntu/gt
hooks:
  ApplicationStart:
    - location: scripts/start_server.sh
      runas: root

启动服务器.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


我没有在 ec2 中寻找任何代码

这可能是因为您要删除文件夹的所有内容

rm -rf /home/ubuntu/gt

因为您的ApplicationStartfiles之后运行。 因此,无论您在files中复制什么,都会在ApplicationStart中被删除。 执行顺序请看这里

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM