aboutsummaryrefslogtreecommitdiff
path: root/build-package
diff options
context:
space:
mode:
authorRiku Voipio <riku.voipio@linaro.org>2017-04-07 15:45:59 +0300
committerRiku Voipio <riku.voipio@linaro.org>2017-04-07 15:48:11 +0300
commit0c0accd44895efdfab7efe0d3c78b18aafe18da6 (patch)
tree322c90f253e4e7409e66ab5e9d5c911a4e14f46e /build-package
parentee16b2e7147628b6516ee7c6484add068d0fce97 (diff)
downloadconfigs-0c0accd44895efdfab7efe0d3c78b18aafe18da6.tar.gz
build-package-obs: Fix credentials
With the jenkins transition dropping oscrc etc, refactor the build job away from master - this allows keeping the jenkins master docker image clean. Change-Id: I9a7bf1a093cf89853c2185fe966e0eadacfa3511 Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Diffstat (limited to 'build-package')
-rw-r--r--build-package/builder-obs.sh19
-rw-r--r--build-package/builder-rpm.sh19
2 files changed, 36 insertions, 2 deletions
diff --git a/build-package/builder-obs.sh b/build-package/builder-obs.sh
index 2aacf6a41..a86a92183 100644
--- a/build-package/builder-obs.sh
+++ b/build-package/builder-obs.sh
@@ -4,7 +4,15 @@ set -e
echo "source: $source"
echo "repo: $repo"
echo "appendversion: $appendversion"
-rm -rf *
+
+if ! sudo DEBIAN_FRONTEND=noninteractive apt-get update -qq
+then
+ echo apt-get update error try again in a moment
+ sleep 15
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -q||true
+fi
+
+sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y -q osc
dget -q -d -u $source
sourcename=`basename $source|sed -e 's,_.*,,'`
@@ -55,6 +63,15 @@ fi
dsc=`ls -tr *dsc`
+cat > $HOME/.oscrc <<EOF
+[general]
+apiurl = https://obs.linaro.org
+
+[https://obs.linaro.org]
+user=$OSCRC_USER
+pass=$OSCRC_PASS
+EOF
+
# update existing package
if osc co $repo $sourcename; then
rm -v $repo/$sourcename/${sourcename}_*||true
diff --git a/build-package/builder-rpm.sh b/build-package/builder-rpm.sh
index a76a56597..9a06ad278 100644
--- a/build-package/builder-rpm.sh
+++ b/build-package/builder-rpm.sh
@@ -3,12 +3,29 @@
set -e
echo "source: $source"
echo "repo: $repo"
-rm -rf *
+
+if ! sudo DEBIAN_FRONTEND=noninteractive apt-get update -qq
+then
+ echo apt-get update error try again in a moment
+ sleep 15
+ sudo DEBIAN_FRONTEND=noninteractive apt-get update -q||true
+fi
+
+sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y -q osc rpm rpm2cpio cpio
wget --progress=dot -e dotbytes=2M $source
sourcefile="*.src.rpm"
sourcename=`rpm -q --queryformat '%{NAME}' -p ${sourcefile}`
+cat > $HOME/.oscrc <<EOF
+[general]
+apiurl = https://obs.linaro.org
+
+[https://obs.linaro.org]
+user=$OSCRC_USER
+pass=$OSCRC_PASS
+EOF
+
# update existing package
if osc co $repo $sourcename; then
rm -v $repo/$sourcename/*||true