Commit 5724ae63 authored by Simon McVittie's avatar Simon McVittie

Jenkins: Autobuild sample app-bundles

This assumes that the worker system has a semi-recent Apertis
/etc/image_version, like this dummy one that I installed on the
current worker 'gouda':

    apertis 17.06 0 collabora

(gouda is really a 15.x system that has been upgraded extensively
via apt, so its original image version is not really applicable
any more.)

We should ideally add the --build-dir option too, but that doesn't
work yet in at least helloworld-simple-agent.

Apertis: https://phabricator.apertis.org/T4008Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D6859
parent a68bee1d
- job-template:
name: '{project}-{distro}/samples/build-{package}'
description: |
Do not edit this job through the web!
See https://git.apertis.org/cgit/apertis-customizations.git/tree/development/jenkins/apertis-build-sample.yaml
Continuous integration for each git commit - sample app-bundles
This job builds a sample app-bundle using ade.
<https://git.apertis.org/cgit/sample-applications/>
project-imagetype: freestyle
node: apertis-development
properties:
- inject:
properties-content: |
PROJECT: {project}
DISTRO: {distro}
PACKAGE: {package}
scm:
- git:
skip-tag: true
url: '{repobase}/apertis-dev-tools.git'
branches:
- '*/{branch}'
basedir: apertis-dev-tools
excluded-regions:
- '.*'
wipe-workspace: false
- git:
skip-tag: true
url: '{repobase}/sample-applications/{package}.git'
branches:
- '*/{branch}'
credentials-id: 'df7b609b-df30-431d-a942-af263af80571'
basedir: '{package}'
wipe-workspace: false
wrappers:
- timestamps
- credentials-binding:
- file:
credential-id: 349d474d-a6d0-4ab0-987a-a3843916bdff
variable: OSCRC
triggers:
- pollscm:
cron: "H/5 * * * *"
builders:
- shell:
!include-raw-escape: 'scripts/build-sample.py'
publishers:
- archive:
artifacts: '{package}/*.bundle'
flatten: true
only-if-success: 'true'
- email:
recipients: '{maintainers}'
send-to-individuals: true
- workspace-cleanup:
dirmatch: true
exclude: [ "ccache/**", "apertis-dev-tools/**", "{package}/**" ]
- job-group:
name: 'build-sample'
package:
- cpp-library-example
- hard-keys-example
- helloworld-agentapp
- helloworld-app
- helloworld-https-client
- helloworld-newport
- helloworld-persistapp
- helloworld-prefsapp
- helloworld-simple-agent
- helloworld-webapp
- notification-example
jobs:
- '{project}-{distro}/samples/build-{package}'
- project:
name: 'build-samples'
jobs:
- 'build-sample'
- defaults:
!include: defaults.yaml.inc
#!/usr/bin/python3 -u
# -*- coding: utf-8 -*-
#
# Copyright 2017 Collabora Ltd.
#
# SPDX-License-Identifier: MPL-2.0
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
import subprocess
if __name__ == '__main__':
# Copy before we start modifying
original_environ = dict(os.environ)
ade = os.path.join(os.getcwd(), 'apertis-dev-tools', 'tools', 'ade')
package = original_environ['PACKAGE']
srcdir = os.path.join(os.getcwd(), package)
threads = (os.cpu_count() or 2)
# We don't want these polluting the environment
for name in (
'COMPONENT',
'CREATE_SNAPSHOT_PROJECT',
'DIFF_ID',
'DISTRO',
'PACKAGE',
'PACKAGING_ONLY',
'PHID',
'PROJECT',
'REVISION',
'URI',
):
os.environ.pop(name, None)
if os.path.exists(os.path.join(srcdir, '.gitmodules')):
subprocess.check_call([
'git',
'submodule',
'init',
],
cwd=srcdir)
subprocess.check_call([
'git',
'submodule',
'update',
],
cwd=srcdir)
subprocess.check_call([
ade,
'configure',
'--native',
'--debug',
'--',
'--enable-installed-tests',
],
cwd=srcdir)
subprocess.check_call([
ade,
'build',
'--verbose',
'--',
'-j{}'.format(threads),
],
cwd=srcdir)
subprocess.check_call([
ade,
'export',
],
cwd=srcdir)
Markdown is supported
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