From 63ff9410bb67065fee72069048b34a69ee735a45 Mon Sep 17 00:00:00 2001 From: autoupdate Date: Wed, 26 Jul 2023 19:34:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20(autoupdate)=20Add=20auto=20upda?= =?UTF-8?q?te=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitlab-ci.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6707f8b..a2a6350 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,9 +9,43 @@ variables: EMAIL: "opensource@mmk2410.org" stages: + - autoupdate - build - 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: stage: build script: