参考文章
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,但是不知道怎么弄。