Commit fd60b090 authored by IOhannes m zmölnig's avatar IOhannes m zmölnig
Browse files

split job-configuration into template/instantiations

parent 8cfd76d7
#######################################################################
### .git-ci/gitlab-iem.yml for Pd externals: v2.0
###
### this file contains the template definitions for various build/deploy jobs
###
### the jobs found here can be used for any external with a build system like:
### - 'make' builds the external
### - 'make install' installs the external to be used by Pd
### the following make variables must be honoured:
### - extension: filename extension for externals
### - DESTDIR: base directory for 'make install'
### - pkglibdir: directory to put externals into (relative to DESTDIR)
### some more expectations:
### - 'make install' will put all relevant files into ${DESTDIR}/${pkglibdir}/${CI_PROJECT_NAME}
###
### one well known build-system that can be used straight away is
### "pd-lib-builder" -> https://github.com/pure-data/pd-lib-builder/
#######################################################################
variables:
PDVERSION: 0.50-2
SRCDIR: .
IEM_CI_PKGLIBDIR: .git-ci/_build/
#######################################################################
### script snippets
.script:fetch_localdeps: &script_fetch_localdeps
- test -e .git-ci/localdeps.win.sh || (wget -q -O .git-ci/localdeps.win.sh "https://git.iem.at/pd/iem-ci/raw/master/pd-lib-builder/localdeps.win.sh" && chmod +x .git-ci/localdeps.win.sh) || true
- test -e .git-ci/localdeps.macos.sh || (wget -q -O .git-ci/localdeps.macos.sh "https://git.iem.at/pd/iem-ci/raw/master/pd-lib-builder/localdeps.macos.sh" && chmod +x .git-ci/localdeps.macos.sh) || true
## build snippets
.script:make: &script_make
- make -C "${SRCDIR}" ${pd_extension:+extension=}${pd_extension} ${TARGETARCH:+PLATFORM=}${TARGETARCH}
.script:make_check: &script_make_check
# the 'make --version' invocation is used to detect cross-compilation
- if make --version | egrep $(echo ${TARGETARCH:-$(${CC:-cc} -dumpmachine)} | sed -e 's|-.*-|-.*-|') && make -C "${SRCDIR}" check -n ${pd_extension:+extension=}${pd_extension} ${TARGETARCH:+PLATFORM=}${TARGETARCH} >/dev/null 2>&1 ; then make -C "${SRCDIR}" check ${pd_extension:+extension=}${pd_extension} ${TARGETARCH:+PLATFORM=}${TARGETARCH}; else echo "no 'check' target or cross-compiling...skipping"; fi
.script:make_install: &script_make_install
- rm -rf "${IEM_CI_PKGLIBDIR}"
- make -C "${SRCDIR}" install ${pd_extension:+extension=}${pd_extension} ${TARGETARCH:+PLATFORM=}${TARGETARCH} DESTDIR="$(pwd)" pkglibdir="/${IEM_CI_PKGLIBDIR}/"
- rm -rf "${CI_PROJECT_NAME}"
- mv "${IEM_CI_PKGLIBDIR}/${CI_PROJECT_NAME}" .
#######################################################################
### configuration templates (to be used for snapshot and release builds)
.build:script:
stage: build
script:
- *script_make
- *script_make_check
- *script_make_install
.build:snapshot: &snapshot
except:
- tags
artifacts: &snapshot_artifacts
name: ${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME%_*}
paths:
- "${CI_PROJECT_NAME}"
expire_in: 1 week
.build:release: &release
only:
- tags
artifacts: &release_artifacts
name: ${CI_PROJECT_NAME}_${CI_COMMIT_REF_NAME}_${CI_JOB_NAME%_*}
paths:
- "${CI_PROJECT_NAME}"
.build:linux: &build_linux
extends: .build:script
image: registry.git.iem.at/devtools/docker/debiancross:amd64
before_script:
- apt-get update
- rm -rf "${IEM_CI_PKGLIBDIR}"
- mkdir -p "${IEM_CI_PKGLIBDIR}"
- if [ -e .git-ci/requirements.apt ]; then apt-get install -y --no-install-recommends equivs; equivs-control "${IEM_CI_PKGLIBDIR}"/builddeps; sed -e "s|^\(Package:\) .*|\1 builddeps-${CI_PROJECT_NAME}|" -e '/^Depends/d' -i "${IEM_CI_PKGLIBDIR}"/builddeps; (echo "Depends:"" puredata-dev, puredata-core,"; cat .git-ci/requirements.apt | sed -e 's|#.*||' -e 's|[[:space:],]*$||' -e '/^$/d' -e 's|$|,|' -e 's|^[[:space:]]*| |') >> "${IEM_CI_PKGLIBDIR}"/builddeps; (cd ${IEM_CI_PKGLIBDIR}/; equivs-build ${TARGETDEBARCH:+-a} ${TARGETDEBARCH} builddeps; find . -name "*.deb" -exec dpkg -i {} + || apt-get -f install -y --no-install-recommends); else apt-get install -y --no-install-recommends build-essential puredata-dev puredata-core; fi
- rm -rf "${IEM_CI_PKGLIBDIR}"
- export PD=/usr/bin/pd
.build:linux_i386: &build_linux_i386
extends: .build:linux
image: registry.git.iem.at/devtools/docker/debiancross:i386
variables:
pd_extension: l_i386
.build:linux_armhf: &build_linux_armhf
extends: .build:linux
image: registry.git.iem.at/devtools/docker/debiancross:armhf
variables:
pd_extension: l_arm
.build:linux_arm64: &build_linux_arm64
extends: .build:linux
image: registry.git.iem.at/devtools/docker/debiancross:arm64
variables:
pd_extension: l_arm64
.build:macos: &build_macos
extends: .build:script
tags:
- osx
before_script:
- if [ -e .git-ci/requirements.brew ]; then brew bundle --no-upgrade --file=.git-ci/requirements.brew; fi
- wget -q -O Pd.tgz http://msp.ucsd.edu/Software/pd-${PDVERSION}.mac.tar.gz
- rm -rf /Applications/Pd*.app/
- tar xvf Pd.tgz -C /Applications/
- rm -f Pd.tgz
- export PD=$(find /Applications/Pd*.app/Contents/Resources/bin/ type f -name pd -print -quit)
after_script:
- *script_fetch_localdeps
- if [ -x .git-ci/localdeps.macos.sh ]; then find "${CI_PROJECT_NAME}" -type f "(" -name "*.pd_darwin" -o -name "*.so" ")" -exec .git-ci/localdeps.macos.sh {} +; fi
.build:w32: &build_w32
extends: .build:script
tags:
- windows
variables:
IEMCI_CONFIGURATIONS: mingw32
before_script:
- if [ -e .git-ci/requirements.msys2 ]; then pacman --noconfirm -S --needed $(cat .git-ci/requirements.msys2 | sed -e 's|#.*||' -e "s|@MINGW@|${MINGW_PACKAGE_PREFIX}-|"); fi
- wget -q -O Pd.zip http://msp.ucsd.edu/Software/pd-${PDVERSION}-i386.msw.zip
- rm -rf "${PROGRAMFILESX86}/pd" && mkdir -p "${PROGRAMFILESX86}/pd"
- unzip -q Pd.zip -d "${PROGRAMFILESX86}/pd"
- mv -v "${PROGRAMFILESX86}/pd"/*/* "${PROGRAMFILESX86}/pd"
- rm -f Pd.zip
- export PD="${PROGRAMFILESX86}/pd/bin/pd.com"
after_script:
- *script_fetch_localdeps
- if [ -x .git-ci/localdeps.win.sh ]; then find "${CI_PROJECT_NAME}" -type f "(" -name "*.${pd_extension:-m_i386}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec .git-ci/localdeps.win.sh {} +; fi
.build:w64: &build_w64
extends: .build:script
tags:
- windows
variables:
IEMCI_CONFIGURATIONS: mingw64
pd_extension: m_amd64
before_script:
- if [ -e .git-ci/requirements.msys2 ]; then pacman --noconfirm -S --needed $(cat .git-ci/requirements.msys2 | sed -e 's|#.*||' -e "s|@MINGW@|${MINGW_PACKAGE_PREFIX}-|"); fi
- wget -q -O Pd.zip http://msp.ucsd.edu/Software/pd-${PDVERSION}.msw.zip
- rm -rf "${PROGRAMFILES}/pd" && mkdir -p "${PROGRAMFILES}/pd"
- unzip -q Pd.zip -d "${PROGRAMFILES}/pd"
- mv -v "${PROGRAMFILES}/pd"/*/* "${PROGRAMFILES}/pd"
- rm -f Pd.zip
- export PD="${PROGRAMFILES}/pd/bin/pd.com"
after_script:
- *script_fetch_localdeps
- if [ -x .git-ci/localdeps.win.sh ]; then find "${CI_PROJECT_NAME}" -type f "(" -name "*.${pd_extension:-m_amd64}" -o -name "*.dll" -o -name "*.exe" -o -name "*.com" ")" -exec .git-ci/localdeps.win.sh {} +; fi
#######################################################################
### the actual jobs: (linux,macos,windows)*(release,snapshot)
### release jobs
.Linux:
<<: *build_linux
<<: *release
.Linuxi386:
allow_failure: true
<<: *build_linux_i386
<<: *release
.LinuxARMhf:
allow_failure: true
<<: *build_linux_armhf
<<: *release
.LinuxARM64:
allow_failure: true
<<: *build_linux_arm64
<<: *release
.Darwin:
<<: *build_macos
<<: *release
.w32:
<<: *build_w32
<<: *release
.w64:
<<: *build_w64
<<: *release
### snapshot jobs
.Linux_snapshot:
<<: *build_linux
<<: *snapshot
.Linuxi386_snapshot:
allow_failure: true
<<: *build_linux_i386
<<: *snapshot
.LinuxARMhf_snapshot:
allow_failure: true
<<: *build_linux_armhf
<<: *snapshot
.LinuxARM64_snapshot:
allow_failure: true
<<: *build_linux_arm64
<<: *snapshot
.Darwin_snapshot:
<<: *build_macos
<<: *snapshot
.w32_snapshot:
<<: *build_w32
<<: *snapshot
.w64_snapshot:
<<: *build_w64
<<: *snapshot
#######################################################################
### create deken packages and (optionally) upload them;
### if you want to automatically upload a package, you need to
### set DEKEN_USERNAME/DEKEN_PASSWORD in the CI-project settings.
### (https://git.iem.at/help/ci/variables/README#variables)
.deken:
stage: deploy
image: debian:buster
only:
- tags
variables:
DEKEN_ROOT: "yes"
before_script:
- apt-get update && apt-get --no-install-recommends -y install deken git
script:
- chmod -R go-w .
# create source package
- git archive --format=tar --prefix=tmp/${CI_PROJECT_NAME}/ HEAD | tar xf -
- deken package --version="${CI_COMMIT_TAG#v}" "tmp/${CI_PROJECT_NAME}"
# create binary package
- deken package --version="${CI_COMMIT_TAG#v}" "${CI_PROJECT_NAME}"
# upload deken packages
- test -z "${DEKEN_USERNAME}" || test -z "${DEKEN_PASSWORD}" || deken upload --no-source-error ./*.dek
artifacts:
name: deken-package
paths:
- ./*.dek
#######################################################################
### .git-ci/gitlab-iem.yml for Pd externals: v2.0
###
### this can be used for any external with a build system like:
### - 'make' builds the external
### - 'make install' installs the external to be used by Pd
### the following make variables must be honoured:
### - extension: filename extension for externals
### - DESTDIR: base directory for 'make install'
### - pkglibdir: directory to put externals into (relative to DESTDIR)
### some more expectations:
### - 'make install' will put all relevant files into ${DESTDIR}/${pkglibdir}/${CI_PROJECT_NAME}
###
### one well known build-system that can be used straight away is
### "pd-lib-builder" -> https://github.com/pure-data/pd-lib-builder/
#######################################################################
variables:
PDVERSION: 0.50-2
SRCDIR: .
IEM_CI_PKGLIBDIR: .git-ci/_build/
#######################################################################
### the actual jobs: (linux,macos,windows)*(release,snapshot)
### the job-templates can be found in 'iem-ci.yml' (which must be included beforehand)
### release jobs
Linux:
extends: .Linux
Linuxi386:
extends: .Linuxi386
allow_failure: true
LinuxARMhf:
extends: .LinuxARMhf
allow_failure: true
LinuxARM64:
extends: .LinuxARM64
allow_failure: true
Darwin:
extends: .Darwin
w32:
extends: .w32
w64:
extends: .w64
### snapshot jobs
Linux_snapshot:
extends: .Linux_snapshot
Linuxi386_snapshot:
extends: .Linuxi386_snapshot
allow_failure: true
LinuxARMhf_snapshot:
extends: .LinuxARMhf_snapshot
allow_failure: true
LinuxARM64_snapshot:
extends: .LinuxARM64_snapshot
allow_failure: true
Darwin_snapshot:
extends: .Darwin_snapshot
w32_snapshot:
extends: .w32_snapshot
w64_snapshot:
extends: .w64_snapshot
#######################################################################
### create deken packages and (optionally) upload them;
### if you want to automatically upload a package, you need to
### set DEKEN_USERNAME/DEKEN_PASSWORD in the CI-project settings.
### (https://git.iem.at/help/ci/variables/README#variables)
deken:
extends: .deken
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment