Skip to content

Instantly share code, notes, and snippets.

@Icehunter
Created November 26, 2024 03:38
Show Gist options
  • Save Icehunter/e609f46657ac7eda4a46f0e87f99dcb2 to your computer and use it in GitHub Desktop.
Save Icehunter/e609f46657ac7eda4a46f0e87f99dcb2 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Print all environment variables
echo "Environment Variables:"
env
# Alternatively, print specific environment variables
echo "MASTER: $MASTER"
echo "USERNAME: $USERNAME"
echo "PASSWORD: $PASSWORD"
echo "NAME: ${NAME:-swarm-agent}"
echo "LABELS: ${LABELS:-docker swarm linux}"
echo "EXECUTORS: ${EXECUTORS:-2}"
# Run the Swarm Client
exec java -jar /usr/share/jenkins/swarm-client.jar \
-url "${MASTER}" \
-username "${USERNAME}" \
-password "${PASSWORD}" \
-name "${NAME:-swarm-agent}" \
-labels "${LABELS:-docker swarm linux}" \
-executors "${EXECUTORS:-2}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment