Compare commits
No commits in common. "0a1ee6c30eae2f3db8e0ecdaf45660e41efe4572" and "845b4eb1c48cbb69d3d7f384bd6cbc21978cd792" have entirely different histories.
0a1ee6c30e
...
845b4eb1c4
3 changed files with 26 additions and 50 deletions
|
@ -9,43 +9,9 @@ variables:
|
||||||
EMAIL: "opensource@mmk2410.org"
|
EMAIL: "opensource@mmk2410.org"
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- autoupdate
|
|
||||||
- build
|
- build
|
||||||
- deploy
|
- deploy
|
||||||
|
|
||||||
update-job:
|
|
||||||
stage: autoupdate
|
|
||||||
script:
|
|
||||||
##
|
|
||||||
## Install necessary packages.
|
|
||||||
##
|
|
||||||
- apt update && apt install -y git devscripts debhelper libxml2-utils openssh-client
|
|
||||||
|
|
||||||
##
|
|
||||||
## Configure SSH key
|
|
||||||
##
|
|
||||||
- eval $(ssh-agent -s)
|
|
||||||
- chmod 400 "$SSH_PRIVATE_KEY"
|
|
||||||
- ssh-add "$SSH_PRIVATE_KEY"
|
|
||||||
- mkdir ~/.ssh
|
|
||||||
- chmod 700 ~/.ssh
|
|
||||||
- cp "$SSH_KNOWN_HOSTS" ~/.ssh/known_hosts
|
|
||||||
- chmod 644 ~/.ssh/known_hosts
|
|
||||||
|
|
||||||
##
|
|
||||||
## Configure Git setup
|
|
||||||
##
|
|
||||||
- git config user.name "$NAME"
|
|
||||||
- git config user.email "$EMAIL"
|
|
||||||
- git remote set-url origin "$GIT_URL"
|
|
||||||
|
|
||||||
##
|
|
||||||
## Run autoupdate script which handles everything else.
|
|
||||||
##
|
|
||||||
- ./autoupdate.sh
|
|
||||||
rules:
|
|
||||||
- if: $CI_PIPELINE_SOURCE == "schedule"
|
|
||||||
|
|
||||||
build-job:
|
build-job:
|
||||||
stage: build
|
stage: build
|
||||||
script:
|
script:
|
||||||
|
|
|
@ -5,10 +5,7 @@ set -euo pipefail
|
||||||
dir="$(find . -maxdepth 1 -type d -name "intellij-idea-*")"
|
dir="$(find . -maxdepth 1 -type d -name "intellij-idea-*")"
|
||||||
pushd "$dir" || exit 1
|
pushd "$dir" || exit 1
|
||||||
|
|
||||||
set +e
|
|
||||||
check="$(uscan --dehs --no-download)"
|
check="$(uscan --dehs --no-download)"
|
||||||
set -e
|
|
||||||
|
|
||||||
status="$(echo "$check" | xmllint --xpath 'string(/dehs/status)' -)"
|
status="$(echo "$check" | xmllint --xpath 'string(/dehs/status)' -)"
|
||||||
|
|
||||||
if [[ "$status" != "newer package available" ]]; then
|
if [[ "$status" != "newer package available" ]]; then
|
||||||
|
@ -20,14 +17,4 @@ new_version="$(echo "$check" | xmllint --xpath 'string(/dehs/upstream-version)'
|
||||||
|
|
||||||
popd
|
popd
|
||||||
|
|
||||||
./update-new-version.sh "$new_version"
|
./update-new-version.sh --autoupdate "$new_version"
|
||||||
|
|
||||||
git add -A
|
|
||||||
git commit -m "Upstream version $new_version"
|
|
||||||
|
|
||||||
git switch main
|
|
||||||
git merge --ff-only version-"$new_version"
|
|
||||||
git push origin main
|
|
||||||
|
|
||||||
git tag -a v"$new_version" -m "Upstream version $new_version"
|
|
||||||
git push --tags origin main
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#!/usr/bin/env bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# This script intends to decrease the effort of updating the package.
|
# This script intends to decrease the effort of updating the package.
|
||||||
|
#
|
||||||
|
# Passing "--autoupdate" as first argument triggers automatic Git operations.
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
|
@ -16,7 +18,14 @@ DISTRIBUTION="lunar"
|
||||||
|
|
||||||
last_tag=$(git describe --abbrev=0 --tags)
|
last_tag=$(git describe --abbrev=0 --tags)
|
||||||
old="${last_tag#?}"
|
old="${last_tag#?}"
|
||||||
new="$1"
|
|
||||||
|
if [ "$1" = "--autoupdate" ]; then
|
||||||
|
new="$2"
|
||||||
|
autoupdate="y"
|
||||||
|
else
|
||||||
|
new="$1"
|
||||||
|
autoupdate="n"
|
||||||
|
fi
|
||||||
|
|
||||||
name="$(git config --get user.name)"
|
name="$(git config --get user.name)"
|
||||||
email="$(git config --get user.email)"
|
email="$(git config --get user.email)"
|
||||||
|
@ -42,3 +51,17 @@ debuild -us -uc
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
rm "$PACKAGE"_"$old"-*
|
rm "$PACKAGE"_"$old"-*
|
||||||
|
|
||||||
|
if [ "$autoupdate" = "n" ]; then
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
git add -A
|
||||||
|
git commit -m "Upstream version $new"
|
||||||
|
|
||||||
|
git switch main
|
||||||
|
git merge --ff-only version-"$new"
|
||||||
|
git push origin main
|
||||||
|
|
||||||
|
git tag -a v"$new" -m "Upstream version $new"
|
||||||
|
git push --tags origin main
|
||||||
|
|
Loading…
Add table
Reference in a new issue