Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
chrzaszcz committed Mar 8, 2023
1 parent 26f10b4 commit f90e68d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 21 deletions.
56 changes: 35 additions & 21 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ references:
# Caches created via the save_cache step are stored for up to 15 days
- &CERT_KEY certs-cache-{{ checksum "certs_cache_key" }}-v3
- &DEPS_CACHE_KEY deps-cache-{{ checksum "rebar.lock" }}-{{ checksum "big_tests/rebar.lock" }}-{{ checksum "otp_version" }}-v4
- &BUILD_CACHE_KEY build-cache-{{ .Branch }}-{{ .Revision }}-{{ checksum "otp_version" }}-v5

# list of references to be used inside executors block
containers:
Expand Down Expand Up @@ -236,16 +235,16 @@ executors:
- *elasticsearch_container
- *cassandra_container
- *cassandra_proxy_container
arm64:
machine:
image: ubuntu-2004:current
resource_class: arm.medium
commands:
fetch_build_packages:
steps:
- run:
name: Install packages necessary for building
command: |
sudo pkill -9 apt-get || true && \
echo "Acquire::ForceIPv4 'true';" | sudo tee -a /etc/apt/apt.conf.d/99force-ipv4 && \
sudo ./tools/retry.sh apt-get update && \
sudo ./tools/retry.sh apt-get install libssl-dev unixodbc-dev unixodbc tdsodbc rsync zlib1g-dev -y
command: $EXEC tools/circle-install-packages.sh
maybe_build_deps_and_cache:
steps:
- restore_cache:
Expand All @@ -266,20 +265,18 @@ commands:
paths:
- ~/project/_build/default/
- ~/project/big_tests/_build/default/
build_and_cache_prod_build:
build_prod:
environment:
BUILD_PATH: _build/prod/rel/mongooseim
steps:
- run:
name: Generate prod release
command: $EXEC make rel
- run:
name: Create prod tarball
command: |
echo $ERLANG_VERSION > otp_version
make rel
- save_cache:
key: *BUILD_CACHE_KEY
paths: ~/project/_build/prod/rel/mongooseim
restore_prod_build:
steps:
- restore_cache:
key: *BUILD_CACHE_KEY
$EXEC export MONGOOSE_TGZ=mongooseim-${ARCH}.tar.gz
$EXEC tar czh --transform="s,${BUILD_PATH},mongooseim,S" -f $MONGOOSE_TGZ ${BUILD_PATH}
persist_workspace:
steps:
- run: git gc
Expand Down Expand Up @@ -406,7 +403,7 @@ commands:
steps:
- run:
name: Prepare for cache
command: echo $ERLANG_VERSION > otp_version
command: $EXEC bash -c 'echo $OTP_VERSION-$ARCH > otp_version'

jobs:
# #########################
Expand All @@ -418,10 +415,8 @@ jobs:
executor:
type: executor
steps:
- checkout
- prepare_for_cache
- restore_workspace
- setup_remote_docker
- restore_prod_build
- run:
name: Execute Docker image build and upload
command: tools/circle-build-and-push-docker.sh
Expand Down Expand Up @@ -479,6 +474,21 @@ jobs:
pip3 install mike
mike deploy $DOCS_TAG --remote [email protected]:esl/MongooseDocs.git --branch gh-pages --push --rebase
build_in_docker_arm64:
executor: arm64
environment:
DOCKER_IMAGE: *OTP25
EXEC: docker exec main
steps:
- run: docker run -dit --name main --rm -v `pwd`:`pwd` $DOCKER_IMAGE
- checkout
- prepare_for_cache
- restore_certs
- fetch_build_packages
- run: $EXEC tools/configure with-all
- build_prod
- persist_workspace

build_in_docker:
executor: << parameters.executor >>
parameters:
Expand All @@ -505,7 +515,7 @@ jobs:
command: ./tools/build-releases.sh
- when:
condition: << parameters.build_prod >>
steps: [ build_and_cache_prod_build ]
steps: [ build_prod ]
- run:
name: Build Big Tests
command: tools/build-tests.sh
Expand Down Expand Up @@ -715,6 +725,9 @@ workflows:
executor: otp_24
context: mongooseim-org
build_prod: false
- build_in_docker_arm64:
name: otp_25_docker_arm64
context: mongooseim-org
# ============= DIALYZER =============
- dialyzer:
name: dialyzer_24
Expand Down Expand Up @@ -905,4 +918,5 @@ workflows:

- xref
- edoc
- otp_25_docker_arm64
filters: *all_tags
8 changes: 8 additions & 0 deletions tools/circle-install-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

sudo pkill -9 apt-get || true
echo "Acquire::ForceIPv4 'true';" | sudo tee -a /etc/apt/apt.conf.d/99force-ipv4
sudo ./tools/retry.sh apt-get update
sudo ./tools/retry.sh apt-get install libssl-dev unixodbc-dev unixodbc tdsodbc rsync zlib1g-dev -y

0 comments on commit f90e68d

Please sign in to comment.