WIP: automation/pull-mirror: Initial declaration #2

Draft
kreyren wants to merge 5 commits from pull-mirror-4-upstream into central
3 changed files with 54 additions and 0 deletions

18
.drone.yml Executable file
View File

@ -0,0 +1,18 @@
kind: pipeline
type: docker
name: default
steps:
- name: Sync Upstream
image: alpine:3.16.2
environment:
USERNAME:
from_secret: dotya_username
TOKEN:
from_secret: dotya_token
commands:
- apk add guile git # Install dependencies
- git config --global --add safe.directory /drone/src # Stupid drone issue
- git checkout upstream
- git pull
- git push "https://$USERNAME:$TOKEN@git.dotya.ml/kreyren/guix-kreyren.git" upstream

35
automation/sync-upstream.ss Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/env sh
exec guile -s "$0" "$@"
!#
;;; DNM: Title
;;; Copyright (C) 2022 Jacob Hrbek <kreyren@rixotstudio.cz>
;;;
;;; This file is Free/Libre Open-Source Software; you may copy, redistribute and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
;;; This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public license along with this project. If not, see <http://www.gnu.org/licenses>
(use-modules (devops-tools sync-git-repository)
(devops-tools utils))
;;; Commentary:
;;;
;;; GNU Guile script designed to run every 10min to sync fork repository with the upstream
;;;
;;; Requires the following environment variables to be set:
;;; * USERNAME = Name of the user used for pushing
;;; * TOKEN = User Token or Password for pushing
;;;
;;; Code:
(sync-git-repository #:source-repo "https://git.savannah.gnu.org/git/guix.git"
#:source-branch "master"
;#:target-repo %repo-dir
#:target-repo "/home/kreyren/Repositories/guix"
#:target-branch "upstream"
#:push? #t
#:username (get-variable "USERNAME")
#:token (get-variable "TOKEN")
#:forge "https://git.dotya.ml/kreyren/guix-kreyren.git")
;;; sync-upstream.scm ends here

1
automation/zz-README.org Normal file
View File

@ -0,0 +1 @@
Directory storing scripts used by Continuous Integration and Delivery ("CI/CD")