Fix environment variable name in monitoring script
Changed GITLAB_TOKEN to GITLAB_ACCESS_TOKEN throughout
This commit is contained in:
parent
c1d944a612
commit
b036716eb7
2 changed files with 10 additions and 10 deletions
|
|
@ -24,12 +24,12 @@ Real-time monitoring of GitLab CI/CD pipelines and Kubernetes deployments.
|
|||
2. **Export token**
|
||||
|
||||
```bash
|
||||
export GITLAB_TOKEN=<your-token>
|
||||
export GITLAB_ACCESS_TOKEN=<your-token>
|
||||
```
|
||||
|
||||
Add to your `~/.zshrc` or `~/.bashrc`:
|
||||
```bash
|
||||
export GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
|
||||
export GITLAB_ACCESS_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
3. **Install dependencies**
|
||||
|
|
@ -104,7 +104,7 @@ Refreshing in 5s... (Ctrl+C to stop)
|
|||
|
||||
### Troubleshooting
|
||||
|
||||
**"GITLAB_TOKEN not set"**
|
||||
**"GITLAB_ACCESS_TOKEN not set"**
|
||||
- Export your GitLab personal access token
|
||||
|
||||
**"jq is required"**
|
||||
|
|
|
|||
|
|
@ -34,17 +34,17 @@ usage() {
|
|||
echo " agent - Monitor towerops-agent"
|
||||
echo ""
|
||||
echo "Environment variables:"
|
||||
echo " GITLAB_TOKEN - Required for API access"
|
||||
echo " Get from: https://gitlab.com/-/profile/personal_access_tokens"
|
||||
echo " Scopes needed: read_api"
|
||||
echo " GITLAB_ACCESS_TOKEN - Required for API access"
|
||||
echo " Get from: https://gitlab.com/-/profile/personal_access_tokens"
|
||||
echo " Scopes needed: read_api"
|
||||
exit 1
|
||||
}
|
||||
|
||||
check_dependencies() {
|
||||
if [ -z "$GITLAB_TOKEN" ]; then
|
||||
echo -e "${RED}Error: GITLAB_TOKEN environment variable not set${NC}"
|
||||
if [ -z "$GITLAB_ACCESS_TOKEN" ]; then
|
||||
echo -e "${RED}Error: GITLAB_ACCESS_TOKEN environment variable not set${NC}"
|
||||
echo "Get a token from: https://gitlab.com/-/profile/personal_access_tokens"
|
||||
echo "Then export GITLAB_TOKEN=<your-token>"
|
||||
echo "Then export GITLAB_ACCESS_TOKEN=<your-token>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ get_project_info() {
|
|||
|
||||
gitlab_api() {
|
||||
local endpoint=$1
|
||||
curl -s -H "PRIVATE-TOKEN: $GITLAB_TOKEN" \
|
||||
curl -s -H "PRIVATE-TOKEN: $GITLAB_ACCESS_TOKEN" \
|
||||
"https://gitlab.com/api/v4${endpoint}"
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue