Skip to content

Commit

Permalink
package nebula graph according to environment variables (vesoft-inc#2603
Browse files Browse the repository at this point in the history
)

* Support yueshu package in workflow

* Fix bug

* Add release job for yueshu package

* fix company name

* restore preinst

* restore

* Update preinst

Modify the Chinese part of the variable name

* Update CMakeLists.txt

Add variable name PROD_NAME_CN

* Update preinst

fix format

---------

Co-authored-by: George <[email protected]>
Co-authored-by: Sophie <[email protected]>
  • Loading branch information
3 people authored Apr 18, 2023
1 parent 5580140 commit d7031e5
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 101 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@ jobs:
-k ${{ secrets.OSS_SECRET }} \
-e ${{ secrets.OSS_ENDPOINT }} \
oss://nebula-graph-ent/general/nebula-graph/rc/${{ steps.tag.outputs.tagnum }}/ \
oss://nebula-graph-ent/general/nebula-graph/${{ steps.tag.outputs.tagnum }}
oss://nebula-graph-ent/general/nebula-graph/${{ steps.tag.outputs.tagnum }}
ossutil64 cp -rf \
-i ${{ secrets.OSS_ID }} \
-k ${{ secrets.OSS_SECRET }} \
-e ${{ secrets.OSS_ENDPOINT }} \
oss://nebula-graph-ent/general/nebula-graph/rc/${{ steps.tag.outputs.tagnum }}/symbols \
oss://nebula-graph-ent/general/nebula-graph/${{ steps.tag.outputs.tagnum }}
oss://nebula-graph-ent/general/nebula-graph/${{ steps.tag.outputs.tagnum }}
docker_build:
name: docker-build
Expand Down
8 changes: 1 addition & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,5 @@ nebula_add_subdirectory(src)
nebula_add_subdirectory(conf)
nebula_add_subdirectory(resources)
nebula_add_subdirectory(scripts)
nebula_add_subdirectory(package)

include(CPackage)
package(
${ENABLE_PACK_ONE}
"nebula-graph-ent"
"https://github.com/vesoft-inc/nebula/releases"
${CMAKE_SOURCE_DIR}/package
)
6 changes: 4 additions & 2 deletions cmake/CPackage.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,12 @@ macro(package to_one name home_page scripts_dir)
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE ${CMAKE_HOST_SYSTEM_PROCESSOR})
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ${home_page})

set(PREINST_PATH ${CMAKE_BINARY_DIR}/package/preinst)

if(ENABLE_EULA)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${scripts_dir}/postinst)
else()
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${scripts_dir}/preinst ${scripts_dir}/postinst)
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA ${PREINST_PATH} ${scripts_dir}/postinst)
endif()

set(CPACK_RPM_SPEC_MORE_DEFINE "%define debug_package %{nil}
Expand All @@ -158,7 +160,7 @@ macro(package to_one name home_page scripts_dir)
set(CPACK_RPM_PACKAGE_URL ${home_page})
set(CPACK_RPM_POST_INSTALL_SCRIPT_FILE ${scripts_dir}/rpm_postinst)
if(ENABLE_EULA)
set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE ${scripts_dir}/preinst)
set(CPACK_RPM_PRE_INSTALL_SCRIPT_FILE ${PREINST_PATH})
endif()
set(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION /usr/local)
set(CPACK_RPM_PACKAGE_RELOCATABLE ON)
Expand Down
35 changes: 35 additions & 0 deletions package/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Copyright (c) 2023 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License.

macro(env_or_default name default_val)
if ("$ENV{${name}}" STREQUAL "")
set(${name} ${default_val})
else()
set(${name} $ENV{${name}})
endif()
message(STATUS "${name}: ${${name}}")
endmacro()

env_or_default(COMPANY "vesoft")
env_or_default(COMPANY_CN "杭州欧若数网科技有限公司")
env_or_default(PROD_NAME "NebulaGraph")
env_or_default(PROD_NAME_CN "NebulaGraph")
env_or_default(PKG_NAME "nebula-graph-ent")
env_or_default(RELEASE_URL "https://github.com/vesoft-inc/nebula-ent/releases")
env_or_default(DOC_URL "https://docs.nebula-graph.io")
env_or_default(PROD_URL "https://nebula-graph.io")

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/preinst
${CMAKE_CURRENT_BINARY_DIR}/preinst
)

include(CPackage)

package(
${ENABLE_PACK_ONE}
${PKG_NAME}
${RELEASE_URL}
${CMAKE_SOURCE_DIR}/package
)
3 changes: 1 addition & 2 deletions package/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function _default_release_variables {
enable_breakpad="ON"
add_EULA="ON"
enable_standalone="OFF"

}

# change default variables. e.g. build release in docker
Expand Down Expand Up @@ -209,7 +208,7 @@ function package {
# rename package file
outputDir=$build_dir/cpack_output
mkdir -p ${outputDir}
for pkg_name in $(ls ./*nebula*-${version}*); do
for pkg_name in $(ls ./*graph*-${version}*); do
mv ${pkg_name} ${outputDir}/
echo "####### target package file is ${outputDir}/${pkg_name}"
done
Expand Down
Loading

0 comments on commit d7031e5

Please sign in to comment.