🐎 ci(stage upgrade): split to 4 stage
This commit is contained in:
134
.gitlab-ci.yml
134
.gitlab-ci.yml
@@ -2,21 +2,70 @@ variables:
|
||||
GIT_STRATEGY: "clone"
|
||||
BUILD_PADDING_PREFIX: /tmp/padding_for_CPACK_RPM_BUILD_SOURCE_DIRS_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX_PREFIX/
|
||||
INSTALL_PREFIX: "/opt/tsg/stellar"
|
||||
INSTALL_DEPENDENCY_LIBRARY: mrzcpd-corei7 framework_env libfieldstat4-devel
|
||||
TESTING_VERSION_BUILD: 0
|
||||
BUILD_IMAGE_CENTOS8: "git.mesalab.cn:7443/mesa_platform/build-env:rockylinux"
|
||||
BUILD_IMAGE_CENTOS8: "git.mesalab.cn:7443/mesa_platform/build-env:rocky8-for-stellar"
|
||||
|
||||
stages:
|
||||
- cppcheck
|
||||
- build
|
||||
- test
|
||||
- upload
|
||||
|
||||
.build_by_travis_for_centos8:
|
||||
image: $BUILD_IMAGE_CENTOS8
|
||||
before_script:
|
||||
.everything_before_script: &everything_before_script
|
||||
- mkdir -p $BUILD_PADDING_PREFIX/$CI_PROJECT_NAMESPACE/
|
||||
- ln -s $CI_PROJECT_DIR $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
||||
- cd $BUILD_PADDING_PREFIX/$CI_PROJECT_PATH
|
||||
- yum makecache --disablerepo="*" --enablerepo="framework,platform"
|
||||
- yum install -y $INSTALL_DEPENDENCY_LIBRARY
|
||||
- source /etc/profile.d/mrzcpd.sh
|
||||
- source /etc/profile.d/framework.sh
|
||||
- chmod +x ./ci/travis.sh
|
||||
|
||||
###############################################################################
|
||||
# cppcheck
|
||||
###############################################################################
|
||||
.cppcheck_script:
|
||||
variables:
|
||||
BUILD_TYPE: Debug
|
||||
stage: cppcheck
|
||||
script:
|
||||
- mkdir build; cd build; cmake3 -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
|
||||
- >
|
||||
cppcheck --project=compile_commands.json
|
||||
--enable=all
|
||||
--std=c++11
|
||||
--error-exitcode=1
|
||||
--suppress=unusedFunction
|
||||
--suppress=missingInclude
|
||||
--suppress=uselessAssignmentPtrArg
|
||||
--suppress=unmatchedSuppression
|
||||
--suppress=variableScope
|
||||
--suppress=unreadVariable
|
||||
--suppress=cstyleCast
|
||||
--suppress=memleakOnRealloc
|
||||
--suppress=constParameter
|
||||
--suppress=uselessAssignmentArg
|
||||
--suppress=uninitvar
|
||||
--suppress=unusedStructMember
|
||||
--suppress=funcArgOrderDifferent
|
||||
--suppress=unreachableCode
|
||||
--suppress=internalAstError
|
||||
tags:
|
||||
- share
|
||||
|
||||
run_cppcheck_for_centos8:
|
||||
extends: .cppcheck_script
|
||||
image: $BUILD_IMAGE_CENTOS8
|
||||
|
||||
###############################################################################
|
||||
# build
|
||||
###############################################################################
|
||||
|
||||
.build_by_travis_for_centos8:
|
||||
image: $BUILD_IMAGE_CENTOS8
|
||||
before_script: *everything_before_script
|
||||
script:
|
||||
- yum makecache
|
||||
- ./ci/travis.sh
|
||||
tags:
|
||||
- share
|
||||
@@ -36,6 +85,10 @@ branch_build_release_for_centos8:
|
||||
variables:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
extends: .build_by_travis_for_centos8
|
||||
artifacts:
|
||||
name: "stellar-branch-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
- build/*
|
||||
except:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
@@ -46,16 +99,8 @@ develop_build_debug_for_centos8:
|
||||
extends: .build_by_travis_for_centos8
|
||||
variables:
|
||||
TESTING_VERSION_BUILD: 1
|
||||
#UPLOAD_SYMBOL_FILES: 1
|
||||
BUILD_TYPE: Debug
|
||||
#ASAN_OPTION: ADDRESS
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: stellar-stable-x86_64.el8
|
||||
PULP3_DIST_NAME: stellar-stable-x86_64.el8
|
||||
artifacts:
|
||||
name: "stellar-develop-$CI_COMMIT_REF_NAME-debug"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
@@ -65,16 +110,12 @@ develop_build_release_for_centos8:
|
||||
extends: .build_by_travis_for_centos8
|
||||
variables:
|
||||
TESTING_VERSION_BUILD: 1
|
||||
#UPLOAD_SYMBOL_FILES: 1
|
||||
#ASAN_OPTION: ADDRESS
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: stellar-stable-x86_64.el8
|
||||
PULP3_DIST_NAME: stellar-stable-x86_64.el8
|
||||
artifacts:
|
||||
name: "stellar-develop-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
- build/*
|
||||
only:
|
||||
- /^develop-.*$/i
|
||||
- /^release-.*$/i
|
||||
@@ -82,16 +123,8 @@ develop_build_release_for_centos8:
|
||||
release_build_debug_for_centos8:
|
||||
stage: build
|
||||
variables:
|
||||
#UPLOAD_SYMBOL_FILES: 1
|
||||
BUILD_TYPE: Debug
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-stable-x86_64.el8
|
||||
PULP3_DIST_NAME: tsg-stable-x86_64.el8
|
||||
extends: .build_by_travis_for_centos8
|
||||
artifacts:
|
||||
name: "stellar-install-$CI_COMMIT_REF_NAME-debug"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
only:
|
||||
- tags
|
||||
|
||||
@@ -99,14 +132,51 @@ release_build_release_for_centos8:
|
||||
stage: build
|
||||
variables:
|
||||
BUILD_TYPE: RelWithDebInfo
|
||||
#UPLOAD_SYMBOL_FILES: 1
|
||||
PACKAGE: 1
|
||||
PULP3_REPO_NAME: tsg-stable-x86_64.el8
|
||||
PULP3_DIST_NAME: tsg-stable-x86_64.el8
|
||||
extends: .build_by_travis_for_centos8
|
||||
artifacts:
|
||||
name: "stellar-install-$CI_COMMIT_REF_NAME-release"
|
||||
paths:
|
||||
- build/*.rpm
|
||||
- build/*
|
||||
only:
|
||||
- tags
|
||||
- tags
|
||||
|
||||
###############################################################################
|
||||
# test
|
||||
###############################################################################
|
||||
test_in_centos8:
|
||||
stage: test
|
||||
image: $BUILD_IMAGE_CENTOS8
|
||||
allow_failure: false
|
||||
script:
|
||||
- *everything_before_script
|
||||
- cd build; ctest -V
|
||||
dependencies:
|
||||
- branch_build_release_for_centos8
|
||||
- develop_build_release_for_centos8
|
||||
- release_build_release_for_centos8
|
||||
tags:
|
||||
- share
|
||||
|
||||
###############################################################################
|
||||
# upload
|
||||
###############################################################################
|
||||
.define_before_upload_centos8:
|
||||
stage: upload
|
||||
image: $BUILD_IMAGE_CENTOS8
|
||||
before_script:
|
||||
- pwd; ls -l ; cd build ; ls -l
|
||||
- cp /root/rpm_upload_tools.py ./
|
||||
variables:
|
||||
PULP3_REPO_NAME: stellar-stable-x86_64.el8
|
||||
PULP3_DIST_NAME: stellar-stable-x86_64.el8
|
||||
only:
|
||||
- tags
|
||||
tags:
|
||||
- share
|
||||
|
||||
rpm_upload_for_centos8:
|
||||
extends: .define_before_upload_centos8
|
||||
dependencies:
|
||||
- release_build_release_for_centos8
|
||||
script:
|
||||
- python3 rpm_upload_tools.py $PULP3_REPO_NAME $PULP3_DIST_NAME *.rpm
|
||||
Reference in New Issue
Block a user