2018-05-09 16:52:51 +02:00
|
|
|
name: gitea
|
2022-12-10 15:31:16 +01:00
|
|
|
summary: Gitea - A painless self-hosted Git service
|
2018-05-09 16:52:51 +02:00
|
|
|
description: |
|
|
|
|
The goal of this project is to make the easiest, fastest, and most painless
|
|
|
|
way of setting up a self-hosted Git service. With Go, this can be done with
|
|
|
|
an independent binary distribution across ALL platforms that Go supports,
|
|
|
|
including Linux, Mac OS X, Windows and ARM.
|
|
|
|
|
2023-07-18 18:06:43 +02:00
|
|
|
icon: public/assets/img/logo.png
|
2018-05-09 16:52:51 +02:00
|
|
|
confinement: strict
|
2023-09-12 14:47:53 +02:00
|
|
|
base: core22
|
2020-05-08 22:21:28 +02:00
|
|
|
adopt-info: gitea
|
2018-05-09 16:52:51 +02:00
|
|
|
|
2020-05-09 06:39:19 +02:00
|
|
|
architectures:
|
|
|
|
- build-on: armhf
|
|
|
|
- build-on: amd64
|
|
|
|
- build-on: arm64
|
|
|
|
|
2020-05-08 22:21:28 +02:00
|
|
|
environment:
|
|
|
|
GITEA_CUSTOM: "$SNAP_COMMON"
|
2020-12-15 22:52:59 +01:00
|
|
|
GITEA_WORK_DIR: "$SNAP_COMMON"
|
2020-11-30 19:49:11 +01:00
|
|
|
GIT_TEMPLATE_DIR: "$SNAP/usr/share/git-core/templates"
|
|
|
|
GIT_EXEC_PATH: "$SNAP/usr/lib/git-core"
|
2018-05-09 16:52:51 +02:00
|
|
|
|
|
|
|
apps:
|
|
|
|
gitea:
|
2020-05-08 22:21:28 +02:00
|
|
|
command: gitea
|
2021-06-11 20:51:05 +02:00
|
|
|
plugs: [network, network-bind, removable-media]
|
2018-05-09 16:52:51 +02:00
|
|
|
web:
|
2020-05-08 22:21:28 +02:00
|
|
|
command: gitea web
|
2018-05-09 16:52:51 +02:00
|
|
|
daemon: simple
|
2021-06-11 20:51:05 +02:00
|
|
|
plugs: [network, network-bind, removable-media]
|
2018-05-09 16:52:51 +02:00
|
|
|
dump:
|
2020-05-08 22:21:28 +02:00
|
|
|
command: gitea dump
|
2021-06-11 20:51:05 +02:00
|
|
|
plugs: [home, removable-media]
|
2018-05-09 16:52:51 +02:00
|
|
|
version:
|
2020-05-08 22:21:28 +02:00
|
|
|
command: gitea --version
|
2018-05-09 16:52:51 +02:00
|
|
|
sqlite:
|
|
|
|
command: usr/bin/sqlite3
|
|
|
|
|
|
|
|
parts:
|
|
|
|
gitea:
|
2020-05-08 22:21:28 +02:00
|
|
|
plugin: make
|
2018-05-09 16:52:51 +02:00
|
|
|
source: .
|
|
|
|
stage-packages: [ git, sqlite3, openssh-client ]
|
2022-08-18 18:25:50 +02:00
|
|
|
build-packages: [ git, libpam0g-dev, libsqlite3-dev, build-essential]
|
2023-09-12 14:47:53 +02:00
|
|
|
build-snaps: [ go/1.21/stable, node/18/stable ]
|
2020-05-08 22:21:28 +02:00
|
|
|
build-environment:
|
|
|
|
- LDFLAGS: ""
|
|
|
|
override-pull: |
|
2023-09-12 14:47:53 +02:00
|
|
|
craftctl default
|
2023-07-18 18:06:43 +02:00
|
|
|
|
2023-09-12 14:47:53 +02:00
|
|
|
git config --global --add safe.directory /root/parts/gitea/src
|
Add logic to build stable and edge builds (#12052)
This adds some logic to enable the snapcraft builds of the gitea snap to create both builds of the latest tip of master for edge channels, and stable releases.
The logic simply looks for a new upstream release in github, and if that latest tagged release is not the same as the release in the candidate channel in the snap store, then it must be new, and so we checkout that tag and build that. If the current released tag is the same as what's in candidate, we build whatever is in git master.
The process for using this is:
Initially: When this lands, it will build the latest stable release of gitea and push to the edge channel in the snap store. Someone on the release team can go to https://snapcraft.io/gitea/releases and release that build to stable and candidate.
Ongoing: The next build to be triggered will be a git master build, and can just sit in edge, nothing for the release team to do.
On new release: The next build triggered will contain the stable release, and will be published to edge. Someone on the release team can login to the above URL and release that again to stable & candidate. Alternatively they can release to candidate, do some additional testing on that release before releasing to stable.
Hope that all makes sense. Questions / comments welcome.
I'm super keen to see stable releases of Gitea in the stable channel of the Snap Store. I'd like to promote it but I can't really until it's in stable.
Co-authored-by: techknowlogick <techknowlogick@gitea.io>
2020-07-17 19:27:00 +02:00
|
|
|
last_committed_tag="$(git for-each-ref --sort=taggerdate --format '%(tag)' refs/tags | tail -n 1)"
|
|
|
|
last_released_tag="$(snap info gitea | awk '$1 == "latest/candidate:" { print $2 }')"
|
|
|
|
# If the latest tag from the upstream project has not been released to
|
|
|
|
# stable, build that tag instead of master.
|
|
|
|
if [ "${last_committed_tag}" != "${last_released_tag}" ]; then
|
|
|
|
git fetch
|
|
|
|
git checkout "${last_committed_tag}"
|
2023-07-18 18:06:43 +02:00
|
|
|
fi
|
2020-05-08 22:21:28 +02:00
|
|
|
|
|
|
|
version="$(git describe --always | sed -e 's/-/+git/;y/-/./')"
|
|
|
|
[ -n "$(echo $version | grep "+git")" ] && grade=devel || grade=stable
|
2023-09-14 05:20:46 +02:00
|
|
|
craftctl set version="$version"
|
2023-09-12 14:47:53 +02:00
|
|
|
craftctl set grade="$grade"
|
2020-05-08 22:21:28 +02:00
|
|
|
|
|
|
|
override-build: |
|
|
|
|
set -x
|
2022-01-31 23:52:12 +01:00
|
|
|
sed -i 's/os.Getuid()/1/g' modules/setting/setting.go
|
2019-12-08 17:56:59 +01:00
|
|
|
TAGS="bindata sqlite sqlite_unlock_notify pam cert" make build
|
2020-05-08 22:21:28 +02:00
|
|
|
install -D gitea "${SNAPCRAFT_PART_INSTALL}/gitea"
|
|
|
|
cp -r options "${SNAPCRAFT_PART_INSTALL}/"
|
|
|
|
|
2018-05-09 16:52:51 +02:00
|
|
|
prime:
|
|
|
|
- -etc
|
|
|
|
- -usr/lib/systemd
|
|
|
|
- -usr/lib/gcc
|
|
|
|
- -usr/lib/sasl2
|
|
|
|
- -usr/lib/x86_64-linux-gnu/krb5
|
|
|
|
- -usr/share/apport
|
|
|
|
- -usr/share/bash-completion
|
|
|
|
- -usr/share/git-core/contrib
|
|
|
|
- -usr/share/man
|
|
|
|
- -usr/share/upstart
|
|
|
|
- -var
|