Skip to content

Commit 1d87e29

Browse files
authored
Merge pull request openSUSE#1599 from dmach/gitea_api
Add 'gitea_api' module and 'git-obs' executable
2 parents 70975fc + 0b2f0da commit 1d87e29

File tree

97 files changed

+2616
-408
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2616
-408
lines changed

.github/workflows/tests.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: |
2626
sudo apt-get -y update
2727
sudo apt-get -y --no-install-recommends install git-lfs
28-
sudo apt-get -y --no-install-recommends install diffstat diffutils git-core python3 python3-cryptography python3-pip python3-rpm python3-setuptools python3-urllib3
28+
sudo apt-get -y --no-install-recommends install diffstat diffutils git-core python3 python3-cryptography python3-pip python3-rpm python3-ruamel.yaml python3-setuptools python3-urllib3
2929
3030
- uses: actions/checkout@v3
3131

@@ -85,23 +85,23 @@ jobs:
8585
zypper -n lr --details
8686
grep -qi tumbleweed /etc/os-release && zypper -n dist-upgrade || zypper -n patch || zypper -n patch
8787
zypper -n install git-lfs
88-
zypper -n install diffstat diffutils git-core python3 python3-cryptography python3-pip python3-rpm python3-setuptools python3-urllib3
88+
zypper -n install diffstat diffutils git-core python3 python3-cryptography python3-pip python3-rpm python3-ruamel.yaml python3-setuptools python3-urllib3
8989
9090
- name: 'Install packages (Fedora/CentOS)'
9191
if: ${{ contains(matrix.container, '/fedora:') || contains(matrix.container, '/centos:') }}
9292
run: |
9393
dnf -y makecache
9494
dnf -y distro-sync
9595
dnf -y install git-lfs
96-
dnf -y install diffstat diffutils git-core python3 python3-cryptography python3-pip python3-rpm python3-setuptools python3-urllib3
96+
dnf -y install diffstat diffutils git-core python3 python3-cryptography python3-pip python3-rpm python3-ruamel-yaml python3-setuptools python3-urllib3
9797
9898
- name: 'Install packages (Debian/Ubuntu)'
9999
if: ${{ contains(matrix.container, '/debian:') || contains(matrix.container, '/ubuntu:') }}
100100
run: |
101101
apt-get -y update
102102
apt-get -y upgrade
103103
apt-get -y --no-install-recommends install git-lfs
104-
apt-get -y --no-install-recommends install diffstat diffutils git-core python3 python3-cryptography python3-pip python3-rpm python3-setuptools python3-urllib3
104+
apt-get -y --no-install-recommends install diffstat diffutils git-core python3 python3-cryptography python3-pip python3-rpm python3-ruamel.yaml python3-setuptools python3-urllib3
105105
106106
- uses: actions/checkout@v3
107107

@@ -131,7 +131,7 @@ jobs:
131131
run: |
132132
sudo sh -c '. /etc/os-release; echo "deb [trusted=yes] http://download.opensuse.org/repositories/openSUSE:Tools/xUbuntu_${VERSION_ID} ./" > /etc/apt/sources.list.d/openSUSE-Tools.list'
133133
sudo apt-get -y update
134-
sudo apt-get -y --no-install-recommends install python3-behave diffstat diffutils python3 python3-cryptography python3-pip python3-rpm python3-setuptools python3-urllib3 obs-build obs-service-set-version
134+
sudo apt-get -y --no-install-recommends install python3-behave diffstat diffutils python3 python3-cryptography python3-pip python3-rpm python3-ruamel.yaml python3-setuptools python3-urllib3 obs-build obs-service-set-version
135135
136136
- name: "Checkout sources"
137137
uses: actions/checkout@v3
@@ -143,4 +143,4 @@ jobs:
143143
- name: "Run tests"
144144
run: |
145145
cd behave
146-
behave -Dosc=../osc-wrapper.py -Dmax_podman_containers=2
146+
behave -Dosc=../osc-wrapper.py -Dpodman_max_containers=2

behave/Containerfile

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
FROM opensuse/leap:15.5
1+
FROM opensuse/leap:15.6
2+
3+
RUN zypper -n modifyrepo --disable repo-openh264 || : \
4+
&& zypper ar --repo http://download.opensuse.org/repositories/OBS:/Server:/Unstable/15.6/OBS:Server:Unstable.repo \
5+
&& zypper ar --repo http://download.opensuse.org/repositories/devel:/tools:/scm/15.6/devel:tools:scm.repo \
6+
&& zypper -n --gpg-auto-import-keys refresh
27

