summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml28
1 files changed, 19 insertions, 9 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 6e5b29b..24197be 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,9 +1,15 @@
# docker镜像
-image: git.mesalab.cn:7443/nezha/nz-build-env:1.1
+image: git.mesalab.cn:7443/nezha/nz-build-env:1.2
+# 定义全局变量
+variables:
+ MINIO_HOST: 'http://192.168.44.36:2020/'
+ MINIO_USER: 'admin'
+ MINIO_PWD: "Nezha@02!"
+ MAVEN_REPO: "/etc/maven/repository"
# 依赖的docker服务
services:
- - mariadb
- - redis
+# - mariadb
+# - redis
# 开始执行脚本前所需执行脚本
before_script:
- echo "begin ci"
@@ -14,10 +20,10 @@ after_script:
stages:
- build
- test
-
+# maven setting /usr/share/maven/conf/settings.xml
cache:
paths:
- - .m2/repository
+ - $MAVEN_REPO
# 定义的任务
build_rpm:
@@ -25,9 +31,11 @@ build_rpm:
# 所需执行的脚本
script:
- env | sort
+ - pwd
- chmod +x ./tools/package.sh
+ - ./tools/package.sh
artifacts:
- name: "$CI_COMMIT_REF_NAME"
+ name: "$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
when: on_success
paths:
- ./target/*.xjar
@@ -41,14 +49,16 @@ build_rpm:
- nezha
# 定义的任务
-test:
+dev_build:
stage: test
# 所需执行的脚本
script:
- env | sort
- - mvn clean test
+ - pwd
+ - mvn clean install -Dxjar.password=111111 -Dxjar.excludes=/db/*,/static/**/*
+ - cd ./target && go build xjar.go && cd ..
artifacts:
- name: "$CI_COMMIT_REF_NAME"
+ name: "$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA"
when: on_success
paths:
- ./target/*.xjar