From 30119ef34ed4e2cc73fcbc2873919fa5a0101162 Mon Sep 17 00:00:00 2001 From: samm2 <samm2@4ea69e1a-61f1-4043-bf83-b5c94c648137> Date: Mon, 9 Oct 2017 10:52:07 +0000 Subject: [PATCH] circleci: adding build instructions for the all supported branches git-svn-id: https://svn.code.sf.net/p/smartmontools/code/branches/RELEASE_6_0_DRIVEDB@4530 4ea69e1a-61f1-4043-bf83-b5c94c648137 --- .circleci/config.yml | 79 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..cf26e78b2 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,79 @@ +version: 2 + +# this yml is for checking drivedb.h validity and should be used only inside branches +# steps: +# 1. get and build smartmontools of the specific version +# 2. fetch drivedb.h from the appropriate branch +# 3. run `make check` on the working tree to check drivedb.h validity +# + + +references: + + get_svn_commit: &get_svn_commit + run: + name: Get SVN revision from the git SHA1 using github API + command: > + curl --silent + https://api.github.com/repos/${CIRCLE_PROJECT_USERNAME}/${CIRCLE_PROJECT_REPONAME}/commits/${CIRCLE_SHA1} | + jq .commit.message | + sed -E "s|.*git-svn-id: http://svn.code.sf.net/p/smartmontools/code/branches/${CIRCLE_BRANCH#origin/}@([0-9]+).*|\1|" > + ~/SVNREV && test "`cat ~/SVNREV`" -gt "0" && echo SVN revision: r`cat ~/SVNREV` + + svn_checkout: &svn_checkout + run: + name: Checkout from the SF.net + command: > + rel=${CIRCLE_BRANCH#origin/} && rel=${rel%_DRIVEDB} && echo $rel > ~/SM_REL && + svn --config-option 'config:miscellany:use-commit-times=yes' checkout + https://svn.code.sf.net/p/smartmontools/code/tags/${rel}/smartmontools + ~/smartmontools && + svn cat https://svn.code.sf.net/p/smartmontools/code/branches/${CIRCLE_BRANCH#origin/}/smartmontools/drivedb.h@`cat ~/SVNREV` > + ~/smartmontools/drivedb.h + + sm_distfile: &sm_distfile + run: + name: Creating src.tar.gz + command: | + cd ~/smartmontools + sed -n 's|^AC_INIT[^,]*, *\([0-9.]*\) *,.*$|\1|p' "configure.ac" > ~/SM_VER + SM_VER=`cat ~/SM_VER` && SVNREV=`cat ~/SVNREV` + ./autogen.sh --force + mkdir build && cd build + ../configure + make dist + mkdir /artefacts && mv smartmontools-${SM_VER}.tar.gz /artefacts/smartmontools-${SM_VER}-r${SVNREV}.src.tar.gz + + sm_comple_linux: &sm_compile_linux + run: + name: Checking drivedb.h with a specific smartmontools version + command: | + SM_VER=`cat ~/SM_VER` && SVNREV=`cat ~/SVNREV` + mkdir ~/build && cd ~/build + tar -xvzf /artefacts/smartmontools-${SM_VER}-r${SVNREV}.src.tar.gz + cd smartmontools-${SM_VER} && mkdir build && cd build + ../configure && make -j2 && make check + rm -rf ~/build + +jobs: + + test_ubuntu_latest: + docker: + - image: sammcz/docker-build:latest + working_directory: ~/smartmontools + steps: + - *get_svn_commit + - *svn_checkout + - *sm_distfile + - *sm_compile_linux + +workflows: + + version: 2 + test-matrix: + jobs: + - test_ubuntu_latest + +#notify: +# webhooks: +# - url: https://builds-ci.smartmontools.org/hook.php -- GitLab