osmith has submitted this change. (
https://gerrit.osmocom.org/c/osmo-ci/+/39794?usp=email
)
Change subject: jobs/gerrit-lint: run in docker
......................................................................
jobs/gerrit-lint: run in docker
Run the linting scripts in docker, so we can make use of additional
programs like clang-format without installing them on the jenkins node
directly.
Change-Id: I17d2e538f1f9fb69f298ac223bc293570db90a83
---
M contrib/known_hosts
M jobs/gerrit-lint.yml
M lint/lint_diff.sh
3 files changed, 18 insertions(+), 2 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, approved
diff --git a/contrib/known_hosts b/contrib/known_hosts
index de29e93..5be5736 100644
--- a/contrib/known_hosts
+++ b/contrib/known_hosts
@@ -1,3 +1,4 @@
[ftp.osmocom.org]:48 ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQDDgQ9HntlpWNmh953a2Gc8NysKE4orOatVT1wQkyzhARnfYUerRuwyNr1GqMyBKdSI9amYVBXJIOUFcpV81niA7zQRUs66bpIMkE9/rHxBd81SkorEPOIS84W4vm3SZtuNqa+fADcqe88Hcb0ZdTzjKILuwi19gzrQyME2knHY71EOETe9Yow5RD2hTIpB5ecNxI0LUKDq+Ii8HfBvndPBIr0BWYDugckQ3Bocf+yn/tn2/GZieFEyFpBGF/MnLbAAfUKIdeyFRX7ufaiWWz5yKAfEhtziqdAGZaXNaLG6gkpy3EixOAy6ZXuTAk3b3Y0FUmDjhOHllbPmTOcKMry9
[ftp.osmocom.org]:48 ecdsa-sha2-nistp256
AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBPdWn1kEousXuKsZ+qJEZTt/NSeASxCrUfNDW3LWtH+d8Ust7ZuKp/vuyG+5pe5pwpPOgFu7TjN+0lVjYJVXH54=
[ftp.osmocom.org]:48 ssh-ed25519
AAAAC3NzaC1lZDI1NTE5AAAAIK8iivY70EiR5NiGChV39gRLjNpC8lvu1ZdHtdMw2zuX
+[gerrit.osmocom.org]:29418 ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAAAgQDI4wZwtcGz2V98iZWWEtsA162PolLtgQTBjnC14ONzZGQkTh9bTPsoSxnM5TKOm4F2bzq7gb+Qrsj4ZECD19qztmD37kMP9jn7/2i1V8oLAy9ojyklXAdBVTliQteVI7ieDOyKCnGbszvFWXY2isoO1k7yJLv0QyL7F5AuZlxeHw==
diff --git a/jobs/gerrit-lint.yml b/jobs/gerrit-lint.yml
index a607268..661a600 100644
--- a/jobs/gerrit-lint.yml
+++ b/jobs/gerrit-lint.yml
@@ -48,8 +48,22 @@
osmo-ci
git -C osmo-ci log --oneline
- cd code-from-gerrit
- ../osmo-ci/lint/lint_diff.sh HEAD~1
+ docker run \
+ --rm \
+ -e GERRIT_HOST=$GERRIT_HOST \
+ -e GERRIT_PORT=$GERRIT_PORT \
+ -e GERRIT_PROJECT=$GERRIT_PROJECT \
+ -e GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER \
+ -e GERRIT_PATCHSET_NUMBER=$GERRIT_PATCHSET_NUMBER \
+ -e JENKINS_HOME=1 \
+ -e SSH_AUTH_SOCK=/ssh-agent \
+ -u build \
+ -v $(readlink -f $SSH_AUTH_SOCK):/ssh-agent \
+ -v ./code-from-gerrit:/build/code-from-gerrit \
+ -v ./osmo-ci:/build/osmo-ci \
+ -w /build/code-from-gerrit \
+ "$USER/debian-bookworm-build" \
+ /build/osmo-ci/lint/lint_diff.sh HEAD~1
wrappers:
- ansicolor:
diff --git a/lint/lint_diff.sh b/lint/lint_diff.sh
index 662bdd3..5ec26a5 100755
--- a/lint/lint_diff.sh
+++ b/lint/lint_diff.sh
@@ -63,6 +63,7 @@
"$BUILD_URL"
# Apply as review in gerrit
ssh \
+ -o UserKnownHostsFile=$SCRIPT_DIR/../contrib/known_hosts \
-p "$GERRIT_PORT" \
-l jenkins \
"$GERRIT_HOST" \
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ci/+/39794?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: I17d2e538f1f9fb69f298ac223bc293570db90a83
Gerrit-Change-Number: 39794
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>