node.js - AWS 代码管道克隆问题
问题描述
我一直在尝试使用代码部署和 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
因为你ApplicationStart
追赶files
。所以无论你复制什么files
,都会被删除ApplicationStart
。执行顺序请看这里。
推荐阅读
- react-native - 单击反应导航5中的标题图标时打开抽屉
- sql-server - 运行自定义查询时在 Tableau 中出现错误
- openshift - openshift 基本演练是否仍然有效?
- c# - 了解 Razor 数据持久性
- python - 从嵌套列表中的列表中按类型删除元素
- javascript - 如何遍历 HTML 并将其转换为对象数组?
- javascript - 在最后一次迭代之后 setInterval 返回 undefined
- visual-studio - “获取最新版本”未按预期工作
- java - 子类方法没有正确减去
- javascript - JavaScript:替换部分文本存储在以“$”开头的字符串变量中?