TSG-7609:解除tsg-diagnose只编译带tag的源码的限制

This commit is contained in:
fumingwei
2021-09-01 14:20:37 +08:00
parent a563c8fede
commit 7fa25867b8
3 changed files with 90 additions and 52 deletions

View File

@@ -1,6 +1,6 @@
stages:
- prebuild
- build
- upload
cache:
key: "$CI_PROJECT_NAME-cache"
@@ -12,8 +12,6 @@ cache:
before_script:
- docker info
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
only:
- tags
tags:
- share
@@ -33,11 +31,9 @@ cache:
- chmod +x ./ci/travis.sh
tags:
- share
only:
- tags
images_build:
stage: build
stage: prebuild
extends: .build_docker_images
variables:
UNITTEST_IMAGE_TAG: unittest-tsg-diagnose:latest
@@ -56,12 +52,46 @@ images_build:
- docker save $DNS_IMAGES_TAGE > images/dns.tar
rpm_build:
stage: upload
feature_branch_build:
stage: build
variables:
PACKAGE: 1
TESTING_VERSION_BUILD: 1
extends: .build_rpm
script:
- ./ci/travis.sh
dependencies:
- images_build
except:
- tags
- /^dev-.*$/i
- /^rel-.*$/i
- /^master.*$/i
develop_build:
stage: build
variables:
PACKAGE: 1
UPLOAD: 1
TESTING_VERSION_BUILD: 1
PULP3_RPM_REPO_NAME: tsg-testing-x86_64.el7
PULP3_RPM_DIST_NAME: tsg-testing-x86_64.el7
extends: .build_rpm
script:
- ./ci/travis.sh
dependencies:
- images_build
only:
- /^dev-.*$/i
- /^rel-.*$/i
- /^master.*$/i
release_build:
stage: build
variables:
PACKAGE: 1
UPLOAD: 1
VER_NAME: $CI_COMMIT_REF_NAME
PULP3_RPM_REPO_NAME: tsg-stable-x86_64.el7
PULP3_RPM_DIST_NAME: tsg-stable-x86_64.el7
extends: .build_rpm
@@ -69,3 +99,5 @@ rpm_build:
- ./ci/travis.sh
dependencies:
- images_build
only:
- tags

View File

@@ -37,7 +37,7 @@ mkdir build || true
cd build
cmake3 ..
cmake3 -DVERSION_DAILY_BUILD=$TESTING_VERSION_BUILD ..
if [ -n "${PACKAGE}" ]; then
make package

View File

@@ -18,6 +18,12 @@ include(${__VERSION_CONFIG})
string(REGEX REPLACE "^v([0-9]+)\\..*" "\\1" TSG_DIAGNOSE_VERSION_MAJOR "${VCS_TAG}")
string(REGEX REPLACE "^v[0-9]+\\.([0-9]+).*" "\\1" TSG_DIAGNOSE_VERSION_MINOR "${VCS_TAG}")
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" TSG_DIAGNOSE_VERSION_PATCH "${VCS_TAG}")
string(REGEX REPLACE "[T\\:\\+\\-]" "" TSG_DIAGNOSE_VERSION_DATE "${VCS_DATE}")
if(VERSION_DAILY_BUILD)
set(TSG_DIAGNOSE_VERSION_PATCH ${TSG_DIAGNOSE_VERSION_PATCH}.${TSG_DIAGNOSE_VERSION_DATE})
endif()
if(NOT TSG_DIAGNOSE_VERSION_MAJOR)
set(TSG_DIAGNOSE_VERSION_MAJOR 3)