Last active
July 14, 2025 14:10
-
-
Save Java4all/5fc23bd19eaab85d71ed152508d35503 to your computer and use it in GitHub Desktop.
aws examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Instance ID | |
INSTANCE_ID=$(curl -s http://169.254.169.254/latest/meta-data/instance-id) | |
# Region | |
REGION=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/document \ | |
| jq -r '.region') | |
# Fetch the "Name" tag | |
NAME=$(aws ec2 describe-tags \ | |
--region $REGION \ | |
--filters Name=resource-id,Values=$INSTANCE_ID \ | |
Name=key,Values=Name \ | |
--query 'Tags[0].Value' \ | |
--output text) | |
# Fetch the "jenkins_instance" tag | |
JENKINS_INSTANCE=$(aws ec2 describe-tags \ | |
--region $REGION \ | |
--filters Name=resource-id,Values=$INSTANCE_ID \ | |
Name=key,Values=jenkins_instance \ | |
--query 'Tags[0].Value' \ | |
--output text) | |
echo "Instance Name: $NAME" | |
echo "jenkins_instance: $JENKINS_INSTANCE" | |
prefix=$(awk -v s="$str" 'BEGIN{print substr(s,1,length(s)-2)}') | |
suffix=$(awk -v s="$str" 'BEGIN{print substr(s,length(s)-1,2)}') | |
java -jar jenkins-plugin-manager-*.jar \ | |
--plugin-file plugins.txt \ | |
--plugin-download-directory ./downloaded_plugins \ | |
--jenkins-update-center http://my.local/updates/update-center.json \ | |
--jenkins-incrementals-repo-mirror http://my.local/updates/incrementals \ | |
--jenkins-plugin-info http://my.local/updates/plugin-versions.json | |
export _JAVA_OPTIONS="\ | |
-Dhttp.proxyHost=proxy.example.com \ | |
-Dhttp.proxyPort=3128 \ | |
-Dhttps.proxyHost=proxy.example.com \ | |
-Dhttps.proxyPort=3128 \ | |
-Dhttp.nonProxyHosts=\"localhost|127.*|[::1]\"\ | |
" | |
jenkins-plugin-cli \ | |
--plugin-file plugins.txt \ | |
--plugin-download-directory=./plugins | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment