From 50dc7c9bb3ca0f666919949721dab1b12ef48128 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chrz=C4=85szcz?= Date: Tue, 7 Mar 2023 10:11:21 +0100 Subject: [PATCH] WIP --- .circleci/template.yml | 37 ++++++++++++++++++++++---------- tools/circle-install-packages.sh | 8 +++++++ 2 files changed, 34 insertions(+), 11 deletions(-) create mode 100755 tools/circle-install-packages.sh diff --git a/.circleci/template.yml b/.circleci/template.yml index 383fa1d218a..ee48ddc6963 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -6,8 +6,8 @@ references: - &ENTRYPOINT ["/bin/sh", "-c", "eval ${INSTALL_DEPS_CMD:-echo} && echo __INJECT_FILES__ | eval ${BASE32DEC:-base32 --decode} | bash"] # 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 + - &DEPS_CACHE_KEY deps-cache-{{ checksum "rebar.lock" }}-{{ checksum "big_tests/rebar.lock" }}-{{ cat "otp_version" }}-v4 + - &BUILD_CACHE_KEY build-cache-{{ .Branch }}-{{ .Revision }}-{{ cat "otp_version" }}-v5 # list of references to be used inside executors block containers: @@ -236,16 +236,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: @@ -270,9 +270,7 @@ commands: steps: - run: name: Generate prod release - command: | - echo $ERLANG_VERSION > otp_version - make rel + command: $EXEC make rel - save_cache: key: *BUILD_CACHE_KEY paths: ~/project/_build/prod/rel/mongooseim @@ -406,7 +404,7 @@ commands: steps: - run: name: Prepare for cache - command: echo $ERLANG_VERSION > otp_version + command: $EXEC echo ${OTP_VERSION}-${ARCH} > otp_version jobs: # ######################### @@ -479,6 +477,20 @@ jobs: pip3 install mike mike deploy $DOCS_TAG --remote git@github.com: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_and_cache_prod_build + build_in_docker: executor: << parameters.executor >> parameters: @@ -715,6 +727,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 diff --git a/tools/circle-install-packages.sh b/tools/circle-install-packages.sh new file mode 100755 index 00000000000..547be03a262 --- /dev/null +++ b/tools/circle-install-packages.sh @@ -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