File tree Expand file tree Collapse file tree 5 files changed +107
-1
lines changed
Expand file tree Collapse file tree 5 files changed +107
-1
lines changed Original file line number Diff line number Diff line change @@ -15,8 +15,13 @@ matrix:
1515 - name : " Ubuntu LTS 2020 (focal)"
1616 dist : focal
1717
18+ - name : " Fedora Copr build"
19+ dist : focal
20+ env :
21+ - COPR_BUILD=yes
22+
1823install :
1924 - sudo apt-get install cmake help2man libboost-dev libboost-filesystem-dev libboost-program-options-dev libboost-python-dev libboost-regex-dev
2025
2126script :
22- - make distcheck
27+ - if test -z "$COPR_BUILD"; then make distcheck; else ./.travis/copr-build ; fi
Original file line number Diff line number Diff line change 1+ Scripts in this directory
2+ -------------------------
3+
4+ copr-build
5+ This script is executed from the .travis.yml 'script' statement.
6+
7+ copr-build-setup
8+ Use this script to configure the remote copr project, it uploads the
9+ 'copr-custom-script' to appropriate Copr project. Execute it like:
10+ $ ./copr-custom-script PR
11+ $ ./copr-custom-script PUSH
12+ .. depending on which webhook/project you want to setup.
13+
14+ copr-custom-script
15+ This script is used in Copr to build the package from the remote git
16+ repository.
Original file line number Diff line number Diff line change 1+ #! /bin/bash -x
2+
3+ # Trigger the build in Copr (from .travis.yml)
4+
5+ set -e
6+ curl -o copr-build https://raw.githubusercontent.com/praiskup/copr-ci-tooling/master/copr-travis-submit
7+ export COPR_PR_WEBHOOK=" https://copr.fedorainfracloud.org/webhooks/custom/46962/a72fe511-c141-4f27-b7cf-de03c065e64e/csdiff/"
8+ exec bash copr-build
Original file line number Diff line number Diff line change 1+ #! /bin/bash -x
2+
3+ # Helper script to update CI scripting on Copr side
4+
5+ script=$( readlink -f " $( dirname " $0 " ) " ) /copr-custom-script
6+
7+ PROJECT_PR=@codescan/csdiff-pull-requests
8+ PROJECT_PUSH=@codescan/csdiff
9+
10+ project=
11+ case $1 in
12+ PR|' ' ) project=$PROJECT_PR ;;
13+ PUSH) project=$PROJECT_PUSH ;;
14+ esac
15+
16+ build_deps=(
17+ boost-devel
18+ boost-python3-devel
19+ bsdtar
20+ cmake
21+ coreutils
22+ gcc-c++
23+ git
24+ help2man
25+ make
26+ python3-devel
27+ )
28+
29+ copr_cmd=(
30+ copr edit-package-custom " $project " \
31+ --webhook-rebuild on \
32+ --script " $script " \
33+ --script-chroot " fedora-latest-x86_64" \
34+ --script-builddeps " ${build_deps[*]} "
35+ )
36+
37+ if test " $1 " ! = PUSH; then
38+ copr_cmd+=( --max-builds 10 )
39+ fi
40+
41+
42+ " ${copr_cmd[@]} " --name csdiff --script-resultdir srpm_results
Original file line number Diff line number Diff line change 1+ #! /bin/bash -x
2+
3+ set -e
4+ set -o pipefail
5+
6+ clone_url_parent=https://github.com/kdudka/csdiff.git
7+
8+ workdir=$( basename " $clone_url_parent " )
9+ workdir=${workdir%% .git}
10+
11+ hook_payload=$( readlink -f " ${HOOK_PAYLOAD-hook_payload} " )
12+
13+ mkdir -p " $COPR_RESULTDIR "
14+ resultdir=$( readlink -f " $COPR_RESULTDIR " )
15+
16+ # clone the helper scripts when needed, and add to PATH
17+ test -d copr-ci-tooling \
18+ || git clone --depth 1 https://github.com/praiskup/copr-ci-tooling.git
19+ export PATH=" $PWD /copr-ci-tooling:$PATH "
20+
21+ # clone the tested project
22+ git clone \
23+ --recursive \
24+ --no-single-branch \
25+ " $clone_url_parent "
26+
27+ # checkout requested revision
28+ cd " $workdir "
29+
30+ copr-travis-checkout " $hook_payload "
31+
32+ ./make-srpm.sh | & tee srpm-build.log
33+ srpm=$( grep Wrote: srpm-build.log | cut -d' ' -f2)
34+ cd " $resultdir "
35+ bsdtar -xf " $srpm "
You can’t perform that action at this time.
0 commit comments