Tag: gitlab ci

在testing运行gitlab之后终止节点服务器

我想在我的gitlab服务器上启动一个节点服务器。 我已经build立了我的gitlab-ci.yml文件,这似乎工作。 但是,我想在testing完成后终止节点服务器。 我的gitlab-ci.yml文件的相关部分如下所示: unit_tests: stage: test variables: GIT_STRATEGY: clone script: – npm install – npm run websocket-server – npm test after_script: – //what should go here to kill the node server after the tests have run?

Herkoku节点部署与子文件夹

我正在尝试几个小时,并没有想法离开…也许你有一些:-) 我正在使用react-starter-kit作为我的react-app和gitlab作为我的存储库。 我已经启用gitlab-ci部署和运送我的应用程序到heroku。 好吧, gitlab-ci作品… 是的 但是使用/build文件夹来处理所有的资源和缩小的等应用程序。 我如何能够通过gitlab-ci获得heroku上的可运行应用程序? 我添加了这个内容的Procfile: web: node ./build/server.js heroku日志输出如下: 2017-01-02T16:57:54.655686+00:00 heroku[web.1]: State changed from crashed to starting 2017-01-02T16:57:58.721166+00:00 heroku[web.1]: Starting process with command `node ./build/server.js` 2017-01-02T16:58:00.987643+00:00 heroku[web.1]: Process exited with status 1 2017-01-02T16:58:00.995852+00:00 heroku[web.1]: State changed from starting to crashed 2017-01-02T16:58:00.997060+00:00 heroku[web.1]: State changed from crashed to starting 2017-01-02T16:58:00.833548+00:00 app[web.1]: module.js:471 […]

gitlab.com CI – 在docker中使用docker构build一个NodeJS应用程序

我目前正面临着gitlab.com共享运行者的问题。 我正在努力实现的是: – NPM安装和使用咕噜做一些uncss,最小化和压缩的任务 – 清理 – build立一个包括应用程序的docker集装箱 – 将容器移动到gitlabregistry 不幸的是我很长一段时间没有运行! 我尝试了很多不同的gitlab.ciconfiguration – 没有成功。 问题是,我必须使用“image:docker:latest”来运行所有docker-tools。 但是,我没有在容器中安装node和grunt。 另一种方式是不工作。 我正在尝试使用image:centos:latest并手动安装docker – 但是这也不能正常工作,因为我总是得到一个Failed to get D-Bus connection: Operation not permitted 有没有人有更多的经验,在docker共享运行使用dockerbuild设命令的gitlab-ci? 任何帮助,高度赞赏! 谢谢 Jannik

从Gitlab推到dokku

我想自动化我的NodeJS应用程序部署。 我正在使用Gitlab和dokku ,都在digitalOcean上。 如何做到这一点,每当我推gitlab,代码将自动推到dokku?

GitLab + GitLab CI +通过NPM从属SSH项目

目前我们使用GitLab来pipe理我们的回购和GitLab CI作为我们的CI。 我有一个项目,其中包括另一个GitLab项目作为依赖项(通过NPM)。 该项目是内部的,package.json中的URL以git+ssh://git@ ,这是我们在本地机器上使用的。 我们有SSH密钥设置。 但是,GitLab CI似乎无法使用相同的机制来安装这个依赖项目(通过npm install )。 我得到的错误是: npm install npm ERR! git clone git@my.domain.com:developers/my-repo.git Cloning into bare repository '/home/gitlab_ci_runner/.npm/_git-remotes/git-my-domain-com-developers-my-git-26043eba'… npm ERR! git clone git@my.domain.com:developers/my-repo.git npm ERR! git clone git@my.domain.com:developers/my-repo.git Host key verification failed. npm ERR! git clone git@my.domain.com:developers/my-repo.git fatal: The remote end hung up unexpectedly npm ERR! Error: Command failed: Host […]

如何使用gitlab跑步者在ec2上自动部署?

