new package woodpecker: server, agent and CLI for the Woodpecker CI system

OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/woodpecker?expand=0&rev=1
This commit is contained in:
Martin Pluskal 2024-07-29 15:51:22 +00:00 committed by Git OBS Bridge
commit a5eb62a7ec
15 changed files with 450 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

30
Makefile Normal file
View File

@ -0,0 +1,30 @@
NAME = woodpecker
SPEC = woodpecker.spec
default: clean tar
clean:
rm -rf $(NAME) $(NAME)-*.tar $(NAME)-*.tar.gz $(NAME)-*.obscpio vendor.tar.gz web-*.tar.gz
tar:
osc service manualrun
@version=$$( awk '/^Version:/ {print $$2;exit;}' $(SPEC) ) && \
echo "Package version is $$version" && \
basename=$(NAME)-$$version && \
obscpio=$$basename.obscpio && \
wd=$$(pwd) && \
tmpdir=$$(mktemp -d -p /tmp) && \
cd $$tmpdir && \
echo "Extracting obscpio archive" && \
cpio -id < $$wd/$$obscpio && \
tar xvf $$wd/vendor.tar.gz && \
cd $$basename/web/ && \
rm -rf node_modules && \
ls -lah && \
pnpm install --frozen-lockfile && \
pnpm build && \
ls -lah && \
cd .. && \
tar czf $$wd/web-$$version.tar.gz ./web/ && \
echo "DONE creating npm dependency offline cache file web-$$version.tar.gz" && \
rm -rf $$tmpdir

14
PACKAGING_README.md Normal file
View File

@ -0,0 +1,14 @@
# Packaging woodpecker
This server package needs assets generated by the `Makefile` that is present in
this package. To do that, you need to have `make` and `nodejs-common` installed
locally.
1. Change the version in the `_service` file
2. Enable `pnpm` by running `sudo corepack enable pnpm`
3. Run `make`
4. Create a changelog entry
5. Commit the changes as usual
For the OBS workflow you also need `obs-service-go_modules` as well
as `obs-service-tar_scm` and `obs-service-recompress`.

22
_service Normal file
View File

@ -0,0 +1,22 @@
<services>
<service name="obs_scm" mode="manual">
<param name="url">https://github.com/woodpecker-ci/woodpecker</param>
<param name="scm">git</param>
<param name="exclude">.git</param>
<param name="revision">v2.7.0</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="changesgenerate">enable</param>
<param name="versionrewrite-pattern">v(.*)</param>
</service>
<service name="set_version" mode="manual">
</service>
<service name="go_modules" mode="manual">
</service>
<!-- services below are running at buildtime -->
<service name="tar" mode="buildtime">
</service>
<service name="recompress" mode="buildtime">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/woodpecker-ci/woodpecker</param>
<param name="changesrevision">805c3156f857c228e9094a96619b4d00a5e6f711</param></service></servicedata>

View File

@ -0,0 +1,2 @@
#Type Name ID GECOS Home Shell
u woodpecker - - /var/lib/woodpecker /usr/sbin/nologin

3
vendor.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c8477d1fae271927c4d068354ab7216171456804e77f133424f1188f2aab7fd1
size 21626134

3
web-2.7.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:be657d6905f5c17ed4d02f2bd687fd686616149efc5ab635d9a59d0b1e0dfc5b
size 57955961

3
woodpecker-2.7.0.obscpio Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1152ce544bdebcb98d734351d8c137b85c84b21693ab7cb90c59940b692d8281
size 40402445

18
woodpecker-agent.service Normal file
View File

@ -0,0 +1,18 @@
[Unit]
Description=WoodpeckerCI agent
Documentation=https://woodpecker-ci.org/docs/administration/agent-config
Requires=network.target
After=network.target
ConditionFileNotEmpty=/etc/woodpecker/woodpecker-agent.env
ConditionPathExists=/etc/woodpecker/woodpecker-agent.env
[Service]
Type=simple
EnvironmentFile=/etc/woodpecker/woodpecker-agent.env
User=woodpecker
Group=woodpecker
ExecStart=/usr/bin/woodpecker-agent
WorkingDirectory=/var/lib/woodpecker/
[Install]
WantedBy=multi-user.target

