Skip to content

Commit

Permalink
Rename build directory of packaging to pkg-build (vesoft-inc#896)
Browse files Browse the repository at this point in the history
* Rename build directory of packaging to pkg-build

* Ignore pkg-build directory

* Fix build directory

* Fix dockerfile
  • Loading branch information
yixinglu authored Mar 30, 2021
1 parent f9d9e53 commit 6b38db4
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ docs/
*.DS_Store

# build
pkg-build/
build/
_build/
_build.log
_install/
install/
install_manifest.txt

# ccls
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ jobs:
env:
SHA_EXT: sha256sum.txt
run: |
filename=$(find build/cpack_output -type f \( -iname \*.deb -o -iname \*.rpm \))
filename=$(find pkg-build/cpack_output -type f \( -iname \*.deb -o -iname \*.rpm \))
sha256sum $filename > $filename.$SHA_EXT
subdir=$(date -u +%Y.%m.%d)
echo "::set-output name=subdir::$subdir"
- uses: actions/upload-artifact@v1
with:
name: ${{ matrix.os }}-v2-nightly
path: build/cpack_output
path: pkg-build/cpack_output
- uses: ./.github/actions/upload-to-oss-action
with:
key-id: ${{ secrets.OSS_ID }}
key-secret: ${{ secrets.OSS_SECRET }}
endpoint: ${{ secrets.OSS_ENDPOINT }}
bucket: nebula-graph
asset-path: build/cpack_output
asset-path: pkg-build/cpack_output
target-path: package/v2-nightly/${{ steps.vars.outputs.subdir }}
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@ jobs:
SHA_EXT: sha256sum.txt
run: |
tag=$(echo ${{ github.ref }} | rev | cut -d/ -f1 | rev)
filename=$(find build/cpack_output -type f \( -iname \*.deb -o -iname \*.rpm \))
filename=$(find pkg-build/cpack_output -type f \( -iname \*.deb -o -iname \*.rpm \))
sha256sum $filename > $filename.$SHA_EXT
subdir=$(echo $tag |sed 's/^v//')
echo "::set-output name=subdir::$subdir"
- uses: ./.github/actions/upload-assets-action
with:
asset-path: build/cpack_output
asset-path: pkg-build/cpack_output
tag: ${{ steps.tag.outputs.tag }}
- uses: ./.github/actions/upload-to-oss-action
with:
key-id: ${{ secrets.OSS_ID }}
key-secret: ${{ secrets.OSS_SECRET }}
endpoint: ${{ secrets.OSS_ENDPOINT }}
bucket: nebula-graph
asset-path: build/cpack_output
asset-path: pkg-build/cpack_output
target-path: package/${{ steps.vars.outputs.subdir }}

docker_build_graph:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.DS_Store

# build
pkg-build
build
_build
_build.log
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ RUN cd /home/nebula/BUILD/package \

FROM centos:7

COPY --from=builder /home/nebula/BUILD/build/cpack_output/nebula-*-common.rpm /usr/local/nebula/nebula-common.rpm
COPY --from=builder /home/nebula/BUILD/build/cpack_output/nebula-*-graph.rpm /usr/local/nebula/nebula-graphd.rpm
COPY --from=builder /home/nebula/BUILD/pkg-build/cpack_output/nebula-*-common.rpm /usr/local/nebula/nebula-common.rpm
COPY --from=builder /home/nebula/BUILD/pkg-build/cpack_output/nebula-*-graph.rpm /usr/local/nebula/nebula-graphd.rpm

WORKDIR /usr/local/nebula

Expand Down
16 changes: 9 additions & 7 deletions package/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ package_one=ON
strip_enable="FALSE"
usage="Usage: ${0} -v <version> -n <ON/OFF> -s <TRUE/FALSE> -b <BRANCH> -g <ON/OFF>"
project_dir="$(cd "$(dirname "$0")" && pwd)/.."
build_dir=${project_dir}/pkg-build
modules_dir=${project_dir}/modules
storage_dir=${modules_dir}/storage
storage_build_dir=${build_dir}/modules/storage
enablesanitizer="OFF"
static_sanitizer="OFF"
build_type="Release"
Expand Down Expand Up @@ -82,11 +84,10 @@ fi
echo "current version is [ $version ], strip enable is [$strip_enable], enablesanitizer is [$enablesanitizer], static_sanitizer is [$static_sanitizer]"

function _build_storage {
if [ ! -d ${storage_dir} ]; then
if [ ! -d ${storage_dir} && ! -L ${storage_dir} ]; then
git clone --single-branch --branch ${branch} https://github.com/vesoft-inc/nebula-storage.git ${storage_dir}
fi

rm -rf ${storage_dir}/build && mkdir -p ${storage_dir}/build
cmake -DCMAKE_BUILD_TYPE=${build_type} \
-DNEBULA_BUILD_VERSION=${version} \
-DENABLE_ASAN=${san} \
Expand All @@ -98,18 +99,16 @@ function _build_storage {
-DENABLE_TESTING=OFF \
-DENABLE_PACK_ONE=${package_one} \
-S ${storage_dir} \
-B ${storage_dir}/build
-B ${storage_build_dir}

if !( cmake --build ${storage_dir}/build -j ${jobs} ); then
if !( cmake --build ${storage_build_dir} -j ${jobs} ); then
echo ">>> build nebula storage failed <<<"
exit -1
fi
echo ">>> build nebula storage successfully <<<"
}

function _build_graph {
build_dir=${project_dir}/build
rm -rf ${build_dir} && mkdir -p ${build_dir}
cmake -DCMAKE_BUILD_TYPE=${build_type} \
-DNEBULA_BUILD_VERSION=${version} \
-DENABLE_ASAN=${san} \
Expand Down Expand Up @@ -139,7 +138,10 @@ function build {
build_type=$4
branch=$5

rm -rf ${build_dir} && mkdir -p ${build_dir}

if [[ "$build_storage" == "ON" ]]; then
mkdir -p ${storage_build_dir}
_build_storage
fi
_build_graph
Expand All @@ -161,7 +163,7 @@ function package {
-DCMAKE_INSTALL_PREFIX=/usr/local/nebula \
-DENABLE_PACKAGE_STORAGE=${build_storage} \
-DNEBULA_STORAGE_SOURCE_DIR=${storage_dir} \
-DNEBULA_STORAGE_BINARY_DIR=${storage_dir}/build \
-DNEBULA_STORAGE_BINARY_DIR=${storage_build_dir} \
${project_dir}/package/

strip_enable=$1
Expand Down

0 comments on commit 6b38db4

Please sign in to comment.