久久久久久久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?)
主站蜘蛛池模板: 欧美高清hd| 国产欧美在线观看 | 狠狠婷婷综合久久久久久妖精 | 国产成人精品免高潮在线观看 | 国产在线一区二 | 成人午夜影院 | 黄网站涩免费蜜桃网站 | 中文字幕一区二区三区四区 | 黄视频欧美 | 日一区二区| 国产一区二区三区四区区 | 亚洲精品一二三 | 成人一区二区视频 | 国产欧美二区 | 成年人网站免费视频 | 完全免费在线视频 | 999久久久久久久 | 欧美日韩综合视频 | 浴室洗澡偷拍一区二区 | 在线免费av电影 | 91麻豆精品国产91久久久更新资源速度超快 | 国产偷久久一级精品60部 | 日韩免费一区 | 国产精品高潮呻吟久久 | 中文字幕一区二区三区在线视频 | 亚洲午夜久久久 | 久草福利 | 欧美xxxx色视频在线观看免费 | 成人免费福利视频 | 天堂中文字幕av | 超碰精品在线 | 在线观看亚洲精品视频 | 福利二区 | 国产a区 | 国产精品久久久久久久岛一牛影视 | 亚洲成av人片在线观看无码 | 午夜男人的天堂 | 婷婷狠狠 | 不卡一区二区三区四区 | 国产99视频精品免费视频7 | 欧美精品一区三区 |