如何在 Gitlab 评论应用程序上访问应用程序 运行?

How to access application running on Gitlab review apps?

.gitlab-ci.yml 文件

image: node:latest

services:
# This folder is cached between builds

stages:
  - deploy
cache:
  paths:
  - node_modules/
deploy_staging:
  stage: deploy
  script:
    - echo "Deploy to staging server"
    - npm install
    - npm install pm2 -g
    - pm2 start bin/www --name mms
    - ps -ef | grep mms
  environment:
    name: staging
    url: http://staging.example.com

我已经在服务器上部署了一个 nodeJS 应用程序,我如何使用这个 URL 访问应用程序的端点?

您似乎混淆了环境可以做什么和不能做什么。 The url variable is just for your convenience:

This is an optional value that when set, it exposes buttons in various places in GitLab which when clicked take you to the defined URL.

Gitlab 不会在 URL 下创建端点,您提供 URL 在部署后可以访问应用程序。

这是解决所有 gitlab CI 查询的最准确答案