Skip to content

Commit a090ef3

Browse files
committed
✨ adding gitlab lib
1 parent 971c0a4 commit a090ef3

File tree

7 files changed

+53
-28
lines changed

7 files changed

+53
-28
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
build:
2323
# The type of runner that the job will run on
2424
runs-on: ubuntu-latest
25+
container: ghcr.io/jcaillon/valet
2526

2627
# Steps represent a sequence of tasks that will be executed as part of the job
2728
steps:

.vscode/valet.code-snippets

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
// Documentation generated for the version 0.22.31 (2024-11-23).
2+
// Documentation generated for the version 0.26.6 (2024-11-24).
33

44
"ansi-codes::*": {
55
"prefix": "ansi-codes::*",
@@ -925,32 +925,32 @@
925925
"body": [ "# ## io::toAbsolutePath\n# \n# This function returns the absolute path of a path.\n# \n# - \\$1: **path** _as string_:\n# The path to translate to absolute path.\n# \n# Returns:\n# \n# - `RETURNED_VALUE`: The absolute path of the path.\n# \n# ```bash\n# io::toAbsolutePath \"myFile\"\n# local myFileAbsolutePath=\"\\${RETURNED_VALUE}\"\n# ```\n# \n# > This is a pure bash alternative to `realpath` or `readlink`.\n# \nio::toAbsolutePath \"${1:**path**}\"$0" ]
926926
},
927927

