You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/usr/bin/env bash
- #
- # Test the GitLab web api
- #
- # Author: donkey <anjingyu_ws@foxmail.com>
-
- readonly GITLAB_TOKEN=${GITLAB_PRIVATE_TOKEN:-""}
- readonly GITLAB_URL="https://<host>/api/v4"
-
- if [ -z $GITLAB_TOKEN ]; then
- echo "Please define the private token: GITLAB_PRIVATE_TOKEN"
- exit -1
- fi
-
- echo "$GITLAB_URL/projects/$1"
-
- curl -sS -X PUT \
- -H "PRIVATE-TOKEN: $GITLAB_TOKEN" \
- --url "$GITLAB_URL/projects/$1" \
- --data "default_branch=$2"
|