Files
eagle0/.circleci/config.yml
T
adminandGitHub e08f327bd1 remove all trailing whitespace (#2344)
* remove all trailing whitespace

* fix one scala file


Former-commit-id: c73a66046649b189f5df617fefa6e099b1c05426
2022-11-23 08:22:25 -08:00

213 lines
5.3 KiB
YAML

# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
orbs:
aws-s3: circleci/aws-s3@3.0.0
aws-ecr: circleci/aws-ecr@8.0.0
commands:
setup-tools:
description: |
Setup the Bazel build system used for building bazel projects
steps:
- run:
name: Run bazels3cache
command: bazels3cache --bucket=eagle0bazel
setup-bazelrc:
description: |
Set up the secret used for bazel remote caching
steps:
- run:
name: Create a bazelrc file
command: |
echo "\\\# circleci-specific bazelrc entries"
echo ""
echo "build --remote_cache=http://localhost:7777" >> .bazelrc
echo "build --remote_upload_local_results=true" >> .bazelrc
echo "build --jobs=32" >> .bazelrc
echo "test --remote_cache=http://localhost:7777" >> .bazelrc
echo "test --remote_upload_local_results=true" >> .bazelrc
echo "test --jobs=32" >> .bazelrc
- run:
name: cat the bazelrc file
command: cat .bazelrc
jobs:
test-eagle:
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_eagle_cci.sh
- run:
name: Store test artifacts
when: always
command: mkdir -p /tmp/testlogs-eagle && cp -R ./bazel-testlogs/* /tmp/testlogs-eagle/
- store_test_results:
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-eagle:
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_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:
path: ./deploy/shardok.tar.gz
- persist_to_workspace:
root: deploy
paths:
- shardok.tar.gz
deploy-shardok:
docker:
- image: nolen777/circleci-bazelisk:0.0.8
steps:
- attach_workspace:
at: deploy
- aws-s3/copy:
from: deploy/shardok.tar.gz
to: 's3://eagle0/servers/${CIRCLE_BRANCH}/'
arguments: "--metadata SHA=$(sha256sum deploy/shardok.tar.gz | cut -d' ' -f1)"
deploy-eagle:
docker:
- image: nolen777/circleci-bazelisk:0.0.8
resource_class: large
steps:
- attach_workspace:
at: deploy
- attach_workspace:
at: ci
- setup_remote_docker:
version: 19.03.13
docker_layer_caching: false # true
- aws-ecr/ecr-login:
aws-access-key-id: AWS_ACCESS_KEY_ID
aws-secret-access-key: AWS_SECRET_ACCESS_KEY
region: ${AWS_DEFAULT_REGION}
registry-id: AWS_ECR_REGISTRY_ID
- aws-ecr/build-image:
dockerfile: ./ci/eagle_run.Dockerfile
extra-build-args: '--compress'
no-output-timeout: 20m
path: .
platform: linux/amd64,linux/arm64
public-registry: false
push-image: true
region: ${AWS_DEFAULT_REGION}
registry-id: AWS_ECR_REGISTRY_ID
repo: eagle0
skip-when-tags-exist: false
workflows:
build-workflow:
jobs:
- test-eagle:
filters:
branches:
ignore: main
context:
- bazel
- test-shardok:
filters:
branches:
ignore: main
context:
- bazel
# - build-eagle:
# context:
# - bazel
# - build-shardok:
# context:
# - bazel
# - deploy-shardok:
# filters:
# branches:
# only: main
# requires:
# - build # Only run deploy job once the build job has completed
# - test # Only run if the test job is successful
# context:
# - bazel
# - deploy-eagle:
# filters:
# branches:
# only: main
# requires:
# - build-eagle # Only run deploy job once the build job has completed
# - test-eagle # Only run if the test job is successful
# context:
# - bazel