GitLab's unofficial command line tool
- source repository: https://gitlab.com/ThaddeusJiang/gitlab_cli
- target repository: https://gitlab.com/ThaddeusJiang/gitlab_cli_deploy
Used in gitlab-ci.yml
:
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
mix deps.get
iex -S mix
mix test
mix escript.build
mix test
mix docs
mix hex.publish