osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/42961?usp=email )
Change subject: contrib/obs-mirror: log to systemd journal
......................................................................
contrib/obs-mirror: log to systemd journal
Instead of having a lot of logfiles in /home/pkgmirror and starting the
obs-mirror scripts via cronjob, add systemd services and timers and let
them log to the systemd journal.
Change-Id: I3a567770ef6d98bb3fdc2d52214cacbfe59640ad
---
D contrib/obs-mirror/README
A contrib/obs-mirror/README.md
M contrib/obs-mirror/obs-mirror.sh
M contrib/obs-mirror/rm-old-nightly-archives.sh
A contrib/obs-mirror/systemd/obs-mirror.service
A contrib/obs-mirror/systemd/obs-mirror.timer
A contrib/obs-mirror/systemd/rm-old-nightly-archives.service
A contrib/obs-mirror/systemd/rm-old-nightly-archives.timer
8 files changed, 56 insertions(+), 13 deletions(-)
Approvals:
osmith: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
daniel: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/contrib/obs-mirror/README b/contrib/obs-mirror/README
deleted file mode 100644
index 4cab14b..0000000
--- a/contrib/obs-mirror/README
+++ /dev/null
@@ -1,7 +0,0 @@
-The scripts in this directory are used to create an archive of Osmocom related
-packages from OBS, at: https://downloads.osmocom.org/obs-mirror/
-
-There is no mechanism in place to deploy updated scripts after updating them
-here in osmo-ci.git, so this must be done manually.
-
-See OS#4862 for more information.
diff --git a/contrib/obs-mirror/README.md b/contrib/obs-mirror/README.md
new file mode 100644
index 0000000..01c9615
--- /dev/null
+++ b/contrib/obs-mirror/README.md
@@ -0,0 +1,19 @@
+The scripts in this directory are used to create an archive of Osmocom related
+packages from OBS, at: https://downloads.osmocom.org/obs-mirror/
+
+There is no mechanism in place to deploy updated scripts after updating them
+here in osmo-ci.git, so this must be done manually:
+
+```
+$ ssh pkgmirror(a)package-archive.osmocom.org
+pkgmirror@package-archive:~$ git -C osmo-ci pull
+```
+
+After changing the systemd services or timers, deploy them as follows:
+```
+$ scp systemd/* root@package-archive.osmocom.org:/etc/systemd/system
+$ ssh root@@package-archive.osmocom.org
+root@package-archive:~# systemctl daemon-reload
+```
+
+See OS#4862 for more information.
diff --git a/contrib/obs-mirror/obs-mirror.sh b/contrib/obs-mirror/obs-mirror.sh
index 85336ab..090ff26 100755
--- a/contrib/obs-mirror/obs-mirror.sh
+++ b/contrib/obs-mirror/obs-mirror.sh
@@ -9,10 +9,7 @@
#
# See also: OS#4862
-DATE=`date +%Y%m%d-%H%M%S`
-LOGFILE="/home/pkgmirror/obs-mirror-$DATE.log"
-echo "Redirecting all output to: $LOGFILE"
-exec >$LOGFILE 2>&1
+DATE="$(date +%Y%m%d-%H%M%S)"
set -e -x
SCRIPT_DIR="$(realpath "$(dirname "$(realpath "$0")")")"
diff --git a/contrib/obs-mirror/rm-old-nightly-archives.sh b/contrib/obs-mirror/rm-old-nightly-archives.sh
index 485788f..cde4223 100755
--- a/contrib/obs-mirror/rm-old-nightly-archives.sh
+++ b/contrib/obs-mirror/rm-old-nightly-archives.sh
@@ -1,7 +1,5 @@
#!/bin/sh -e
# Remove nightly archives older than one month (OS#4862)
-echo "Redirecting all output to: /home/pkgmirror/rm-old-nightly-archives.log"
-exec >"/home/pkgmirror/rm-old-nightly-archives.log" 2>&1
DRY=0
diff --git a/contrib/obs-mirror/systemd/obs-mirror.service b/contrib/obs-mirror/systemd/obs-mirror.service
new file mode 100644
index 0000000..6a2f8a0
--- /dev/null
+++ b/contrib/obs-mirror/systemd/obs-mirror.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=obs-mirror
+
+[Service]
+Type=oneshot
+User=pkgmirror
+ExecStart=/home/pkgmirror/osmo-ci/contrib/obs-mirror/obs-mirror.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/contrib/obs-mirror/systemd/obs-mirror.timer b/contrib/obs-mirror/systemd/obs-mirror.timer
new file mode 100644
index 0000000..5005e2f
--- /dev/null
+++ b/contrib/obs-mirror/systemd/obs-mirror.timer
@@ -0,0 +1,8 @@
+[Unit]
+Description=Run obs-mirror.service
+
+[Timer]
+OnCalendar=*-*-* 06:19:00
+
+[Install]
+WantedBy=timers.target
diff --git a/contrib/obs-mirror/systemd/rm-old-nightly-archives.service b/contrib/obs-mirror/systemd/rm-old-nightly-archives.service
new file mode 100644
index 0000000..6955f65
--- /dev/null
+++ b/contrib/obs-mirror/systemd/rm-old-nightly-archives.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=rm-old-nightly-archives
+
+[Service]
+Type=oneshot
+User=pkgmirror
+ExecStart=/home/pkgmirror/osmo-ci/contrib/obs-mirror/rm-old-nightly-archives.sh
+
+[Install]
+WantedBy=multi-user.target
diff --git a/contrib/obs-mirror/systemd/rm-old-nightly-archives.timer b/contrib/obs-mirror/systemd/rm-old-nightly-archives.timer
new file mode 100644
index 0000000..58e8266
--- /dev/null
+++ b/contrib/obs-mirror/systemd/rm-old-nightly-archives.timer
@@ -0,0 +1,8 @@
+[Unit]
+Description=Run rm-old-nightly-archives.service
+
+[Timer]
+OnCalendar=*-*-* 07:10:00
+
+[Install]
+WantedBy=timers.target
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/42961?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I3a567770ef6d98bb3fdc2d52214cacbfe59640ad
Gerrit-Change-Number: 42961
Gerrit-PatchSet: 3
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
osmith has abandoned this change. ( https://gerrit.osmocom.org/c/osmo-dev/+/42971?usp=email )
Change subject: Support building onomondo-eim
......................................................................
Abandoned
Andreas has an alternative patch that adds a Makefile
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/42971?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: abandon
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I551e0b88110ed20fdbc301035fc3dac6e0d83635
Gerrit-Change-Number: 42971
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/42971?usp=email )
Change subject: Support building onomondo-eim
......................................................................
Support building onomondo-eim
The onomondo-eim project is an erlang project, but it does not have a
Makefile like the others. Run rebar3 directly in that case.
I've also considered always doing this instead of running the Makefile,
but that would break osmo-s1gw, which needs to run "rebar3 asn compile"
before "rebar3 compile" as its Makefile does it.
Change-Id: I551e0b88110ed20fdbc301035fc3dac6e0d83635
---
M all.buildsystems
M all.deps
M gen_makefile.py
3 files changed, 15 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/71/42971/1
diff --git a/all.buildsystems b/all.buildsystems
index 63eab23..d851f3b 100644
--- a/all.buildsystems
+++ b/all.buildsystems
@@ -10,3 +10,5 @@
pyosmocom python
pysctp python
pyhss python
+
+onomondo-eim erlang
diff --git a/all.deps b/all.deps
index f5148ca..dab8565 100644
--- a/all.deps
+++ b/all.deps
@@ -68,3 +68,5 @@
pyosmocom gsm0338
pysctp
pyhss comp128-python pyosmocom pysctp
+
+onomondo-eim
diff --git a/gen_makefile.py b/gen_makefile.py
index 4ee5290..e573f1c 100755
--- a/gen_makefile.py
+++ b/gen_makefile.py
@@ -420,13 +420,21 @@
touch $@
'''
elif buildsystem == "erlang":
+ check_cmd = "rebar3 eunit" if args.make_check else "true"
return f'''
.make.{proj}.build: .make.{proj}.configure $({proj}_files)
@echo "\\n\\n\\n===== $@\\n"
set -x && \\
export REBAR_BASE_DIR="$$PWD/{build_proj}" && \\
mkdir -p "$$REBAR_BASE_DIR" && \\
- $(MAKE) -C {src_proj} build {check}
+ cd {shlex.quote(src_proj)} && \\
+ if [ -e Makefile ]; then \\
+ $(MAKE) build {check}; \\
+ else \\
+ rebar3 compile && \\
+ rebar3 escriptize && \\
+ {check_cmd}; \\
+ fi;
sync
touch $@
'''
@@ -471,13 +479,12 @@
'''
elif buildsystem == "erlang":
# Use the "install" target if it exists, otherwise fall back to installing
- # files generated by escriptize in default/bin. The fallback method can be
- # removed once osmo-epdg has an install target.
+ # files generated by escriptize in default/bin.
return f'''
.make.{proj}.install: .make.{proj}.build
@echo "\\n\\n\\n===== $@\\n"
set -ex; \\
- if grep -q "^install:" {shlex.quote(src_proj)}/Makefile; then \\
+ if grep -q "^install:" {shlex.quote(src_proj)}/Makefile 2>/dev/null; then \\
{sudo_make_install}$(MAKE) \\
-C {shlex.quote(src_proj)} \\
install \\
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/42971?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I551e0b88110ed20fdbc301035fc3dac6e0d83635
Gerrit-Change-Number: 42971
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>