18
woodpecker-server.service Normal file
View File

@ -0,0 +1,18 @@
[Unit]
Description=WoodpeckerCI server
Documentation=https://woodpecker-ci.org/docs/administration/server-config
Requires=network.target
After=network.target
ConditionFileNotEmpty=/etc/woodpecker/woodpecker-server.env
ConditionPathExists=/etc/woodpecker/woodpecker-server.env
[Service]
Type=simple
EnvironmentFile=/etc/woodpecker/woodpecker-server.env
User=woodpecker
Group=woodpecker
ExecStart=/usr/bin/woodpecker-server
WorkingDirectory=/var/lib/woodpecker/
[Install]
WantedBy=multi-user.target

122
woodpecker.changes Normal file
View File

@ -0,0 +1,122 @@
-------------------------------------------------------------------
Sat Jul 20 14:54:52 UTC 2024 - opensuse_buildservice@ojkastl.de
- Update to version 2.7.0:
* Security
- Add blocklist of environment variables who could alter
execution of plugins [#3934]
- Make sure plugins only mount the workspace base in a
predefinde location [#3933]
- Disallow to set arbitrary environments for plugins [#3909]
- Use proper oauth state [#3847]
- Enhance token checking [#3842]
- Bump github.com/hashicorp/go-retryablehttp v0.7.5 -> v0.7.7
[#3834]
* Features
- Gracefully shutdown server [#3896]
- Gracefully shutdown agent [#3895]
- Convert urls in logs to links [#3904]
- Allow login using multiple forges [#3822]
- Global and organization registries [#1672]
- Cli get repo from git remote [#3830]
- Add api for forges [#3733]
* Enhancement
- Cli fix pipeline logs [#3913]
- Migrate to github.com/urfave/cli/v3 [#2951]
- Allow to change the working directory also for plugins and
services [#3914]
- Remove unplugin-icons [#3809]
- Release windows binaries as zip file [#3906]
- Convert to openapi 3.0 [#3897]
- Enhance pipeline list [#3898]
- Add user registries UI [#3888]
- Sort users by login [#3891]
- Exclude dummy backend in production [#3877]
- Fix deploy task env [#3878]
- Get default branch and show message in pipeline list [#3867]
- Add timestamp for last work done by agent [#3844]
- Adjust logger types [#3859]
- Cleanup state reporting [#3850]
- Unify DB tables/columns [#3806]
- Let webhook pass on pipeline parsing error [#3829]
- Exclude mocks from release build [#3831]
- K8s secrets reference from step [#3655]
* Bug Fixes
- Handle empty repositories in gitea when listing PRs [#3925]
- Update alpine package dep for docker images [#3917]
- Don't report error if agent was terminated gracefully [#3894]
- Let agents continuously report their health [#3893]
- Ignore warnings for cli exec [#3868]
- Correct favicon states [#3832]
- Cleanup of the login flow and tests [#3810]
- Fix newlines in logs [#3808]
- Fix authentication error handling [#3807]
* Documentation
- Streamline docs for new users [#3803]
- Add mastodon verification [#3843]
- chore(deps): update docs npm deps non-major [#3837]
- fix(deps): update docs npm deps non-major [#3824]
- Add openSUSE package [#3800]
- chore(deps): update docs npm deps non-major [#3798]
- Add "Docker Tags" Plugin [#3796]
- chore(deps): update dependency marked to v13 [#3792]
- chore: fix some comments [#3788]
* Misc
- chore(deps): update web npm deps non-major [#3930]
- chore(deps): update dependency vitest to v2 [#3905]
- fix(deps): update module github.com/google/go-github/v62 to
v63 [#3910]
- chore(deps): update
docker.io/woodpeckerci/plugin-docker-buildx docker tag to
v4.1.0 [#3908]
- Update plugin-git and add renovate trigger [#3901]
- chore(deps): update docker.io/mstruebing/editorconfig-checker
docker tag to v3.0.3 [#3903]
- fix(deps): update golang-packages [#3875]
- chore(deps): lock file maintenance [#3876]
- [pre-commit.ci] pre-commit autoupdate [#3862]
- Add dummy backend [#3820]
- chore(deps): update dependency replace-in-file to v8 [#3852]
- Update forgejo sdk [#3840]
- chore(deps): lock file maintenance [#3838]
- Allow to set dist dir using env var [#3814]
- chore(deps): lock file maintenance [#3805]
- chore(deps): update docker.io/lycheeverse/lychee docker tag
to v0.15.1 [#3797]
-------------------------------------------------------------------
Sat Jul 20 08:34:11 UTC 2024 - opensuse_buildservice@ojkastl.de
- Update to version 2.6.1:
* Fix Changelog
* Release 2.6.1 (#3935)
* Add blocklist of environment variables who could alter
execution of plugins (#3934)
* Make sure plugins only mount the workspace base in a predefinde
location (#3933)
* Disalow to set arbitrary environments for plugins (#3909)
* Bump github.com/hashicorp/go-retryablehttp v0.7.5 -> v0.7.7
(#3833)
* Fix newlines in logs (#3808)
* Let webhook pass on pipeline parsion error
-------------------------------------------------------------------
Fri Jun 14 15:21:40 UTC 2024 - opensuse_buildservice@ojkastl.de
- Update to version 2.6.0:
* 🎉 Release 2.6.0 (#3751)
* Add 2.6 docs (#3786)
* Add release event to webhooks (#3784)
* Improve step logging (#3722)
* Remove misleading crontab guru suggestion from docs (#3781)
* Add documentation for KUBERNETES_SERVICE_HOST in Agent (#3747)
* Update nix flake (#3780)
* chore(deps): lock file maintenance (#3783)
* chore(deps): update pre-commit hook golangci/golangci-lint to v1.59.1 (#3782)
* Respect cli argument when checking docker backend availability (#3770)
-------------------------------------------------------------------
Fri Jun 14 15:20:51 UTC 2024 - Johannes Kastl <opensuse_buildservice@ojkastl.de>
- new package woodpecker: server, agent and CLI for the Woodpecker
CI system

4
woodpecker.obsinfo Normal file
View File

@ -0,0 +1,4 @@
name: woodpecker
version: 2.7.0
mtime: 1721337871
commit: 805c3156f857c228e9094a96619b4d00a5e6f711

183
woodpecker.spec Normal file
View File

@ -0,0 +1,183 @@
#
# spec file for package woodpecker
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
%define cli_package_name woodpecker-cli
%define cli_executable_name woodpecker-cli
%define agent_package_name woodpecker-agent
%define agent_executable_name woodpecker-agent
%define server_package_name woodpecker-server
%define server_executable_name woodpecker-server
Name: woodpecker
Version: 2.7.0
Release: 0
Summary: Simple yet powerful CI/CD engine with great extensibility
License: Apache-2.0
URL: https://github.com/woodpecker-ci/woodpecker
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
Source2: web-%{version}.tar.gz
Source11: woodpecker-server.service
Source12: woodpecker-agent.service
Source21: system-user-woodpecker.conf
BuildRequires: go >= 1.22
BuildRequires: user(woodpecker)
%description
Woodpecker is a simple yet powerful CI/CD engine with great extensibility
%package -n %{cli_package_name}
Summary: CLI for the WoodpeckerCI system
%description -n %{cli_package_name}
Woodpecker is a simple yet powerful CI/CD engine with great extensibility. This
package contains the command line utility for the WoodpeckerCI system
%package -n %{agent_package_name}
Summary: Agent for the WoodpeckerCI system
Requires: user(woodpecker)
%description -n %{agent_package_name}
Woodpecker is a simple yet powerful CI/CD engine with great extensibility. This
package contains the agent binary and service.
%package -n %{server_package_name}
Summary: WoodpeckerCI server
Requires: user(woodpecker)
%description -n %{server_package_name}
Woodpecker is a simple yet powerful CI/CD engine with great extensibility. This
package contains the server binary and service.
%package -n system-user-%{name}
Summary: System user and group woodpecker
BuildRequires: sysuser-tools
BuildArch: noarch
%sysusers_requires
%description -n system-user-%{name}
This package provides the system user for the woodpecker CI system.
%prep
%autosetup -p 1 -a 1
rm -rf web/
tar xvf %{SOURCE2}
%build
# CLI executable
go build \
-mod=vendor \
-buildmode=pie \
-ldflags="-X go.woodpecker-ci.org/woodpecker/v2/version.Version=v%{version}" \
-o bin/%{cli_executable_name} ./cmd/cli
# Agent executable
go build \
-mod=vendor \
-buildmode=pie \
-ldflags="-X go.woodpecker-ci.org/woodpecker/v2/version.Version=v%{version}" \
-o bin/%{agent_executable_name} ./cmd/agent
# Server
go build \
-mod=vendor \
-buildmode=pie \
-ldflags="-X go.woodpecker-ci.org/woodpecker/v2/version.Version=v%{version}" \
-o bin/%{server_executable_name} ./cmd/server
# system-user
%sysusers_generate_pre %{SOURCE21} user
%install
install -D -m 0755 bin/%{cli_executable_name} %{buildroot}/%{_bindir}/%{cli_executable_name}
install -D -m 0755 bin/%{agent_executable_name} %{buildroot}/%{_bindir}/%{agent_executable_name}
install -D -m 0755 bin/%{server_executable_name} %{buildroot}/%{_bindir}/%{server_executable_name}
install -d -m 0750 %{buildroot}%{_sysconfdir}/woodpecker/
install -d -m 0750 %{buildroot}%{_sharedstatedir}/woodpecker/
install -d -m 0755 %{buildroot}%{_unitdir}/
install -D -m 0644 %{SOURCE11} %{buildroot}%{_unitdir}/woodpecker-server.service
install -D -m 0644 %{SOURCE12} %{buildroot}%{_unitdir}/woodpecker-agent.service
# system user
install -Dm644 %{SOURCE21} %{buildroot}%{_sysusersdir}/system-user-woodpecker.conf
%check
bin/%{cli_executable_name} --version | grep %{version}
bin/%{agent_executable_name} --version | grep %{version}
bin/%{server_executable_name} --version | grep %{version}
%pre -n system-user-%{name} -f user.pre
%pre -n %{name}-server
%service_add_pre woodpecker-server.service
%post -n %{name}-server
%service_add_post woodpecker-server.service
%preun -n %{name}-server
%service_del_preun woodpecker-server.service
%postun -n %{name}-server
%service_del_postun woodpecker-server.service
%pre -n %{name}-agent
%service_add_pre woodpecker-agent.service
%post -n %{name}-agent
%service_add_post woodpecker-agent.service
%preun -n %{name}-agent
%service_del_preun woodpecker-agent.service
%postun -n %{name}-agent
%service_del_postun woodpecker-agent.service
%files -n %{cli_package_name}
%doc README.md
%license LICENSE
%{_bindir}/%{cli_executable_name}
%files -n %{agent_package_name}
%doc README.md
%license LICENSE
%{_bindir}/%{agent_executable_name}
%{_unitdir}/woodpecker-agent.service
%dir %attr(750,woodpecker,woodpecker) %{_sysconfdir}/woodpecker/
%config(noreplace) %attr(640,woodpecker,woodpecker) %ghost %{_sysconfdir}/woodpecker/woodpecker-agent.env
%dir %attr(750,woodpecker,woodpecker) %{_sharedstatedir}/woodpecker/
%files -n %{server_package_name}
%doc README.md
%license LICENSE
%{_bindir}/%{server_executable_name}
%{_unitdir}/woodpecker-server.service
%dir %attr(750,woodpecker,woodpecker) %{_sysconfdir}/woodpecker/
%config(noreplace) %attr(640,woodpecker,woodpecker) %ghost %{_sysconfdir}/woodpecker/woodpecker-server.env
%dir %attr(750,woodpecker,woodpecker) %{_sharedstatedir}/woodpecker/
%files -n system-user-%{name}
%{_sysusersdir}/system-user-woodpecker.conf
%changelog