This file contains 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
RestTemplate restTemplate = new RestTemplate(); | |
restTemplate.getInterceptors().add( | |
new BasicAuthorizationInterceptor("user", "password")); | |
String url = "YOUR_URL"; | |
ResponseEntity<String> response = null; | |
try { | |
response = restTemplate.exchange(url, | |
HttpMethod.GET, null, String.class); |
This file contains 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
version='1.0.11.1001' | |
// task incrementrevsion{ | |
def v = version | |
println v | |
String minor=v.substring(v.lastIndexOf('.')+1) //get last digit | |
int m=minor.toInteger()+1 //increment | |
// println m | |
String major=v.substring(0,v.lastIndexOf(".")); //get the beginning |
This file contains 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
pipeline { | |
agent { | |
node { | |
label 'label' | |
} | |
} | |
stages { | |
stage('checkout git') { | |
steps { | |
git credentialsId: 'ae31c482-72fc-****-8c81-662daa51f408', url: 'https://github.com/****/complicated_hello_world.git' |
This file contains 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
//tmp.sh export foo=bar | |
getFoo = " " | |
pipeline { | |
environment { | |
a="d" | |
// b="changeable" | |
} |
This file contains 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
#!/bin/bash | |
cd /opt/ | |
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz" | |
tar xzf jdk-8u161-linux-x64.tar.gz | |
echo 'export JAVA_HOME=/opt/jdk1.8.0_161 | |
export JRE_HOME=/opt/jdk1.8.0_161/jre | |
export PATH=$PATH:/opt/jdk1.8.0_161/bin:/opt/jdk1.8.0_161/jre/bin' >> /etc/environment |
This file contains 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
<settings> | |
<servers> | |
<server> | |
<id>nexus</id> | |
<username>user</username> | |
<password>user123</password> | |
</server> | |
</servers> | |
</settings> |
This file contains 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
mvn -s settings.xml deploy:deploy-file -Durl=http://nexus3:8081/repository/thirdparty/ | |
-DrepositoryId=nexus -Dfile=file.jar -DgroupId=groupId -DartifactId=artifactId -Dversion=version |
This file contains 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
#!/bin/sh | |
SERVER=$1 | |
GROUPID=$2 | |
ARTIFACTID=$3 | |
VERSION=$4 | |
USER=$5 | |
FILENAME=$6 | |
REPO=$7 | |
URL="$SERVER/nexus/service/local/artifact/maven/content" |