我想在gitlab上自动部署node.js项目。 目前我在.gitlab-ci.yml上使用下面的configuration deploy_to_dev_aws: only: – development script: – echo "$EC2_SSH_KEY" >> "key.pem" – chmod 600 key.pem – ssh -T -i key.pem -o StrictHostKeyChecking=no ubuntu@$EC2_HOST_IP <<EOF – cd ~/projects – rm myproject – git checkout git://myprojectpath – cd myproject – pm2 delete all – pm2 start app.js – logout – EOF stage: build 这是正确的方式,因为我login到ec2并执行所有操作? 还有什么其他方法可以做到这一点?

运行gitlab-ci.yml时,只有在合并请求发送给master时

我目前正在GitLab和Heroku中进行项目。 我想要做的是只要我要求我的function分支的合并请求(我们称之为crud-on-spaghetti ),我想自动运行在这个分支上的testing( npm test基本上,使用Mocha / Chai),以及成功之后,把这个crud-on-spaghetti和master合并,把它提交给origin/master (在GitLab上是远程的),然后在git push heroku master Heroku git push heroku master (基本上把他推到Heroku的主分店,应用程序被存储)。 我已经阅读了几篇关于GitLab CI的文章,我认为这更适合我(而不是Heroku CI,因为我没有DEV和PROD实例)。 所以,到现在为止,我手动做这个。 这是我的.gitlab-ci.yml文件( .gitlab-ci.yml没有被提交/推送): stages: – test – deploy test_for_illegal_bugs: stage: test script: – npm test deploy_to_dev: stage: deploy only: – origin master script: – git commit – git push origin master – git pull heroku […]

GitLab-CI和node.js – 如何启动本地服务器然后运行testing?

我已经设置了GitLab-CI,并正在编写我的.gitlab-ci.yml来运行我的testing。 我的应用程序是用node.js编写的,文件如下所示: before_script: – npm install – node server.js stages: – test job_name: stage: test script: – npm run test 我在启动服务器然后运行testing时遇到了麻烦,因为node server.js创build了一个永远不会存在的前台进程,除非您手动执行。 有没有办法启动服务器,然后继续,然后停止一旦testing完成? 或者我真的做错了,我的服务器应该开始在testing本身? 我所读的一切都只是说:“在另一个terminal上运行起始节点,然后在你的本地服务器上运行你的testing”,但是这在自动化的CI系统中显然没有意义。

CI使用Gitlab和Heroku

我正在使用react-starter-kit来开发我的web应用程序,并使用Gitlab作为我的远程git存储库。 我想configuration一个连续的部署,以便在每次向主服务器推送时,都会执行npm run deploy脚本。 从我的本地电脑执行npm run deploy构build节点应用程序并将其推送到远程的heroku git存储库。 它使用我的电脑本地凭据。 我已经configuration了gitlab runner(在.yml文件中)来执行相同的npm run deploy ,但是失败并显示Error: fatal: could not read Username for 'https://git.heroku.com': No such device or address 。 我需要find一种方法来validationgitlab亚军heroku。 我试图设置variablesHEROKU_API_KEY ,但它也没有工作。 我怎么能从我的gitlab亚军推到我的heroku git回购?

在gitLab CI YML中获取package.json的值

我为我的nodejs应用程序使用gitLab CI。 在我的YML文件中,我需要调用一个脚本来构build一个docker镜像。 但不是使用latest我需要使用当前版本的项目。 该版本值可以在存储库的package.json文件中find。 是否有可能读取package.json文件的版本值以取代当前版本的latest版本? # … variables: CONTAINER_RELEASE_IMAGE: $CI_REGISTRY_IMAGE:latest # need version value instead of latest build: stage: build script: # … – cd /opt/core/bundle && docker build -t $CONTAINER_RELEASE_IMAGE . – docker push $CONTAINER_RELEASE_IMAGE