👷 (autoupdate) Add auto update job

This commit is contained in:
Marcel Kapfer 2023-07-26 19:34:58 +02:00
parent 9293768ee2
commit 63ff9410bb

View file

@ -9,9 +9,43 @@ 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: