2022-01-17 07:55:54 +00:00
|
|
|
---
|
2020-04-12 11:43:49 +00:00
|
|
|
stages:
|
|
|
|
- package
|
2020-06-20 08:55:39 +00:00
|
|
|
- test
|
2022-08-28 14:58:35 +00:00
|
|
|
- repo
|
2020-04-12 11:43:49 +00:00
|
|
|
- pages
|
|
|
|
|
2022-01-17 07:55:54 +00:00
|
|
|
.vars: &vars
|
|
|
|
NAME: gitea
|
|
|
|
URL: "https://gitea.io"
|
|
|
|
DESCRIPTION: "A painless self-hosted Git service."
|
|
|
|
ARTIFACTS: "usr"
|
|
|
|
|
|
|
|
.package: &package
|
2020-04-12 11:43:49 +00:00
|
|
|
stage: package
|
|
|
|
image: golang:latest
|
|
|
|
script:
|
2023-05-27 05:12:41 +00:00
|
|
|
- export VERSION=$(echo ${CI_COMMIT_TAG#*v} | cut -d'+' -f1)
|
|
|
|
- export PATCHLEVEL=$(echo ${CI_COMMIT_TAG} | cut -d'+' -f2)
|
2020-04-12 11:43:49 +00:00
|
|
|
- apt-get -qq update
|
2020-06-19 05:14:57 +00:00
|
|
|
- apt-get -qqy install ruby-dev ruby-ffi curl file
|
2023-11-26 18:00:18 +00:00
|
|
|
- gem install fpm
|
2020-04-12 11:43:49 +00:00
|
|
|
- mkdir -p "${CI_PROJECT_DIR}/package_root/usr/bin"
|
2023-12-12 08:40:36 +00:00
|
|
|
- echo "https://dl.gitea.com/gitea/${VERSION}/gitea-${VERSION}-linux-${ARCH}"
|
2022-01-17 07:55:54 +00:00
|
|
|
- curl -sL -o
|
|
|
|
"${CI_PROJECT_DIR}/package_root/usr/bin/gitea"
|
2023-12-12 08:40:36 +00:00
|
|
|
"https://dl.gitea.com/gitea/${VERSION}/gitea-${VERSION}-linux-${ARCH}"
|
2022-01-17 07:55:54 +00:00
|
|
|
- file
|
|
|
|
--mime-type
|
|
|
|
--brief
|
|
|
|
"${CI_PROJECT_DIR}/package_root/usr/bin/gitea"
|
|
|
|
| grep -q 'application/x-executable'
|
2020-04-12 11:43:49 +00:00
|
|
|
- chmod +x "${CI_PROJECT_DIR}/package_root/usr/bin/gitea"
|
2023-11-14 17:43:20 +00:00
|
|
|
- gem install fpm
|
2020-04-12 11:43:49 +00:00
|
|
|
- fpm
|
2022-01-17 07:55:54 +00:00
|
|
|
--architecture "${ARCH}"
|
2020-04-12 11:43:49 +00:00
|
|
|
--input-type dir
|
|
|
|
--output-type deb
|
2023-05-27 05:12:41 +00:00
|
|
|
--package "${CI_PROJECT_DIR}/gitea_${VERSION}+${PATCHLEVEL}_${ARCH}.deb"
|
2020-04-12 11:43:49 +00:00
|
|
|
--name "${NAME}"
|
2023-05-27 05:12:41 +00:00
|
|
|
--version "${VERSION}+${PATCHLEVEL}"
|
2020-04-12 11:43:49 +00:00
|
|
|
--description "${DESCRIPTION}"
|
|
|
|
--maintainer "Stefan Heitmüller <stefan.heitmueller@gmx.com>"
|
|
|
|
--url "${URL}"
|
|
|
|
--depends git
|
2022-08-28 14:58:35 +00:00
|
|
|
--deb-recommends morph027-keyring
|
2022-01-17 07:55:54 +00:00
|
|
|
--deb-systemd "${CI_PROJECT_DIR}/.packaging/${NAME}.service"
|
2020-04-12 11:43:49 +00:00
|
|
|
--deb-activate-noawait /etc/init.d
|
|
|
|
--prefix=/
|
2022-01-17 07:55:54 +00:00
|
|
|
--before-install "${CI_PROJECT_DIR}/.packaging/before-install.sh"
|
2020-04-12 11:43:49 +00:00
|
|
|
--chdir "${CI_PROJECT_DIR}/package_root"
|
|
|
|
$ARTIFACTS
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- $CI_PROJECT_DIR/*.deb
|
2023-12-23 11:25:57 +00:00
|
|
|
expire_in: 7 days
|
2020-04-12 11:43:49 +00:00
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
|
2023-11-26 18:00:18 +00:00
|
|
|
.manual: &manual
|
|
|
|
when: manual
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
|
|
|
|
.trigger: &trigger
|
|
|
|
when: delayed
|
2023-11-28 07:50:33 +00:00
|
|
|
start_in: 2 hours
|
2023-11-26 18:00:18 +00:00
|
|
|
only:
|
|
|
|
- triggers
|
|
|
|
|
|
|
|
gitea-amd64-tag:
|
2023-12-23 11:25:57 +00:00
|
|
|
<<: [*package, *manual]
|
2023-11-26 18:00:18 +00:00
|
|
|
variables:
|
|
|
|
<<: *vars
|
|
|
|
ARCH: amd64
|
|
|
|
|
|
|
|
gitea-amd64-trigger:
|
2023-12-23 11:25:57 +00:00
|
|
|
<<: [*package, *trigger]
|
2022-01-17 07:55:54 +00:00
|
|
|
variables:
|
|
|
|
<<: *vars
|
|
|
|
ARCH: amd64
|
|
|
|
|
2023-11-26 18:00:18 +00:00
|
|
|
gitea-arm64-tag:
|
2023-12-23 11:25:57 +00:00
|
|
|
<<: [*package, *manual]
|
2023-11-26 18:00:18 +00:00
|
|
|
variables:
|
|
|
|
<<: *vars
|
|
|
|
ARCH: arm64
|
|
|
|
|
|
|
|
gitea-arm64-trigger:
|
2023-12-23 11:25:57 +00:00
|
|
|
<<: [*package, *trigger]
|
2022-01-17 07:55:54 +00:00
|
|
|
variables:
|
|
|
|
<<: *vars
|
|
|
|
ARCH: arm64
|
|
|
|
|
2023-11-28 07:50:33 +00:00
|
|
|
.test-install: &test-install
|
2020-06-20 08:55:39 +00:00
|
|
|
stage: test
|
|
|
|
image: docker:latest
|
|
|
|
services:
|
|
|
|
- docker:dind
|
|
|
|
script:
|
|
|
|
- docker run
|
|
|
|
-d
|
|
|
|
--name systemd-ubuntu
|
|
|
|
--privileged
|
|
|
|
-v /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
|
|
-v $CI_PROJECT_DIR:/src
|
|
|
|
-e CI_PROJECT_DIR=/src
|
2020-06-20 09:13:42 +00:00
|
|
|
-e CI_COMMIT_TAG=$CI_COMMIT_TAG
|
2020-06-20 08:55:39 +00:00
|
|
|
jrei/systemd-ubuntu:20.04
|
2020-06-20 12:39:39 +00:00
|
|
|
- docker exec -t systemd-ubuntu /bin/bash /src/.gitlab-ci/test-install.sh
|
|
|
|
|
2023-11-28 07:50:33 +00:00
|
|
|
.test-update: &test-update
|
2020-06-20 12:39:39 +00:00
|
|
|
stage: test
|
|
|
|
image: docker:latest
|
|
|
|
services:
|
|
|
|
- docker:dind
|
2022-01-17 08:34:11 +00:00
|
|
|
needs:
|
2023-11-26 18:03:40 +00:00
|
|
|
- gitea-amd64-trigger
|
2020-06-20 12:39:39 +00:00
|
|
|
script:
|
|
|
|
- docker run
|
|
|
|
-d
|
|
|
|
--name systemd-ubuntu
|
|
|
|
--privileged
|
|
|
|
-v /sys/fs/cgroup:/sys/fs/cgroup:ro
|
|
|
|
-v $CI_PROJECT_DIR:/src
|
|
|
|
-e CI_PROJECT_DIR=/src
|
|
|
|
-e CI_COMMIT_TAG=$CI_COMMIT_TAG
|
|
|
|
jrei/systemd-ubuntu:20.04
|
|
|
|
- docker exec -t systemd-ubuntu /bin/bash /src/.gitlab-ci/test-update.sh
|
2020-06-20 08:55:39 +00:00
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
|
2023-11-28 07:50:33 +00:00
|
|
|
test-install-trigger:
|
|
|
|
<<: *test-install
|
|
|
|
needs:
|
|
|
|
- gitea-amd64-trigger
|
|
|
|
only:
|
|
|
|
- trigger
|
|
|
|
|
|
|
|
test-install-tag:
|
|
|
|
<<: *test-install
|
|
|
|
needs:
|
|
|
|
- gitea-amd64-tag
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
|
|
|
|
test-update-trigger:
|
|
|
|
<<: *test-update
|
|
|
|
needs:
|
|
|
|
- gitea-amd64-trigger
|
|
|
|
only:
|
|
|
|
- trigger
|
|
|
|
|
|
|
|
test-update-tag:
|
|
|
|
<<: *test-update
|
|
|
|
needs:
|
|
|
|
- gitea-amd64-tag
|
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
|
2023-12-23 11:25:57 +00:00
|
|
|
.repro: &repo
|
2020-04-12 11:43:49 +00:00
|
|
|
cache:
|
|
|
|
untracked: true
|
|
|
|
paths:
|
2022-01-17 07:55:54 +00:00
|
|
|
- $CI_PROJECT_DIR/.repo
|
2020-04-12 11:43:49 +00:00
|
|
|
key: reprepro
|
2022-08-28 14:58:35 +00:00
|
|
|
stage: repo
|
2020-04-12 11:43:49 +00:00
|
|
|
image: registry.gitlab.com/packaging/reprepro-multiple-versions:latest
|
|
|
|
script:
|
2022-08-28 14:58:35 +00:00
|
|
|
- apt-get -qq update
|
|
|
|
- apt-get -qqy install curl
|
2023-11-26 18:00:18 +00:00
|
|
|
- curl -L https://gitlab.com/packaging/utils/-/raw/main/repo.sh |
|
|
|
|
bash -s -- gitea
|
2023-12-23 11:25:57 +00:00
|
|
|
|
|
|
|
repo-tag:
|
|
|
|
<<: [*repo]
|
|
|
|
needs:
|
|
|
|
- test-install-tag
|
|
|
|
- test-update-tag
|
2020-04-12 11:43:49 +00:00
|
|
|
only:
|
|
|
|
- tags
|
|
|
|
|
2023-12-23 11:25:57 +00:00
|
|
|
repo-trigger:
|
|
|
|
<<: [*repo]
|
|
|
|
needs:
|
|
|
|
- test-install-trigger
|
|
|
|
- test-update-trigger
|
|
|
|
only:
|
|
|
|
- triggers
|
|
|
|
|
2020-04-12 11:43:49 +00:00
|
|
|
pages:
|
|
|
|
cache:
|
|
|
|
untracked: true
|
|
|
|
paths:
|
2022-01-17 07:55:54 +00:00
|
|
|
- $CI_PROJECT_DIR/.repo
|
2020-04-12 11:43:49 +00:00
|
|
|
key: reprepro
|
|
|
|
policy: pull
|
|
|
|
stage: pages
|
|
|
|
image: ubuntu:focal
|
|
|
|
script:
|
|
|
|
- mkdir $CI_PROJECT_DIR/public
|
2022-01-17 07:55:54 +00:00
|
|
|
- cp -r
|
2022-08-28 14:58:35 +00:00
|
|
|
$CI_PROJECT_DIR/.repo/gpg.key
|
|
|
|
$CI_PROJECT_DIR/.repo/gitea/{dists,pool}
|
2022-01-17 07:55:54 +00:00
|
|
|
$CI_PROJECT_DIR/public/
|
2020-04-12 11:43:49 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- $CI_PROJECT_DIR/public
|
|
|
|
expire_in: 1 day
|
|
|
|
only:
|
|
|
|
- tags
|