<distributionManagement>
<repository>
<id>fxg-releases</id>
<url>https://nexus.x.com:8443/nexus/content/repositories/fxg-releases</url>
</repository>
<snapshotRepository>
<id>fxg-snapshots</id>
<url>https://nexus.x.com:8443/nexus/content/repositories/fxg-snapshots</url>
</snapshotRepository>
<site>
<id>mvnown</id>
<url>scpexe://maven.x.com/var/fedex/scm/mvn/httproot/site/${project.artifactId}/${project.artifactId}-${project.version}</url>
</site>
</distributionManagement>
SETTINGS XML
<settings>
<!-- Switching to c:/temp for the "document and settings" spacing issues some projects have when stepping out of the java realm to perform
function by a plugin. -->
<localRepository>${java.io.tmpdir}/${user.name}/repository</localRepository>
<interactiveMode>true</interactiveMode>
<proxies>
<proxy>
<active />
<port>3128</port>
<host>internet.proxy.fedex.com</host>
<id>FedEx VPN Proxy</id>
</proxy>
</proxies>
<servers>
<server>
<id>releases</id>
<username>scm</username>
<password>****</password>
</server>
<server>
<id>snapshots</id>
<username>dev</username>
<password>LKLKLJLKJL</password>
</server>
</servers>
<mirrors>
<mirror>
<id>proxy</id>
<name>Maven Proxy</name>
<url>http://maven.x.com:9999/nexus/content/groups/m2/</url>
<mirrorOf>external:*,!my-nexus</mirrorOf>
</mirror>
<mirror>
<id>my-nexus</id>
<name>
Maven Repository Manager running on
</name>
<url>https://nexus.x.com:8443/nexus/content/groups/m2/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<profiles>
<profile>
<id>nexus</id>
<repositories>
<repository>
<id>corp-nexus-snapshots</id>
<url>https://nexus.x.com:8443/nexus/content/repositories/fxg-snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>corp-nexus-releases</id>
<url>https://nexus.x.com:8443/nexus/content/repositories/fxg-releases</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>nexus</activeProfile>
</activeProfiles>
</settings>
Rants and ravings of a semi-autistic developer who has a hard time remembering idiotic nonsense details. Why remember it, when you know where to find it.
Tuesday, March 14, 2017
settings.xml mirrors repositories proxy
Monday, March 6, 2017
Jenkins/Cloudbees Available Environment Variables
| Name ↓ | Value |
|---|---|
| _ | |
| ANDROID_HOME | |
| BUILD_CAUSE | MANUALTRIGGER |
| BUILD_CAUSE_MANUALTRIGGER | true |
| BUILD_DISPLAY_NAME | |
| BUILD_ID | 39 |
| BUILD_NUMBER | 39 |
| BUILD_TAG | jenkins |
| BUILD_URL | https |
| DONT_DEPLOY | false |
| EXECUTOR_NUMBER | 3 |
| grunt | |
| HOME | |
| HUDSON_HOME | |
| HUDSON_SERVER_COOKIE | 4b4586c89a3e8abe |
| HUDSON_URL | https |
| JAVA_HOME | |
| JENKINS_HOME | |
| JENKINS_SERVER_COOKIE | 4b4586c89a3e8abe |
| JENKINS_URL | https |
| JOB_BASE_NAME | EFS |
| JOB_NAME | EFS |
| JOB_URL | https |
| LOGNAME | jenkins |
| NLSPATH | |
| NODE_LABELS | 2144 Android Java7 Java8 Tomcat Tomcat |
| NODE_NAME | Tomcat |
| OLDPWD | |
| PATH | |
| PATH+JDK | |
| PWD | |
| RELEASE_TAG | 1 |
| ROOT_BUILD_CAUSE | MANUALTRIGGER |
| ROOT_BUILD_CAUSE_MANUALTRIGGER | true |
| SHELL | |
| SHLVL | 1 |
| SOURCE_BRANCH | 1 |
| SSH_CLIENT | 10 |
| SSH_CONNECTION | 10 |
| USER | jenkins |
| XFILESEARCHPATH |
Friday, February 24, 2017
Remove arbitrary columns from text lines with perl and splice
Probably not the shorted ... remove the 9th and 0th column from an ls with perl and splice
find . -type f -ls | sort -k11 | perl -ne '@x=split;splice @x,9,1;splice @x,0,1; print join("\t", @x), "\n";' | tail
Friday, February 3, 2017
Moving one git repository to another git repository host
You can refer to the GitHub page "Duplicating a repository"
It uses:
git clone --mirror: to clone every references (commits, tags, branches)git push --mirror: to push everything
That would give:
git clone --mirror https://bitbucket.org/exampleuser/repository-to-mirror.git
# Make a bare mirrored clone of the repository
cd repository-to-mirror.git
git remote set-url --push origin https://github.com/exampleuser/mirrored
# Set the push location to your mirror
git push --mirror
Labels:
git
Wednesday, February 1, 2017
Jenkins / CloudBees : moving jobs between servers .... how ...
curl -s https://USER:API_TOKEIN@jenkins.prod.com:8443/jenkins/job/SCM_SVN_MODEL/config.xml | curl -X POST 'http://USER:APITOKEN@jenkins-dev.test.com:8080/jenkins/createItem?name=JOBNAME' --header "Content-Type: application/xml" -d @-Get the API token on the target machine (in this case jenkins-dev.test.com)
- Open browser and login on target machine - http://jenkins-dev.test.com:8080/jenkins/user/USER/configure - hit the API TOKEN buttonIf you want to directly copy to a folder do this ...
curl -s https://USER_SRC:APITOKEN_SRC@jenkins.prod.com:8443/jenkins/job/SCM_SVN_MODEL/config.xml | \ curl -X POST 'http://USER_TGT:APITOKEN_TGT@jenkins-dev.test.com:8080/jenkins/job/SANDBOX/createItem?name=JOBNAME' --header "Content-Type: application/xml" -d @-or if you have a list of them ....
declare -a arr=(
"SEFS_ABSTRACT_ACTION_MODEL"
"SEFS_ABSTRACT_BUILD_ENV_MODEL"
"SEFS_ABSTRACT_BUILD_MODEL"
"SEFS_ABSTRACT_SCM_MODEL"
"SEFS_ABSTRACT_TEST_MODEL"
"SEFS_BASE_AUX_MODEL"
"SEFS_BUILDER_TMPL"
"SEFS_JAVA_BUILD_MODEL"
"SEFS_MASTER_BUILD_TMPL"
"SEFS_PROJECT_TMPL"
"SEFS_SCM_GIT_MODEL"
"SEFS_SCM_SVN_MODEL"
"SEFS_SILVER_FABRIC_DEPLOY_TMPLT"
"SEFS_STANDARD_BUILD_ENV_MODEL"
"SEFS_TEST_JUNIT_MODEL"
"SEFS_TIBCO_BUILD_MODEL"
"SEFS_UC_DEPLOY_MODEL")
## now loop through the above array
for i in "${arr[@]}"
do
curl -s https://USERID_SRC:2615adec2asas558a20790eec2994096c3c455b43@jenkins.prod.com:8443/jenkins/job/$i/config.xml | curl -X POST "http://USERID_TGT:efd517beb69f2ca1sfasfd81371885a48a928cf565@jenkins-dev.test.com:8080/jenkins/job/SANDBOX/createItem?name=$i" --header "Content-Type: application/xml" -d @-
# or do whatever with individual element of the array
done
Tuesday, January 31, 2017
Jenkins Pipeline Groovy Snippets.
Moved some of the examples to gist.github.com for organizational purposes.
Show all binding variables:
echo "${this.binding.variables}"
Change spaces in underscores for the workspace
def getWorkspace() {
pwd().replace("%2F", "_")
}
def wipeWorkspace(String workspace) {
if (workspace) {
sh "find ${workspace} -mindepth 4 -depth -delete"
}
}
Show all environment variables.
node {
sh 'env | sort'
}
Getting absolute path to a Job:
SCM_JOB is a template attribute with item -> Pipelines
[Pipeline] echo
[name:ASSEMBLY_DESCRIPTORS_BUILD,SCM_JOB:org.jenkinsci.plugins.workflow.job.WorkflowJob@3d71aee8[ShipmentEFS/COMMON/JOBS/Pipeline_leaf_caan], steps:org.jenkinsci.plugins.workflow.cps.DSL@dfb3e3d]
${SCM_JOB['fullName']} = 'ShipmentEFS/Common/Jobs/Pipeline_leaf_caan'
then we can do
node {
build job: SCM_JOB['fullName']
}
AUXILARY MODELS AND GETTNG THERE CONTENT
// List all auxilary models for logging purpose
echo "${SEFS_CONTEXT}"
echo "${SCM_MODEL}"
echo "class:${BUILD_MODEL.metaClass.toString()}"
echo "methods:${BUILD_MODEL.metaClass.methods}"
echo "fields: ${BUILD_MODEL.metaClass.fields}"
echo "toSTring: ${BUILD_MODEL.toString()}"
echo "testmodel: ${BUILD_MODEL['BUILD_TEST_MODEL']}"
try {
echo "getbinding: ${BUILD_MODEL.getValue('BUILD_TEST_MODEL')}"
} catch (error) {
echo error
}
try {
echo "model: ${BUILD_MODEL.model}"
def m=BUILD_MODEL.model
echo "meta: ${m['BUILD_TEST_MODEL']}"
} catch (error) {
echo error
echo "model: ${m.metaClass.methods}"
}
try {
echo "getmodel: ${BUILD_MODEL.getModel()}"
} catch (error) {
echo error
}
Thursday, January 5, 2017
Spring JPA Hibernate Annotated with custom orm.xml for testing against a HSQL database
Spring JPA Hibernate Annotated with custom orm.xml for testing against a HSQL database
}
DefaultPersistenceUnitManager spum = new DefaultPersistenceUnitManager();
spum.setMappingResources("META-INF/test-orm.xml");
spum.setDefaultDataSource(dataSource);
spum.setPackagesToScan("domain.entity");
spum.afterPropertiesSet();
HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
vendorAdapter.setDatabase(this.databaseVendor());
LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
factoryBean.setPersistenceUnitManager(spum);
factoryBean.setJpaVendorAdapter(vendorAdapter);
final HashMap<String, Object> properties = new HashMap<String, Object>();
properties.put("hibernate.hbm2ddl.auto",
env.getProperty("domain.hibernate.hbm2ddl.auto"));
properties.put("hibernate.dialect",
env.getProperty("domain.hibernate.dialect"));
properties.put("hibernate.show_sql",
env.getProperty("domain.hibernate.show_sql"));
properties.put("hibernate.generate_statistics",
env.getProperty("domain.hibernate.generate_statistics"));
properties.put("hibernate.format_sql",
env.getProperty("domain.hibernate.format_sql"));
properties.put("hibernate.default_schema", "SEFS_DASHBOARD_SCHEMA");
Constants.log(properties);
factoryBean.setJpaPropertyMap(properties);
factoryBean.afterPropertiesSet();
return factoryBean.getObject();
}
For debugging use this
For debugging use this
<!-- enable trace for binding -->
<logger name="org.hibernate.jpa">
<level value="debug" />
<appender-ref ref="stdout" />
</logger>
Labels:
annotation,
hibernate,
jpa,
junit,
spring,
spring-data,
test
Subscribe to:
Posts (Atom)