3-
RUN zypper ar --repo http://download.opensuse.org/repositories/OBS:/Server:/Unstable/15.5/OBS:Server:Unstable.repo
4-
RUN zypper -n --gpg-auto-import-keys refresh
58
RUN zypper -n install \
69
bash \
710
bash-completion \
811
git \
12+
gitea \
913
less \
1014
obs-api \
15+
obs-gitea-bridge \
1116
obs-server \
1217
obs-signd \
1318
obs-worker \
@@ -16,17 +21,21 @@ RUN zypper -n install \
1621
openssl \
1722
perl-XML-SAX \
1823
rpm-build \
24+
sqlite3 \
1925
systemd \
2026
vim \
2127
&& rm -rf /var/cache/zypp/*
2228

23-
# increase the number if we need to run the following setup steps again (for debugging purposes)
24-
ENV BUILD_NUMBER 1
29+
COPY container-files/ /
2530

26-
RUN /bin/bash /opt/obs/container-setup.sh
27-
COPY container-oscrc /root/.config/osc/oscrc
28-
RUN /bin/bash /opt/obs/container-setup-initial-data.sh
29-
RUN /bin/bash /opt/obs/container-setup-prebuilt-rpms.sh
31+
RUN /bin/bash /opt/setup/setup.sh \
32+
&& /bin/bash /opt/setup/initial-data.sh \
33+
&& /bin/bash /opt/setup/prebuilt-rpms.sh \
34+
&& /bin/bash /opt/setup/gitea.sh \
35+
&& rm -rf /var/log/apache2/* \
36+
&& rm -rf /srv/obs/log/* \
37+
&& rm -rf /srv/obs/service/log/* \
38+
&& rm -rf /srv/www/obs/api/log/*
3039

31-
# /sbin/init doesn't exist on Leap 15.5
40+
# /sbin/init doesn't exist on Leap 15.6
3241
ENTRYPOINT ["/usr/lib/systemd/systemd"]

behave/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Build a container with OBS
1818
$ cd behave
1919
2020
# optional: refresh the base image
21-
$ podman pull opensuse/leap:15.5
21+
$ podman pull opensuse/leap:15.6
2222
2323
# build the container image
2424
$ ./container-build.sh [--no-cache]
@@ -36,7 +36,11 @@ Use the container
3636
```
3737
$ cd behave
3838
39-
# run 'obs-server' container on port 1443
39+
# run 'obs-server' container on ports:
40+
# 1443 - api+web, https
41+
# 1082 - repos, http
42+
# 3000 - gitea, http
43+
# 3022 - gitea, ssh
4044
# running this command again replaces the current container with a fresh one
4145
$ ./container-run.sh
4246

behave/container-build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ TOPDIR=$(dirname $(readlink -f $0))
44

55
podman build "$@" \
66
--tag obs-server \
7-
--volume="$TOPDIR":/opt/obs \
87
$TOPDIR \
98
2>&1 | tee container-build.log
109

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
WORK_PATH = /var/lib/gitea
2+
3+
[server]
4+
CERT_FILE = /etc/gitea/https/cert.pem
5+
KEY_FILE = /etc/gitea/https/key.pem
6+
STATIC_ROOT_PATH = /usr/share/gitea
7+
APP_DATA_PATH = /var/lib/gitea/data
8+
PPROF_DATA_PATH = /var/lib/gitea/data/tmp/pprof
9+
PROTOCOL = http
10+
HTTP_PORT = 3000
11+
DISABLE_SSH = false
12+
START_SSH_SERVER = true
13+
SSH_PORT = 3022
14+
LFS_START_SERVER = true
15+
16+
[lfs]
17+
PATH = /var/lib/gitea/data/lfs
18+
19+
[database]
20+
DB_TYPE = sqlite3
21+
PATH = /var/lib/gitea/data/gitea.db
22+
23+
[security]
24+
INSTALL_LOCK = true
25+
26+
[oauth2]
27+
ENABLED = false
28+
29+
[log]
30+
ROOT_PATH = /var/log/gitea
31+
MODE = console, file
32+
; Either "Trace", "Debug", "Info", "Warn", "Error" or "None", default is "Info"
33+
LEVEL = Debug
34+
35+
[service]
36+
ENABLE_BASIC_AUTHENTICATION = true
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[Unit]
2+
Description=Configure /etc/gitea/conf/app.ini from environmental variables
3+
4+
[Service]
5+
Type=oneshot
6+
User=root
7+
Group=root
8+
PassEnvironment=GITEA_SERVER_HTTP_PORT
9+
PassEnvironment=GITEA_SERVER_SSH_PORT
10+
ExecStart=bash -c /usr/bin/gitea-configure-from-env
11+
12+
[Install]
13+
RequiredBy=gitea.service
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[Unit]
2+
Description=Fix /var/lib/gitea/data by copying it back and forth to the same overlayfs layer
3+
4+
[Service]
5+
Type=oneshot
6+
User=gitea
7+
Group=gitea
8+
ExecStart=/bin/bash -c 'mv /var/lib/gitea/data /var/lib/gitea/data.backup && mkdir -p /var/lib/gitea/data && cp -a /var/lib/gitea/data.backup/* /var/lib/gitea/data/'
9+
10+
[Install]
11+
RequiredBy=gitea.service
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[Unit]
2+
Description=Configure OBS from environmental variables
3+
4+
[Service]
5+
Type=oneshot
6+
User=root
7+
Group=root
8+
PassEnvironment=OBS_PROXY_AUTH
9+
ExecStart=bash -c /usr/bin/obs-configure-from-env
10+
11+
[Install]
12+
RequiredBy=apache2.service
File renamed without changes.

behave/fixtures/pac/multibuild-pkg-1._multibuild renamed to behave/container-files/opt/setup/fixtures/pac/multibuild-pkg-1._multibuild

File renamed without changes.

0 commit comments

Comments
 (0)