dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 2c010bb404e80730363a3785bd9aabb351da3ad6
parent 5a770ec7b231b2d2662d019ae2e123a1cdfc447b
Author: Anders Damsgaard <anders@adamsgaard.dk>
Date:   Sat, 23 May 2020 22:53:48 +0200

Remove gitlab repo API and CI scripts

Diffstat:
D.local/bin/gitlab-ci | 26--------------------------
D.local/bin/gitlab-project | 85-------------------------------------------------------------------------------
2 files changed, 0 insertions(+), 111 deletions(-)

diff --git a/.local/bin/gitlab-ci b/.local/bin/gitlab-ci @@ -1,26 +0,0 @@ -#!/bin/sh - -help() { - echo "Usage: ${0##*/} JOBNAME1 [JOBNAME2,...,[JOBNAME N]]" -} - -[ $# -lt 1 ] && (help && exit 1) -case "$1" in - -h|--help) - help - exit 0 - ;; - *) - if [ "$(uname)" = "Linux" ]; then - # Run as sudo if not SU already - if ! [ "$(id -u)" = 0 ]; then - sudo "$0" "$@" - exit $? - fi - fi - ;; -esac - -for jobname in "$@"; do - gitlab-runner exec docker "$jobname" -done diff --git a/.local/bin/gitlab-project b/.local/bin/gitlab-project @@ -1,85 +0,0 @@ -#!/bin/sh - -# https://docs.gitlab.com/ee/api/README.html -glserver="https://gitlab.com" -apiversion="v4" -whoami="admesg" - -show_help() { - echo "${0##*/} { CREATE [VISIBILITY] | DELETE } PROJECTNAME[S]" - echo "where ACTION is 'create' or 'delete', where 'create' creates a " - echo "$glserver project with name PROJECTNAME." - echo "VISIBILITY can be 'private', 'internal', or 'public'." - echo "If VISIBILITY is not set, the project will be set as 'private'." -} - -send_create_project() { - curl \ - --header "PRIVATE-TOKEN: $(pass Online/gitlab.com-admesg-private-access-token)" \ - --header "Accept: application/json" \ - --header "Content-type: application/json" \ - --request POST \ - --data "{\"name\":\"$2\", \"visibility_level\":$1}" \ - "$glserver/api/$apiversion/projects" -} - -send_delete_project() { - curl \ - --header "PRIVATE-TOKEN: $(pass Online/gitlab.com-admesg-private-access-token)" \ - --request DELETE \ - "$glserver/api/$apiversion/projects/$whoami%2F$1" -} - -die() { - printf '%s\n' "$1" >&2 - exit 1 -} - -[ $# -lt 2 ] && (show_help && exit 1) - -visibility=0 -delete=0 -while :; do - case "$1" in - -h|-\?|--help) - show_help - exit 0 - ;; - delete) - delete=1 - ;; - create) # default operation - ;; - private) - visibility=0 - ;; - internal) - visibility=10 - ;; - public) - visibility=20 - ;; - --) # end all options - shift - break - ;; - -?*) - die 'Error: Unknown option specified' - ;; - *) # no more options - break - esac - shift -done - -[ $# -lt 1 ] && die 'Error: No project name[s] specified' - -# loop over PROJECTNAME[S] -for projectname in "$@"; do - if [ "$delete" = 1 ]; then - echo "deleting $projectname" - send_delete_project "$projectname" - else - send_create_project "$visibility" "$projectname" - fi -done