1
0
mirror of https://gitlab.com/packaging/gitea synced 2024-12-22 10:03:58 +00:00
gitea_packaging/.gitlab-ci.yml

90 lines
2.7 KiB
YAML
Raw Permalink Normal View History

2020-04-12 11:43:49 +00:00
stages:
- package
- repo
- pages
package:
stage: package
image: golang:latest
variables:
2020-04-12 11:47:32 +00:00
NAME: gitea
2020-04-12 11:43:49 +00:00
URL: "https://gitea.io"
DESCRIPTION: "A painless self-hosted Git service."
ARTIFACTS: "usr"
script:
2020-05-10 11:52:02 +00:00
- export VERSION=$(echo ${CI_COMMIT_TAG#*v} | cut -d'-' -f1)
2020-04-12 11:43:49 +00:00
- export PATCHLEVEL=$(echo ${CI_COMMIT_TAG} | cut -d'-' -f2)
- apt-get -qq update
2020-06-19 05:14:57 +00:00
- apt-get -qqy install ruby-dev ruby-ffi curl file
2020-04-12 11:43:49 +00:00
- gem install specific_install
- gem specific_install https://github.com/root360/fpm.git all_fixes
- mkdir -p "${CI_PROJECT_DIR}/package_root/usr/bin"
- curl -sL -o "${CI_PROJECT_DIR}/package_root/usr/bin/gitea" "https://dl.gitea.io/gitea/${VERSION}/gitea-${VERSION}-linux-amd64"
2020-06-04 17:31:49 +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"
- fpm
--input-type dir
--output-type deb
2020-05-10 11:47:03 +00:00
--package "${CI_PROJECT_DIR}/gitea_${VERSION}-${PATCHLEVEL}_amd64.deb"
2020-04-12 11:43:49 +00:00
--name "${NAME}"
2020-05-10 11:47:03 +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
2020-06-20 07:49:09 +00:00
--deb-systemd "${CI_PROJECT_DIR}/package_scripts/${NAME}.service"
2020-04-12 11:43:49 +00:00
--deb-systemd-enable
--deb-systemd-auto-start
--deb-activate-noawait /etc/init.d
--prefix=/
--after-install "${CI_PROJECT_DIR}/package_scripts/after-install.sh"
--chdir "${CI_PROJECT_DIR}/package_root"
$ARTIFACTS
artifacts:
paths:
- $CI_PROJECT_DIR/*.deb
only:
- tags
reprepro:
cache:
untracked: true
paths:
- $CI_PROJECT_DIR/repo
key: reprepro
stage: repo
image: registry.gitlab.com/packaging/reprepro-multiple-versions:latest
script:
- echo "$SIGNING_KEY" > /tmp/key
- gpg --import /tmp/key
- rm -f /tmp/key
- test -f $CI_PROJECT_DIR/repo/gpg.key || gpg --export --armor "$SIGNING_KEY_ID" > $CI_PROJECT_DIR/repo/gpg.key
- sed -i 's,##SIGNING_KEY_ID##,'$SIGNING_KEY_ID',' repo/conf/distributions
- find $CI_PROJECT_DIR -type f -name "*.deb" -exec
reprepro
-b $CI_PROJECT_DIR/repo
includedeb
gitea
{} \+;
only:
- tags
pages:
cache:
untracked: true
paths:
- $CI_PROJECT_DIR/repo
key: reprepro
policy: pull
stage: pages
image: ubuntu:focal
script:
- mkdir $CI_PROJECT_DIR/public
- cp -r $CI_PROJECT_DIR/repo/gpg.key $CI_PROJECT_DIR/repo/dists $CI_PROJECT_DIR/repo/pool $CI_PROJECT_DIR/public/
artifacts:
paths:
- $CI_PROJECT_DIR/public
expire_in: 1 day
only:
- tags