加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.gitlab-ci.yml 2.05 KB
一键复制 编辑 原始数据 按行查看 历史
slash-l 提交于 2021-11-08 13:14 . add gitlab ci
image: maven:3.5.4-jdk-8-alpine
before_script:
# - apk update && apk upgrade && apk add git
- apk add git
# Set the M2_HOME environment variable
- export M2_HOME=/usr/share/maven
# Download JFrog CLI
- curl -fL https://getcli.jfrog.io | sh
# Configure Artifactory instance with JFrog CLI
- ./jfrog rt add --url=$ARTIFACTORY_URL --user=$ARTIFACTORY_USER --password=$ARTIFACTORY_PASS
- ./jfrog rt c show
stages:
- build
- test
- deploy
build_job:
stage: build
script:
- mvn clean install
# - ./jfrog rt mvn "clean install sonar:sonar -Dsonar.language=java -Dsonar.projectName=gitlabci-maven-artifactory -Dsonar.projectKey=gitlabci-maven-artifactory -Dsonar.java.binaries=* -Dsonar.host.url=http://124.70.55.35:9000 -Dsonar.login=676b9c8a11836d92a9a3fcd81e5c456571c45295" maven.conf --build-name=gitlabci-maven-artifactory --build-number=$CI_JOB_ID
# - ./jfrog rt mvn "clean install" maven.conf --build-name=gitlabci-maven-artifactory --build-number=$CI_JOB_ID
# Collect the environment variables
- ./jfrog rt bce gitlabci-maven-artifactory $CI_JOB_ID
# Add jira issue
# - ./jfrog rt bag gitlabci-maven-artifactory $CI_JOB_ID --config jira-cli.conf
# Add sonar
# - ./jfrog rt sp "slash-maven-dev-local/org/jfrog/test/multi3/3.7-SNAPSHOT/*.war" "qulity.gate.sonarUrl=http://124.70.55.35:9000/dashboard/index/"
# Add properties
- ./jfrog rt sp "slash-maven-dev-local/org/jfrog/test/multi3/3.7-SNAPSHOT/*.war" "deploy.tool=ansible"
- ./jfrog rt sp "slash-maven-dev-local/org/jfrog/test/multi3/3.7-SNAPSHOT/*.war" "ip=127.0.0.1"
# Pass the build information to Artifactory
- ./jfrog rt bp gitlabci-maven-artifactory $CI_JOB_ID
# Promote
- ./jfrog rt bpr gitlabci-maven-artifactory $CI_JOB_ID slash-maven-release-local
# Xray scan
# - ./jfrog rt bs gitlabci-maven-artifactory $CI_JOB_ID --fail=false
# Download
# - ./jfrog rt dl maven-dev-local/org/jfrog/test/multi3/3.7-SNAPSHOT/multi3-3.7-20191213.050538-8.war all-my-frogs/
when: manual
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化