Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
add circleci config
Browse files Browse the repository at this point in the history
  • Loading branch information
rfay committed Oct 19, 2021
1 parent 3f1c1f5 commit 1d08395
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
version: 2

workflows:
version: 2
# normal_build_and_test:
# jobs:
# - build_and_test

release:
jobs:
- release:
context: xtrabackup-build
filters:
tags:
only:
- "/.*/"
branches:
ignore: /.*/

jobs:
release:
environment:
CI: "true"
BUILDKIT_PROGRESS: plain
# Builds on arm64
machine:
image: ubuntu-2004:202101-01
resource_class: arm.medium
steps:
- checkout
- restore_cache:
keys:
- xtrabackup-v1
- run: ./.circleci/linux_circle_vm_setup.sh
- run: cd xtrabackup-8.0 >/dev/null && ./build.sh && popd >/dev/null
- save_cache:
key: xtrabackup-v1
paths:
- xtrabackup-8.0/percona-xtrabackup
- run:
name: Upload artifacts to GitHub release page
command: |
if [ ! -z "${GTOKEN}" ]; then
echo "GTOKEN provided, pushing release ${CIRCLE_TAG}"
echo ${GTOKEN} | gh auth login --with-token
gh release upload --clobber ${CIRCLE_TAG} xtrabackup-8.0/install/xtrabackup-*tar.gz*
echo | gh auth logout --hostname=github.com
else
echo "GTOKEN not provided, not pushing release $CIRCLE_TAG"
fi
36 changes: 36 additions & 0 deletions .circleci/linux_circle_vm_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

set -eu -o pipefail
set -x

case $(arch) in
x86_64)
ARCH=amd64
;;
aarch64)
ARCH=arm64
;;
*)
echo "Unknown architecture" && exit 1
;;
esac


# Get recent qemu to avoid constant qemu crashes on Ubuntu 20.04
# Incomprehensible discussions of the problem at
# https://bugs.launchpad.net/ubuntu/+source/qemu/+bug/1928075
sudo add-apt-repository ppa:jacob/virtualisation

sudo apt-get -qq update && sudo apt-get -qq install -y docker-ce-cli binfmt-support qemu qemu-user qemu-user-static >/dev/null


# Get recent buildx
mkdir -p ~/.docker/cli-plugins && curl -sSL -o ~/.docker/cli-plugins/docker-buildx https://github.com/docker/buildx/releases/download/v0.6.3/buildx-v0.6.3.linux-${ARCH} && chmod +x ~/.docker/cli-plugins/docker-buildx

docker buildx version

if ! docker buildx inspect ddev-builder-multi --bootstrap >/dev/null; then docker buildx create --name ddev-builder-multi --use; fi
docker buildx inspect --bootstrap

# Install github's gh tool
wget -O /tmp/gh.deb https://github.com/cli/cli/releases/download/v2.1.0/gh_2.1.0_linux_${ARCH}.deb && sudo dpkg -i /tmp/gh.deb >/dev/null
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# xtrabackup build

This repo builds xtrabackup-8.0 for arm64 machine. It's used by
drud/mysql-arm64-images and [ddev](https://github.com/drud/ddev).

0 comments on commit 1d08395

Please sign in to comment.