gitlab ci pages

2023-12-17 15:03:56

参考文章

gitlab pages是什么

一个可以利用gitlab的域名和项目部署自己静态网站的机制

开启

到gitlab的如下页面
在这里插入图片描述

通过gitlab.ci部署项目的静态网站

# build ruby 1/3:
#   stage: build
#   script:
#     - echo "ruby1"

# build ruby 2/3:
#   stage: build
#   script:
#     - echo "ruby2"

# build ruby 3/3:
#   stage: build
#   script:
#     - echo "ruby3"

# .hidden_job:
#   stage: test
#   script:
#     - echo ".hidden_job"

stages:
  - build
  - test
  - deploy

build-job:
  stage: build
  script:
    - echo "BUILD_VARIABLE=value_from_build_job" >> build.env
  artifacts:
    reports:
      dotenv: build.env

test-job:
  stage: test
  script:
    - echo "$BUILD_VARIABLE"  # Output is: 'value_from_build_job'


# Functions that should be executed before the build script is run

pages:
  stage: deploy
  #  before_script:
#    - mkdir public
  # The Docker image that will be used to build your app
  image: dockette/mvn
  script:
    - mkdir public
    - mvn clean test
    - cp -rf  ljunit/target/site/jacoco/* public/
#    - mv ljunit/target/site/jacoco/ public
  artifacts:
    paths:
      # The folder that contains the files to be exposed at the Page URL
      - public
    expire_in: 2 days

结果

在这里插入图片描述
pages:deploy这个job是gitlab帮我们生成的,点不开。其实我也好想能够生成动态的job,但是不知道怎么弄。
在这里插入图片描述

文章来源:https://blog.csdn.net/xiaolixi199311/article/details/135043758
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。