Files
git.taskfile.build/bin/login-docker
T
Janik von Rotz 5b992d4ee0 docs(agents): refine bash guidelines and update code samples
- Expand AGENTS.md with general agent guidance and coding conventions
- Refactor bash snippets in README.md and scripts to align with style guide:
  - Use `#!/usr/bin/env bash` shebang for portability
  - Remove `function` keyword from definitions
  - Replace `[ ]` conditionals with `[[ ]]` for improved reliability
  - Rename local variables to lowercase with `local` keyword
- Introduce CHANGELOG.md to track project changes per Keep a Changelog spec
- Update taskfile.build scripts to follow consistent bash practices
2025-10-29 12:32:51 +01:00

21 lines
598 B
Bash
Executable File

#!/usr/bin/env bash
login-docker() {
if [[ -z "$1" ]]; then
echo "Enter Docker login credentials for $DOCKER_REGISTRY registry."
read -p "Enter username: " DOCKER_USERNAME
else
DOCKER_USERNAME="$1"
fi
if [[ -z "$2" ]]; then
read -s -p "Enter password: " DOCKER_PASSWORD
else
DOCKER_PASSWORD="$2"
fi
echo -e "\nRun Docker login with username $DOCKER_USERNAME."
echo "$DOCKER_PASSWORD" | docker --config "$DOCKER_CONFIG" login --username "$DOCKER_USERNAME" --password-stdin
echo "Stored credentials to $DOCKER_CONFIG."
}