928-
"kurl::toFile": {
929-
"prefix": "kurl::toFile",
928+
"curl::toFile": {
929+
"prefix": "curl::toFile",
930930
"description": "This function is a wrapper around curl...",
931931
"scope": "",
932-
"body": [ "kurl::toFile \"${1:**fail**}\" \"${2:**acceptable codes**}\" \"${3:**path**}\" \"${99:**curl arguments**}\"$0" ]
932+
"body": [ "curl::toFile \"${1:**fail**}\" \"${2:**acceptable codes**}\" \"${3:**path**}\" \"${99:**curl arguments**}\"$0" ]
933933
},
934934

935-
"kurl::toFile#withdoc": {
936-
"prefix": "kurl::toFile#withdoc",
935+
"curl::toFile#withdoc": {
936+
"prefix": "curl::toFile#withdoc",
937937
"description": "This function is a wrapper around curl...",
938938
"scope": "",
939-
"body": [ "# ## kurl::toFile\n# \n# This function is a wrapper around curl.\n# It allows you to check the http status code and return 1 if it is not acceptable.\n# It io::invokes curl with the following options (do not repeat them): -sSL -w \"%{response_code}\" -o \\${2}.\n# \n# - \\$1: **fail** _as bool_:\n# true/false to indicate if the function should fail in case the execution fails\n# - \\$2: **acceptable codes** _as string_:\n# list of http status codes that are acceptable, comma separated\n# (defaults to 200,201,202,204,301,304,308 if left empty)\n# - \\$3: **path** _as string_:\n# the file in which to save the output of curl\n# - \\$@: **curl arguments** _as any_:\n# options for curl\n# \n# Returns:\n# \n# - \\$?:\n# - 0 if the http status code is acceptable\n# - 1 otherwise\n# - `RETURNED_VALUE`: the content of stderr\n# - `RETURNED_VALUE2`: the http status code\n# \n# ```bash\n# kurl::toFile \"true\" \"200,201\" \"/filePath\" \"https://example.com\" || core::fail \"The curl command failed.\"\n# ```\n# \nkurl::toFile \"${1:**fail**}\" \"${2:**acceptable codes**}\" \"${3:**path**}\" \"${99:**curl arguments**}\"$0" ]
939+
"body": [ "# ## curl::toFile\n# \n# This function is a wrapper around curl.\n# It allows you to check the http status code and return 1 if it is not acceptable.\n# It io::invokes curl with the following options (do not repeat them): -sSL -w \"%{response_code}\" -o \\${2}.\n# \n# - \\$1: **fail** _as bool_:\n# true/false to indicate if the function should fail in case the execution fails\n# - \\$2: **acceptable codes** _as string_:\n# list of http status codes that are acceptable, comma separated\n# (defaults to 200,201,202,204,301,304,308 if left empty)\n# - \\$3: **path** _as string_:\n# the file in which to save the output of curl\n# - \\$@: **curl arguments** _as any_:\n# options for curl\n# \n# Returns:\n# \n# - \\$?:\n# - 0 if the http status code is acceptable\n# - 1 otherwise\n# - `RETURNED_VALUE`: the content of stderr\n# - `RETURNED_VALUE2`: the http status code\n# \n# ```bash\n# curl::toFile \"true\" \"200,201\" \"/filePath\" \"https://example.com\" || core::fail \"The curl command failed.\"\n# ```\n# \ncurl::toFile \"${1:**fail**}\" \"${2:**acceptable codes**}\" \"${3:**path**}\" \"${99:**curl arguments**}\"$0" ]
940940
},
941941

942-
"kurl::toVar": {
943-
"prefix": "kurl::toVar",
942+
"curl::toVar": {
943+
"prefix": "curl::toVar",
944944
"description": "This function is a wrapper around curl...",
945945
"scope": "",
946-
"body": [ "kurl::toVar \"${1:**fail**}\" \"${2:**acceptable codes**}\" \"${99:**curl arguments**}\"$0" ]
946+
"body": [ "curl::toVar \"${1:**fail**}\" \"${2:**acceptable codes**}\" \"${99:**curl arguments**}\"$0" ]
947947
},
948948

949-
"kurl::toVar#withdoc": {
950-
"prefix": "kurl::toVar#withdoc",
949+
"curl::toVar#withdoc": {
950+
"prefix": "curl::toVar#withdoc",
951951
"description": "This function is a wrapper around curl...",
952952
"scope": "",
953-
"body": [ "# ## kurl::toVar\n# \n# This function is a wrapper around curl.\n# It allows you to check the http status code and return 1 if it is not acceptable.\n# It io::invokes curl with the following options (do not repeat them): -sSL -w \"%{response_code}\" -o \"tempfile\".\n# \n# - \\$1: **fail** _as bool_:\n# true/false to indicate if the function should fail in case the execution fails\n# - \\$2: **acceptable codes** _as string_:\n# list of http status codes that are acceptable, comma separated\n# (defaults to 200,201,202,204,301,304,308 if left empty)\n# - \\$@: **curl arguments** _as any_:\n# options for curl\n# \n# Returns:\n# \n# - \\$?:\n# - 0 if the http status code is acceptable\n# - 1 otherwise\n# - `RETURNED_VALUE`: the content of the request\n# - `RETURNED_VALUE2`: the content of stderr\n# - `RETURNED_VALUE3`: the http status code\n# \n# ```bash\n# kurl::toVar false 200,201 https://example.com || core::fail \"The curl command failed.\"\n# ```\n# \nkurl::toVar \"${1:**fail**}\" \"${2:**acceptable codes**}\" \"${99:**curl arguments**}\"$0" ]
953+
"body": [ "# ## curl::toVar\n# \n# This function is a wrapper around curl.\n# It allows you to check the http status code and return 1 if it is not acceptable.\n# It io::invokes curl with the following options (do not repeat them): -sSL -w \"%{response_code}\" -o \"tempfile\".\n# \n# - \\$1: **fail** _as bool_:\n# true/false to indicate if the function should fail in case the execution fails\n# - \\$2: **acceptable codes** _as string_:\n# list of http status codes that are acceptable, comma separated\n# (defaults to 200,201,202,204,301,304,308 if left empty)\n# - \\$@: **curl arguments** _as any_:\n# options for curl\n# \n# Returns:\n# \n# - \\$?:\n# - 0 if the http status code is acceptable\n# - 1 otherwise\n# - `RETURNED_VALUE`: the content of the request\n# - `RETURNED_VALUE2`: the content of stderr\n# - `RETURNED_VALUE3`: the http status code\n# \n# ```bash\n# curl::toVar false 200,201 https://example.com || core::fail \"The curl command failed.\"\n# ```\n# \ncurl::toVar \"${1:**fail**}\" \"${2:**acceptable codes**}\" \"${99:**curl arguments**}\"$0" ]
954954
},
955955

956956
"log::debug": {

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
## 🚧 WORK IN PROGRESS - THIS APPLICATION IS NOT READY 🚧
44

5-
[![Latest Release](https://img.shields.io/github/v/release/jcaillon/devops-toolbox?sort=date&style=flat&logo=github&logoColor=white&label=Latest%20release&color=%2350C878)][latest-release]
6-
[![Total downloads](https://img.shields.io/github/downloads/jcaillon/devops-toolbox/total.svg?style=flat)][releases]
5+
[![Latest Release](https://img.shields.io/github/v/release/jcaillon/valet-devops-toolbox?sort=date&style=flat&logo=github&logoColor=white&label=Latest%20release&color=%2350C878)][latest-release]
6+
[![Total downloads](https://img.shields.io/github/downloads/jcaillon/valet-devops-toolbox/total.svg?style=flat)][releases]
77
[![MIT license](https://img.shields.io/badge/License-MIT-74A5C2.svg?style=flat)][license]
88
[![bash 5+ required](https://img.shields.io/badge/Requires-bash%20v5+-865FC5.svg?logo=gnubash&logoColor=white)][bash]
99

10-
[![icon](docs/static/logo.png)][devops-toolbox-site]
10+
[![icon](docs/static/logo.png)][valet-devops-toolbox-site]
1111

1212
DevOps Toolbox is CLI application which provides a collection of commands to help DevOps engineers in their daily tasks.
1313

14-
Learn more on the [devops-toolbox documentation website][devops-toolbox-site].
14+
Learn more on the [valet-devops-toolbox documentation website][valet-devops-toolbox-site].
1515

16-
[releases]: https://github.com/jcaillon/devops-toolbox/releases
17-
[latest-release]: https://github.com/jcaillon/devops-toolbox/releases/latest
16+
[releases]: https://github.com/jcaillon/valet-devops-toolbox/releases
17+
[latest-release]: https://github.com/jcaillon/valet-devops-toolbox/releases/latest
1818
[license]: ./LICENSE
1919
[bash]: https://www.gnu.org/software/bash/
20-
[devops-toolbox-site]: https://jcaillon.github.io/devops-toolbox/
20+
[valet-devops-toolbox-site]: https://jcaillon.github.io/valet-devops-toolbox/

docs/content/docs/002.installation/_index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Run the following command to install Valet:
1818

1919
```bash
2020
bash -c "$(curl -fsSL https://raw.githubusercontent.com/jcaillon/valet/latest/valet.d/commands.d/self-install.sh)"
21-
git clone --reference latest https://github.com/jcaillon/devops-toolbox ~/.valet/devops-toolbox
21+
git clone --reference latest https://github.com/jcaillon/valet-devops-toolbox ~/.valet/valet-devops-toolbox
2222
valet self build
2323
```
2424

@@ -30,7 +30,7 @@ Here is an example command to install Valet with the option `--unattended`:
3030

3131
```bash
3232
bash -c "$(curl -fsSL https://raw.githubusercontent.com/jcaillon/valet/latest/valet.d/commands.d/self-install.sh)" -s --unattended
33-
git clone --reference latest https://github.com/jcaillon/devops-toolbox ~/.valet/devops-toolbox
33+
git clone --reference latest https://github.com/jcaillon/valet-devops-toolbox ~/.valet/valet-devops-toolbox
3434
valet self build
3535
```
3636

docs/content/docs/900.contributing/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ url: /docs/contributing
88

99
Please check the [CONTRIBUTING.md][contributing] documentation if you intend to work on this project.
1010

11-
[contributing]: [CONTRIBUTING.md](https://github.com/jcaillon/devops-toolbox/blob/main/CONTRIBUTING.md)
11+
[contributing]: [CONTRIBUTING.md](https://github.com/jcaillon/valet-devops-toolbox/blob/main/CONTRIBUTING.md)

docs/hugo.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
baseURL: https://jcaillon.github.io/devops-toolbox/
1+
baseURL: https://jcaillon.github.io/valet-devops-toolbox/
22
languageCode: en-us
33
title: DevOps Toolbox
44
module:
@@ -36,12 +36,12 @@ menu:
3636
type: search
3737
- name: Discussions ↗
3838
weight: 50
39-
url: "https://github.com/jcaillon/devops-toolbox/discussions"
39+
url: "https://github.com/jcaillon/valet-devops-toolbox/discussions"
4040
params:
4141
icon: chat-alt-2
4242
- name: GitHub ↗
4343
weight: 50
44-
url: "https://github.com/jcaillon/devops-toolbox"
44+
url: "https://github.com/jcaillon/valet-devops-toolbox"
4545
params:
4646
icon: github
4747

@@ -64,7 +64,7 @@ params:
6464
logo:
6565
path: favicon.svg
6666
dark: favicon-dark.svg
67-
link: /devops-toolbox/
67+
link: /valet-devops-toolbox/
6868
width: 50
6969

7070
footer:
@@ -73,7 +73,7 @@ params:
7373

7474
editURL:
7575
enable: true
76-
base: "https://github.com/jcaillon/devops-toolbox/edit/main/docs/content"
76+
base: "https://github.com/jcaillon/valet-devops-toolbox/edit/main/docs/content"
7777

7878
page:
7979
# full (100%), wide (90rem), normal (1280px)

libs.d/lib-gitlab

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
# author: github.com/jcaillon
3+
# description: This script can be sourced by commands to provide convenient functions.
4+
5+
# ## gitlab::getProjects
6+
#
7+
# Returns the list of projects for the current user from the GitLab API.
8+
#
9+
# - $1: role _as string_:
10+
# The minimum role to filter the projects. Can be: `guest`, `reporter`, `developer`, `maintainer`, `owner`.
11+
#
12+
# Returns:
13+
#
14+
# - `RETURNED_ARRAY`: The list of projects.
15+
#
16+
# ```bash
17+
# gitlab::getProjects "developer"
18+
# for project in "${RETURNED_ARRAY[@]}"; do
19+
# echo "$project"
20+
# done
21+
# ```
22+
function gitlab::getProjects() {
23+
:;
24+
}

0 commit comments

Comments
 (0)