Skip to content
Permalink
Browse files

Trigger Clang builds

  • Loading branch information...
athos-ribeiro committed Jul 30, 2018
1 parent ddab227 commit 53a66195a3f661c1096f582664a384f9509e40ec
Showing with 63 additions and 0 deletions.
  1. +53 −0 salt/files/trigger_clang_build
  2. +10 −0 salt/obs.sls
@@ -0,0 +1,53 @@
#!/bin/bash

set -e
PKG=$1

rm -rf /root/Debian\:Unstable\:Clang
cd /root
osc co Debian:Unstable:Clang > /dev/null 2>&1
cd Debian\:Unstable\:Clang/

if [ "$PKG" == "obs-service-clang-build" ]; then
if ! osc ls Debian:Unstable:Clang obs-service-clang-build > /dev/null 2>&1; then
echo 'Preparing obs-service-clang-build package...'
mkdir obs-service-clang-build
cd obs-service-clang-build/
wget 'https://www.ime.usp.br/~athoscr/files/obs/obs-service-clang-build_0.1-1.debian.tar.xz'
wget 'https://www.ime.usp.br/~athoscr/files/obs/obs-service-clang-build_0.1-1.dsc'
wget 'https://www.ime.usp.br/~athoscr/files/obs/obs-service-clang-build_0.1.orig.tar.gz'
cd /root/Debian\:Unstable\:Clang
osc add obs-service-clang-build > /dev/null 2>&1
osc ci -m 'First clang-build package' > /dev/null 2>&1
echo 'obs-service-clang-build package build triggered. Wait until it is complete to trigger clang builds.'
else
echo 'obs-service-clang-build already present'
fi
exit
fi

echo "Preparing $PKG..."
PKG_EXISTS=false
if osc ls Debian:Unstable:Clang $PKG > /dev/null 2>&1 ; then
PKG_EXISTS=true
fi

if ! $PKG_EXISTS; then
mkdir $PKG
else
rm -rf $PKG/*
fi
cd $PKG/
apt source -d $PKG/sid > /dev/null 2>&1
cat > _service << EOF
<services>
<service name="clang_build" mode="buildtime" />
</services>
EOF
cd /root/Debian\:Unstable\:Clang
if ! $PKG_EXISTS; then
osc add $PKG > /dev/null 2>&1
else
osc addremove $PKG > /dev/null 2>&1
fi
osc ci -m "New $PKG package clang build" > /dev/null 2>&1
@@ -247,3 +247,13 @@ create_debian_testing_test_project:
cmd.run:
- name: osc -A https://localhost:443 meta prj Debian:Testing:test -F /tmp/debian_testing_test.xml

/usr/local/bin/trigger_clang_build:
file.managed:
- source: salt://files/trigger_clang_build
- user: root
- group: root
- mode: 755

build_obs_clang_build_package:
cmd.run:
- name: trigger_clang_build obs-service-clang-build

0 comments on commit 53a6619

Please sign in to comment.
You can’t perform that action at this time.