Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thaddeusjiang/gitlab_cli
GitLab's unofficial command line tool
https://github.com/thaddeusjiang/gitlab_cli
cli elixir gitlab
Last synced: 12 days ago
JSON representation
GitLab's unofficial command line tool
- Host: GitHub
- URL: https://github.com/thaddeusjiang/gitlab_cli
- Owner: ThaddeusJiang
- Created: 2024-02-19T10:23:15.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-02-19T12:53:45.000Z (10 months ago)
- Last Synced: 2024-12-05T05:42:30.224Z (20 days ago)
- Topics: cli, elixir, gitlab
- Language: Elixir
- Homepage: https://hexdocs.pm/gitlab_cli/
- Size: 132 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitLab CLI
GitLab's unofficial command line tool
[![Hex.pm version](https://img.shields.io/hexpm/v/gitlab_cli.svg)](https://hex.pm/packages/gitlab_cli)
## Demo
- source repository: [https://gitlab.com/ThaddeusJiang/gitlab_cli](https://gitlab.com/ThaddeusJiang/gitlab_cli)
- target repository: [https://gitlab.com/ThaddeusJiang/gitlab_cli_deploy](https://gitlab.com/ThaddeusJiang/gitlab_cli_deploy)## Usage
Used in `gitlab-ci.yml`:
```yaml
run:
image: elixir:latest
script:
- mix local.hex --force
- mix local.rebar --force
- mix escript.install hex gitlab_cli --force
- export PATH=$PATH:/root/.mix/escripts
- gitlab_cli --project-id 54958131 \
--source-branch "deploy-main" --target-branch "main" \
--file-path "src/dev.yml" --pattern "charge-backend:.*" --content "charge-backend:${CI_COMMIT_SHA}"
```Environment variables
- `GITLAB_PRIVATE_TOKEN` - The GitLab private token. (required)
Parameters
- `--project-id` - The GitLab project id. (required)
- `--source-branch` - The source branch. (required)
- `--target-branch` - The target branch. (required)
- `--file-path` - The file path. (required)
- `--pattern` - The pattern to search for. (required) syntax: `prefix:.*`
- `--content` - The content to replace with. (required) syntax: `prefix:new-value`## Development
```bash
mix deps.getiex -S mix
```### Test
```bash
mix test
```### Build
```bash
mix escript.build
```### Publish
```bash
mix test
mix docsmix hex.publish
```