簡體   English   中英

Gitlab CI/CD - 在 Azure 上部署節點應用程序 Linux WebApp

[英]Gitlab CI/CD - deploy node application on Azure Linux WebApp

image: node:9.2.0

stages:
  - build

build:
  stage: build
  script: 
  - set NODE_ENV=production
  - npm install
  - npm run transpile
  - ls
  - cd dist-server
  - ls
  - node /bin/www
  #- npm run prod
  artifacts:
   expire_in: 1 day
   paths:
   - dist/

以上是我的 yaml ci 文件,任何人都可以分享如何在 linux Azure Web 應用程序上部署它。

沒有現成的解決方案可以使用 Gitlab 部署到 Azure。

您可以在 Gitlab 管道中執行以下過程:

  • 構建 docker 容器
  • 將 docker 容器推送到 Gitlab 容器注冊表(包含在您的 Gitlab 存儲庫中)
  • 運行 curl 命令觸發 Azure App Service webhook 更新

您可以將這個 Docker 容器托管在 Azure 中(創建 App Service 后,您可以在 Deployment 設置中找到 webhook url)

image: node:9.2.0

stages:
  - build

build:
  stage: build
  script: 
  - set NODE_ENV=production
  - npm install
  - npm run transpile
  - ls
  - cd dist-server
  - ls
  - node /bin/www
  #- npm run prod
  artifacts:
   expire_in: 1 day
   paths:
   - dist/

以上是我用於 ci 的 yaml 文件,任何人都可以分享如何在 linux Azure Web App 上部署它。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM