mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 21:55:42 +00:00
Split builds by eagle & shardok (#1667)
* split test job into eagle & shardok * split the build jobs too Former-commit-id: 74352cd273c2317d7c147cb0bd66a485246fc335
This commit is contained in:
+61
-16
@@ -36,7 +36,7 @@ commands:
|
|||||||
command: cat .bazelrc
|
command: cat .bazelrc
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test-eagle:
|
||||||
docker:
|
docker:
|
||||||
- image: nolen777/circleci-bazelisk:0.0.8
|
- image: nolen777/circleci-bazelisk:0.0.8
|
||||||
|
|
||||||
@@ -48,15 +48,35 @@ jobs:
|
|||||||
- setup-bazelrc
|
- setup-bazelrc
|
||||||
- run:
|
- run:
|
||||||
name: Run tests
|
name: Run tests
|
||||||
command: ./ci/bazel_test_cci.sh
|
command: ./ci/bazel_test_eagle_cci.sh
|
||||||
- run:
|
- run:
|
||||||
name: Store test artifacts
|
name: Store test artifacts
|
||||||
when: always
|
when: always
|
||||||
command: mkdir -p /tmp/testlogs && cp -R ./bazel-testlogs/* /tmp/testlogs/
|
command: mkdir -p /tmp/testlogs-eagle && cp -R ./bazel-testlogs/* /tmp/testlogs-eagle/
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: /tmp/testlogs
|
path: /tmp/testlogs-eagle
|
||||||
|
|
||||||
|
test-shardok:
|
||||||
|
docker:
|
||||||
|
- image: nolen777/circleci-bazelisk:0.0.8
|
||||||
|
|
||||||
|
resource_class: xlarge
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- setup-tools
|
||||||
|
- setup-bazelrc
|
||||||
|
- run:
|
||||||
|
name: Run tests
|
||||||
|
command: ./ci/bazel_test_shardok_cci.sh
|
||||||
|
- run:
|
||||||
|
name: Store test artifacts
|
||||||
|
when: always
|
||||||
|
command: mkdir -p /tmp/testlogs-shardok && cp -R ./bazel-testlogs/* /tmp/testlogs-shardok/
|
||||||
|
- store_test_results:
|
||||||
|
path: /tmp/testlogs-shardok
|
||||||
|
|
||||||
build:
|
build-eagle:
|
||||||
docker:
|
docker:
|
||||||
- image: nolen777/circleci-bazelisk:0.0.8
|
- image: nolen777/circleci-bazelisk:0.0.8
|
||||||
|
|
||||||
@@ -69,7 +89,32 @@ jobs:
|
|||||||
|
|
||||||
- run:
|
- run:
|
||||||
name: Build servers
|
name: Build servers
|
||||||
command: ./ci/build_servers_cci.sh
|
command: ./ci/build_servers_eagle_cci.sh
|
||||||
|
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: deploy
|
||||||
|
paths:
|
||||||
|
- eagle_server_deploy.jar
|
||||||
|
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: ci
|
||||||
|
paths:
|
||||||
|
- eagle_run.Dockerfile
|
||||||
|
|
||||||
|
build-shardok:
|
||||||
|
docker:
|
||||||
|
- image: nolen777/circleci-bazelisk:0.0.8
|
||||||
|
|
||||||
|
resource_class: xlarge
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- setup-tools
|
||||||
|
- setup-bazelrc
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Build servers
|
||||||
|
command: ./ci/build_servers_shardok_cci.sh
|
||||||
|
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: ./deploy/shardok.tar.gz
|
path: ./deploy/shardok.tar.gz
|
||||||
@@ -78,12 +123,6 @@ jobs:
|
|||||||
root: deploy
|
root: deploy
|
||||||
paths:
|
paths:
|
||||||
- shardok.tar.gz
|
- shardok.tar.gz
|
||||||
- eagle_server_deploy.jar
|
|
||||||
|
|
||||||
- persist_to_workspace:
|
|
||||||
root: ci
|
|
||||||
paths:
|
|
||||||
- eagle_run.Dockerfile
|
|
||||||
|
|
||||||
deploy-shardok:
|
deploy-shardok:
|
||||||
docker:
|
docker:
|
||||||
@@ -135,10 +174,16 @@ jobs:
|
|||||||
workflows:
|
workflows:
|
||||||
build-workflow:
|
build-workflow:
|
||||||
jobs:
|
jobs:
|
||||||
- test:
|
- test-eagle:
|
||||||
context:
|
context:
|
||||||
- bazel
|
- bazel
|
||||||
- build:
|
- test-shardok:
|
||||||
|
context:
|
||||||
|
- bazel
|
||||||
|
- build-eagle:
|
||||||
|
context:
|
||||||
|
- bazel
|
||||||
|
- build-shardok:
|
||||||
context:
|
context:
|
||||||
- bazel
|
- bazel
|
||||||
# - deploy-shardok:
|
# - deploy-shardok:
|
||||||
@@ -155,7 +200,7 @@ workflows:
|
|||||||
branches:
|
branches:
|
||||||
only: main
|
only: main
|
||||||
requires:
|
requires:
|
||||||
- build # Only run deploy job once the build job has completed
|
- build-eagle # Only run deploy job once the build job has completed
|
||||||
- test # Only run if the test job is successful
|
- test-eagle # Only run if the test job is successful
|
||||||
context:
|
context:
|
||||||
- bazel
|
- bazel
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
COMMAND_LOG="$(bazel --output_base=${BAZEL_OUTPUT_BASE} info command_log)"
|
|
||||||
bazel --output_base=${BAZEL_OUTPUT_BASE} test \
|
|
||||||
//src/test/...
|
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
bazel test \
|
||||||
|
//src/test/scala/...
|
||||||
@@ -4,4 +4,4 @@ set -e
|
|||||||
set -x
|
set -x
|
||||||
|
|
||||||
bazel test \
|
bazel test \
|
||||||
//src/test/...
|
//src/test/cpp/...
|
||||||
Executable
+27
@@ -0,0 +1,27 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
COMMAND_LOG="$(bazel info command_log)"
|
||||||
|
bazel build \
|
||||||
|
//src/main/scala/net/eagle0/eagle:eagle_server_deploy.jar
|
||||||
|
STATUS="$?"
|
||||||
|
|
||||||
|
if [ $STATUS -eq 0 ]
|
||||||
|
then
|
||||||
|
echo "Build succeeded!" > command_log.txt
|
||||||
|
else
|
||||||
|
echo "Build failed. Copying command log from ${COMMAND_LOG}"
|
||||||
|
cp "${COMMAND_LOG}" command_log.txt
|
||||||
|
exit $STATUS
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Removing old server files..."
|
||||||
|
/bin/rm -rf ./deploy
|
||||||
|
/bin/mkdir -p ./deploy
|
||||||
|
|
||||||
|
echo "Copying eagle jar..."
|
||||||
|
/bin/cp -R ./bazel-bin/src/main/scala/net/eagle0/eagle/eagle_server_deploy.jar ./deploy/
|
||||||
|
|
||||||
|
echo "build_servers_eagle completed"
|
||||||
@@ -6,8 +6,7 @@ set -x
|
|||||||
COMMAND_LOG="$(bazel info command_log)"
|
COMMAND_LOG="$(bazel info command_log)"
|
||||||
bazel build \
|
bazel build \
|
||||||
//src/main/cpp/net/eagle0/shardok:shardok-server \
|
//src/main/cpp/net/eagle0/shardok:shardok-server \
|
||||||
//src/main/cpp/net/eagle0/shardok:shardok-inspector \
|
//src/main/cpp/net/eagle0/shardok:shardok-inspector
|
||||||
//src/main/scala/net/eagle0/eagle:eagle_server_deploy.jar
|
|
||||||
STATUS="$?"
|
STATUS="$?"
|
||||||
|
|
||||||
if [ $STATUS -eq 0 ]
|
if [ $STATUS -eq 0 ]
|
||||||
@@ -21,8 +20,6 @@ fi
|
|||||||
|
|
||||||
echo "Removing old server files..."
|
echo "Removing old server files..."
|
||||||
/bin/rm -rf ./shardok
|
/bin/rm -rf ./shardok
|
||||||
/bin/rm -rf ./deploy
|
|
||||||
/bin/mkdir -p ./deploy
|
|
||||||
|
|
||||||
echo "Setting up Shardok files..."
|
echo "Setting up Shardok files..."
|
||||||
/bin/mkdir -p ./shardok
|
/bin/mkdir -p ./shardok
|
||||||
@@ -31,10 +28,7 @@ echo "Setting up Shardok files..."
|
|||||||
/bin/cp -R ./bazel-bin/src/main/cpp/net/eagle0/shardok/shardok-server.runfiles/net_eagle0/src/main/resources ./shardok/shardok-server.runfiles/net_eagle0/src/main/
|
/bin/cp -R ./bazel-bin/src/main/cpp/net/eagle0/shardok/shardok-server.runfiles/net_eagle0/src/main/resources ./shardok/shardok-server.runfiles/net_eagle0/src/main/
|
||||||
/bin/cp -R ./bazel-bin/src/main/cpp/net/eagle0/shardok/shardok-inspector ./shardok/
|
/bin/cp -R ./bazel-bin/src/main/cpp/net/eagle0/shardok/shardok-inspector ./shardok/
|
||||||
|
|
||||||
echo "Copying eagle jar..."
|
|
||||||
/bin/cp -R ./bazel-bin/src/main/scala/net/eagle0/eagle/eagle_server_deploy.jar ./deploy/
|
|
||||||
|
|
||||||
echo "tar & zip shardok files..."
|
echo "tar & zip shardok files..."
|
||||||
/bin/tar cfh - shardok | /usr/bin/pigz > ./deploy/shardok.tar.gz
|
/bin/tar cfh - shardok | /usr/bin/pigz > ./deploy/shardok.tar.gz
|
||||||
|
|
||||||
echo "bazel_build_servers completed"
|
echo "build_servers_shardok completed"
|
||||||
Reference in New Issue
Block a user