You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
995 B
Bash
29 lines
995 B
Bash
#!/usr/bin/env bash
|
|
# vim:ts=4:sts=4:sw=4:et
|
|
#
|
|
# Author: Hari Sekhon
|
|
# Date: 2020-11-24 17:09:11 +0000 (Tue, 24 Nov 2020)
|
|
#
|
|
# https://github.com/harisekhon/bash-tools
|
|
#
|
|
# License: see accompanying Hari Sekhon LICENSE file
|
|
#
|
|
# If you're using my code you're welcome to connect with me on LinkedIn and optionally send me feedback to help improve or steer this or other code I publish
|
|
#
|
|
# https://www.linkedin.com/in/harisekhon
|
|
#
|
|
|
|
# sets TeamCity URL to the local docker and finds and loads the current container's superuser token to the environment for immediate use with teamcity_api.sh
|
|
teamcity_local(){
|
|
TEAMCITY_SUPERUSER_TOKEN="$(
|
|
docker-compose -f "$(dirname "${BASH_SOURCE[0]}")/../setup/teamcity-docker-compose.yml" \
|
|
logs teamcity-server | \
|
|
grep -E -o 'Super user authentication token: [[:alnum:]]+' | \
|
|
tail -n1 | \
|
|
awk '{print $5}' || :
|
|
)"
|
|
|
|
export TEAMCITY_SUPERUSER_TOKEN
|
|
export TEAMCITY_URL="http://localhost:8111"
|
|
}
|