talkatu/builders

Move to the templated convey.yml

2019-04-30, Gary Kramlich
8946337ba860
Parents 0b90722b8bf9
Children 58d49ecac5c9
Move to the templated convey.yml
--- a/convey.yml Tue Apr 30 01:47:32 2019 -0500
+++ b/convey.yml Tue Apr 30 02:44:25 2019 -0500
@@ -1,80 +1,88 @@
+environment:
+ - ARCH=amd64
+ - REPO=talkatu/builders
+
tasks:
import:
type: docker/import
files:
- .:.
- debian-buster-amd64:
- type: docker/build
- dockerfile: Dockerfile.debian-buster-amd64
- tag: talkatu/builders:debian-buster-amd64
- files: debian
-
- fedora-29-amd64:
- type: docker/build
- dockerfile: Dockerfile.fedora-29-amd64
- tag: talkatu/builders:fedora-29-amd64
- files: rpm
-
- fedora-28-amd64:
+ build:
type: docker/build
- dockerfile: Dockerfile.fedora-28-amd64
- tag: talkatu/builders:fedora-28-amd64
- files: rpm
+ dockerfile: Dockerfile.${DISTRO}-${VERSION}-${ARCH}
+ tag: ${REPO}:${DISTRO}-${VERSION}-${ARCH}
+ files:
+ - ${FILES}
+ labels:
+ - COMMIT=${HG_COMMIT}
+
+ publish:
+ type: docker/push
+ image: ${REPO}:${DISTRO}-${VESION}-${ARCH}
- pvs-studio:
+ login:
+ type: docker/login
+ username: ${DOCKERHUB_USERNAME}
+ password: ${DOCKERHUB_PASSWORD}
+ server: docker.io
+
+ logout:
+ type: docker/logout
+ server: docker.io
+
+ build-target:
type: docker/build
- dockerfile: Dockerfile.pvs-studio
- tag: talkatu/builders:pvs-studio
+ dockerfile: Dockerfile.${TARGET}
+ tags: ${REPO}:${TARGET}
+ files:
+ - ${FILES}
+ labels:
+ - COMMIT=${HG_COMMIT}
- scanbuild:
- type: docker/build
- dockerfile: Dockerfile.scanbuild
- tag: talkatu/builders:scanbuild
- files: scanbuild
+ publish-target:
+ type: docker/push
+ image: ${REPO}:${TARGET}
plans:
- debian:
+
+ debian-buster-amd64:
+ environment: [DISTRO=debian, VERSION=buster, FILES=debian]
stages:
- - name: import
- tasks:
- - import
- - name: build
- concurrent: true
- tasks:
- - debian-buster-amd64
+ - tasks: [import, build]
- fedora:
+ fedora-28-amd64:
+ environment: [DISTRO=fedora, VERSION=28, FILES=rpm]
stages:
- - name: import
- tasks:
- - import
- - name: build
- concurrent: true
- tasks:
- - fedora-28-amd64
- - fedora-29-amd64
+ - tasks: [import, build]
+
+ fedora-29-amd64:
+ environment: [DISTRO=fedora, VERSION=29, FILES=rpm]
+ stages:
+ - tasks: [import, build]
+
+ pvs-studio:
+ environment: [TARGET=pvs-studio, FILES=pvs-studio]
+ stages:
+ - tasks: [import, build-target]
scanbuild:
+ environment: [TARGET=scanbuild, FILES=scanbuild]
stages:
- - name: import
- tasks:
- - import
- - name: build
- tasks: scanbuild
+ - tasks: [import, build-target]
- pvs-studio:
+ publish:
+ environment: [DOCKERHUB_USERNAME, DOCKERHUB_PASSWORD]
stages:
- - name: build
- tasks:
- - import
- - pvs-studio
+ - tasks: [login, publish]
+ - tasks: [logout]
+ run: always
-meta-plans:
- default:
- plans:
- - debian
- - fedora
- - pvs-studio
- - scanbuild
+ publish-target:
+ environment: [DOCKERHUB_USERNAME, DOCKERHUB_PASSWORD]
+ stages:
+ - tasks: [login, publish-target]
+ - tasks: [logout]
+ run: always
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/pvs-studio/build.sh Tue Apr 30 02:44:25 2019 -0500
@@ -0,0 +1,53 @@
+#!/bin/sh -ex
+# Copyright (C) 2015-2019 Gary Kramlich <grim@reaperworld.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+cd ${CONVEY_WORKSPACE}
+
+BUILD_DIR="build-pvs-studio"
+
+# don't leak our secrets via `set -x`
+set +x
+if [ -z "${PVS_STUDIO_USERNAME}" -o -z "${PVS_STUDIO_KEY}" ] ; then
+ echo "Both PVS_STUDIO_USERNAME and PVS_STUDIO_KEY must be provided" >&2
+ exit 1
+fi
+set -x
+
+# don't echo commands as we're stashing secrets
+set +x
+echo "${PVS_STUDIO_USERNAME}" > /license
+echo "${PVS_STUDIO_KEY}" >> /license
+set -x
+
+meson ${BUILD_DIR}
+cd ${BUILD_DIR}
+
+echo "running ninja because we don't have a way to just generate the built source files" >&2
+ninja
+
+echo "creating compile_commands.json"
+ninja -t compdb
+
+# run the analyzer
+pvs-studio-analyzer analyze -l /license -o pvs-studio.log
+
+# convert the output to html
+plog-converter -a GA:1,2 -t fullhtml -o pvs-studio -p ${HG_REMOTE} -v ${HG_COMMIT} pvs-studio.log
+cp -a pvs-studio ${CONVEY_WORKSPACE}
+
+exit 0
+