Skip to content

Commit

Permalink
Upgrade to Ubuntu 22.04 build container (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
timja authored Jun 6, 2022
1 parent 416f402 commit 32fd04e
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ generated
*.orig

msi/build
venv/

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Run `make setup` to install (most of the) necessary tools. Alternatively you ca
* debhelper
* rpm
* expect
* createrepo
* createrepo-c
* ruby
* net-sftp (`gem install net-sftp`)
* maven
Expand Down
5 changes: 5 additions & 0 deletions deb/build/debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@

%:
dh $@

# debian doesn't support the zstd compression which is the default on Ubuntu
# see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892664
override_dh_builddeb:
dh_builddeb -- -Zxz
8 changes: 4 additions & 4 deletions rpm/build/SPECS/jenkins.spec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ BuildRoot: %{_tmppath}/build-%{name}-%{version}
# TODO: If re-enable, fix the matcher for Java 11
# Requires: java >= 1:1.8.0
Requires: procps
PreReq: /usr/sbin/groupadd /usr/sbin/useradd
Requires(pre): /usr/sbin/useradd, /usr/sbin/groupadd
BuildArch: noarch

%description
Expand Down Expand Up @@ -64,10 +64,10 @@ rm -rf "%{buildroot}"
%__install -D -m0755 "%{SOURCE6}" "%{buildroot}%{_datadir}/%{name}/migrate"

%pre
/usr/sbin/groupadd -r %{name} &>/dev/null || :
/usr/bin/getent group %{name} &>/dev/null || /usr/sbin/groupadd -r %{name} &>/dev/null
# SUSE version had -o here, but in Fedora -o isn't allowed without -u
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "@@SUMMARY@@" \
-d "%{workdir}" %{name} &>/dev/null || :
/usr/bin/getent passwd %{name} &>/dev/null || /usr/sbin/useradd -g %{name} -s /bin/false -r -c "@@SUMMARY@@" \
-d "%{workdir}" %{name} &>/dev/null

# Used to decide later if we should perform a chown in case JENKINS_INSTALL_SKIP_CHOWN is false
# Check if a previous installation exists, if so check the JENKINS_HOME value and existing owners of work, log and cache dir, need to to this check
Expand Down
4 changes: 2 additions & 2 deletions rpm/publish/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ EOF
# generate index
# locally
# disable this for now, as it's currently now used and generate errors
# createrepo --update -o "$RPM_WEBDIR" "$RPMDIR/"
# createrepo_c --update -o "$RPM_WEBDIR" "$RPMDIR/"
# on the server
# shellcheck disable=SC2029
ssh "${SSH_OPTS[@]}" "$PKGSERVER" createrepo --update -o "'$RPM_WEBDIR'" "'$RPMDIR/'"
ssh "${SSH_OPTS[@]}" "$PKGSERVER" createrepo_c --update -o "'$RPM_WEBDIR'" "'$RPMDIR/'"
}

function skipIfAlreadyPublished() {
Expand Down
2 changes: 1 addition & 1 deletion rpm/setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash -eux

sudo apt-get install -y rpm expect createrepo || true
sudo apt-get install -y rpm expect createrepo-c || true

exit 0
8 changes: 4 additions & 4 deletions suse/build/SPECS/jenkins.spec
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ BuildRoot: %{_tmppath}/build-%{name}-%{version}
# TODO: Fix the query for Java 11 if it is reenabled
# Requires: java >= 1:1.8.0
Requires: procps
PreReq: /usr/sbin/groupadd /usr/sbin/useradd
Requires(pre): /usr/sbin/useradd, /usr/sbin/groupadd
#PreReq: %{fillup_prereq}
BuildArch: noarch

Expand Down Expand Up @@ -71,10 +71,10 @@ rm -rf "%{buildroot}"
%__install -D -m0755 "%{SOURCE7}" "%{buildroot}%{_datadir}/%{name}/migrate"

%pre
/usr/sbin/groupadd -r %{name} &>/dev/null || :
/usr/bin/getent group %{name} &>/dev/null || /usr/sbin/groupadd -r %{name} &>/dev/null
# SUSE version had -o here, but in Fedora -o isn't allowed without -u
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "@@SUMMARY@@" \
-d "%{workdir}" %{name} &>/dev/null || :
/usr/bin/getent passwd %{name} &>/dev/null || /usr/sbin/useradd -g %{name} -s /bin/false -r -c "@@SUMMARY@@" \
-d "%{workdir}" %{name} &>/dev/null

%post
%{_datadir}/%{name}/migrate "/etc/sysconfig/%{name}" || true
Expand Down
6 changes: 3 additions & 3 deletions suse/publish/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ function uploadSite() {
. "$PKGSERVER:${SUSE_WEBDIR// /\\ }/" # Remote

# generate index on the server
# server needs 'createrepo' pacakge
# server needs 'createrepo_c' pacakge
# Disable this for now as not critical
# createrepo --update -o "$SUSE_WEBDIR" "$SUSEDIR/" #Local
# createrepo_c --update -o "$SUSE_WEBDIR" "$SUSEDIR/" #Local
# cp "${SUSE_WEBDIR// /\\ }/repodata/repomd.xml" repodata/ # Local

# shellcheck disable=SC2029
ssh "${SSH_OPTS[@]}" "$PKGSERVER" createrepo --update -o "'$SUSE_WEBDIR'" "'$SUSEDIR/'" # Remote
ssh "${SSH_OPTS[@]}" "$PKGSERVER" createrepo_c --update -o "'$SUSE_WEBDIR'" "'$SUSEDIR/'" # Remote

scp \
"${SCP_OPTS[@]}" \
Expand Down

0 comments on commit 32fd04e

Please sign in to comment.