久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

使用 GitLab 持續部署 NodeJS

Continuous Deployment of a NodeJS using GitLab(使用 GitLab 持續部署 NodeJS)
本文介紹了使用 GitLab 持續部署 NodeJS的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個用 NodeJS 開發的 API,并通過 .gitlab-ci.yml 文件成功設置了持續集成.如果所有測試都在 master 分支上通過,下一階段是設置持續部署到 Heroku.

I have an API developed in NodeJS and have successfully set up continuous integration via a .gitlab-ci.yml file. The next stage is to set up continuous deployment to Heroku if all tests pass on the master branch.

有很多教程涵蓋了 Ruby 和 Python 應用程序的部署,但沒有關于 NodeJS 的教程.目前我的 .gitlab-ci.yml 文件如下所示:

There are plenty of tutorials covering the deployment of Ruby and Python apps but nothing on NodeJS. Currently my .gitlab-ci.yml file looks like this:

image: node:latest

job1:
  script: "ls -l"

test:
  script: "npm install;npm test"

production:
  type: deploy
  script:
  - npm install
  - npm start
  - gem install dpl
  - dpl --provider=heroku --app=my-first-nodejs --api-key=XXXXXXXXXX
  only:
  - master

Ruby 和 Python 教程使用 dpl 工具進行部署,但部署后如何在服務器上啟動 NodeJS 腳本?

The Ruby and Python tutorials use the dpl tool to deploy but how can I start the NodeJS script on the server once deployed?

添加生產部分并將其推送后,測試運行并通過,但部署階段卡在待處理狀態.控制臺是空白的.有人為 NodeJS 設置了成功的 CD 腳本嗎?

After adding the production section and pushing it the tests run and pass but the deploy stage gets stuck on pending. The console is blank. Has anyone set up a successful CD script for NodeJS?

推薦答案

您可以使用更簡單的 YAML 腳本,您可以在其中定義 CI 的階段(在生產部署之前運行測試),然后可以使用不同的圖像在 Heroku 部署階段.因此,對于節點應用程序,您將默認圖像定義為節點:最新.然后對于使用 dpl 的生產部署,您可以使用 ruby?? 映像.

you could use a much more simple YAML script where you can define the stages for the CI (to run test before production deploy) you can then use a different image at the Heroku deploy stage. So for a node app you define the default image as node:latest. Then for the production deployment using dpl you can use the ruby image.

image: node:latest

stages:
  - job1
  - test
  - production

job1:
  stage: job1
  script: "ls -l"

test:
  stage: test
  script: 
    - npm install
    - npm test
  artifacts:
    paths:
      - dist/

production:
  type: deploy
  stage: production
  image: ruby:latest
  script:
    - apt-get update -qy
    - apt-get install -y ruby-dev
    - gem install dpl
    - dpl --provider=heroku --app=my-first-nodejs --api-key=XXXXXXXXXX
  only:
    - master

這篇關于使用 GitLab 持續部署 NodeJS的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Using discord.js to detect image and respond(使用 discord.js 檢測圖像并響應)
Check if user ID exists in Discord server(檢查 Discord 服務器中是否存在用戶 ID)
Guild Member Add does not work (discordjs)(公會成員添加不起作用(discordjs))
Creating my first bot using REPLIT but always error Discord.JS(使用 REPLIT 創建我的第一個機器人,但總是錯誤 Discord.JS)
How do I code event/command handlers for my Discord.js bot?(如何為我的 Discord.js 機器人編寫事件/命令處理程序?)
How to find a User ID from a Username in Discord.js?(如何從 Discord.js 中的用戶名中查找用戶 ID?)
主站蜘蛛池模板: 波多野吉衣久久 | 久久国产精品-国产精品 | 国产精品激情在线 | 精品av | 波多野结衣一区二区三区在线观看 | 日韩精品网站 | 欧美精品1区 | 福利视频1000| 黄色一级特级片 | 久久久久国产 | 欧美一区二区大片 | 成人在线免费网站 | 精品久久国产视频 | 国产精品18久久久久久白浆动漫 | 欧美日韩国产精品激情在线播放 | 成人免费视频7777777 | 国产一区二区精品在线 | 久久1区| 久久一日本道色综合久久 | www网站在线观看 | 91精品国产乱码久久久 | 亚洲国产精品一区 | 狠狠ri | 综合国产在线 | 欧美精品在欧美一区二区少妇 | 米奇7777狠狠狠狠视频 | 精品国产18久久久久久二百 | 成人av免费在线观看 | 黄色一级片在线播放 | 久久久久久国产精品免费免费 | 美女福利视频一区 | 国产欧美一区二区三区另类精品 | 国产成人精品一区 | 欧美在线成人影院 | 色又黄又爽网站www久久 | 成人一区二区视频 | 91视频国产精品 | 亚洲成人精品 | 国产农村一级国产农村 | 九九亚洲 | 精品亚洲一区二区三区四区五区 |