【发布时间】:2018-01-24 03:14:37
【问题描述】:
我在 gitlab 存储库上有一个 node.js,我正在尝试使用 CI 管道将其推送到 AWS EC2 Ubntu 服务器中。
我正在尝试在我的 gitlab 存储库和 EC2 实例之间实现 CI 管道,每次我推送新代码时都会触发管道并且代码会自动转到 EC2 服务器。
我已将带有 name 和 url 的 environment 添加到 yaml 文件中。 (url是安装了git的AWS服务器地址)
我当前的 .gitlab-ci.yml 文件如下所示:
image: node:6.10.3
stages:
- ver
- init
- tests
- deploy
ver:
stage: ver
script:
- node --version
- whoami
init:
stage: init
script:
- npm cache clean
- rm -rf node-modules
- npm install
run_tests:
stage: tests
before_script:
- chmod 0777 ./node_modules/.bin/_mocha
script:
- npm test
deploy_staging:
stage: deploy
script:
- echo "Going to deploy to staging server"
environment:
name: staging
url: http://EC2DNS_Address.amazonaws.com/test/ci-test
only:
- master
当我提交新更改时,我可以看到管道获得触发器,但我没有看到任何应用于服务器的更改。
如何将这些更改推送到我的 ubuntu 服务器? 我需要的不仅仅是环境标签吗?
【问题讨论】:
标签: git continuous-integration gitlab gitlab-ci