Gogs changes, hcl

This commit is contained in:
2019-01-24 18:29:20 +01:00
parent d7aa0e3e54
commit aa9923a2be
3 changed files with 12 additions and 6 deletions

View File

@ -29,7 +29,7 @@ W końcu zebrałem w jedno repo wszystkie potrzebne mi konfiguracje oprogramowan
Od lat pracuję w konsoli, interfejs ASCII jest dla mnie dużo bardziej natywny, aniżeli klikanie po okienkach. Przy dobrej konfiguracji powłoka daje dużo więcej możliwości niż GUI. Od lat pracuję w konsoli, interfejs ASCII jest dla mnie dużo bardziej natywny, aniżeli klikanie po okienkach. Przy dobrej konfiguracji powłoka daje dużo więcej możliwości niż GUI.
# Opis narzędzi (ogólnie dla pamięci, aka lecytyna) # Opis narzędzi
## (neo)ViM ## (neo)ViM

View File

@ -38,6 +38,7 @@ fi
create-repo() { create-repo() {
local user_name=$1 # name of the user / organization where the repo will be created local user_name=$1 # name of the user / organization where the repo will be created
local repo_name=$2 # name of the repo to be created local repo_name=$2 # name of the repo to be created
local repo_desc=$3
# ensure user_name is passed in # ensure user_name is passed in
if [ -z $user_name ] if [ -z $user_name ]
@ -66,7 +67,8 @@ create-repo() {
local body=$(cat <<-END local body=$(cat <<-END
{ {
"name": "$repo_name", "name": "$repo_name",
"private": false "private": true,
"description": "$repo_desc"
} }
END END
) )
@ -74,7 +76,8 @@ create-repo() {
curl -H "Content-Type: application/json" \ curl -H "Content-Type: application/json" \
-H "Authorization: token $GOGS_TOKEN" \ -H "Authorization: token $GOGS_TOKEN" \
-d "$body" \ -d "$body" \
-v $GOGS_ROOT_URL/api/v1/admin/users/$user_name/repos $GOGS_ROOT_URL/api/v1/admin/users/$user_name/repos |jq
} }
# create a GOGS webhook # create a GOGS webhook
@ -137,7 +140,7 @@ create-webhook() {
curl -H "Content-Type: application/json" \ curl -H "Content-Type: application/json" \
-H "Authorization: token $GOGS_TOKEN" \ -H "Authorization: token $GOGS_TOKEN" \
-d "$body" \ -d "$body" \
-v $GOGS_ROOT_URL/api/v1/repos/$user_name/$repo_name/hooks $GOGS_ROOT_URL/api/v1/repos/$user_name/$repo_name/hooks
} }
# delete a GOGS webhook for a repo # delete a GOGS webhook for a repo
@ -256,12 +259,13 @@ help() {
Usage: Usage:
$prog_name $1 <user_name> <repo_name> $prog_name $1 <user_name> <repo_name> <repo_desc>
Arguments: Arguments:
user_name name of the user or organization where the repo will be created user_name name of the user or organization where the repo will be created
repo_name name of the repository to be created repo_name name of the repository to be created
repo_desc repository description
END END
;; ;;

View File

@ -31,6 +31,8 @@ Plug 'editorconfig/editorconfig-vim'
Plug 'dylanaraps/wal' Plug 'dylanaraps/wal'
Plug 'kristijanhusak/vim-carbon-now-sh'
"Plug 'yggdroot/indentline' "Plug 'yggdroot/indentline'
Plug 'sbdchd/neoformat' Plug 'sbdchd/neoformat'
@ -115,7 +117,7 @@ Plug 'Quramy/tsuquyomi'
Plug 'fatih/vim-hclfmt' Plug 'fatih/vim-hclfmt'
Plug 'hashivim/vim-terraform' Plug 'hashivim/vim-terraform'
Plug 'hashivim/vim-consul' Plug 'hashivim/vim-consul'
Plug 'b4b4r07/vim-hcl'
" Salt-Stack (.:REACTIVATE:.) " Salt-Stack (.:REACTIVATE:.)
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""