Skip to content

Instantly share code, notes, and snippets.

View garystafford's full-sized avatar
💭
Happily Coding!

Gary A. Stafford garystafford

💭
Happily Coding!
View GitHub Profile
@garystafford
garystafford / jenkins-glassfish-deploy-updated.xml
Last active December 27, 2015 03:29
jenkins-glassfish-deploy-updated Ant target from my blog post, 'Automated Deployment to GlassFish Using Jenkins CI Server and Apache Ant': http://wp.me/p1RD28-2I.
<!-- Older style. Not what is in repo on GitHub. -->
<target name="jenkins-glassfish-deploy-updated" depends="clean, default, test"
description="Clean, build, test and deploy application to GlassFish">
<exec failonerror="true" executable="cmd" description="Deploy to GlassFish">
<arg value="/c" />
<arg value="asadmin --echo=true --host=localhost --port=4848 --user=admin
--passwordfile=pwdfile_domain1 --secure=false
deploy --force=true --name=HelloGlassFish --contextroot=/HelloGlassFish dist\HelloGlassFish.war" />
</exec>
</target>
@garystafford
garystafford / pom.xml
Last active December 27, 2015 10:49
pom.xml contents from the repository for my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, JUnit, and GlassFish'
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.blogpost</groupId>
<artifactId>HelloGlassFishMaven</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>HelloGlassFishMaven</name>
@garystafford
garystafford / GlassFish.properties
Last active December 27, 2015 10:49
Contents of (3) Java properties files from the repository for my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, JUnit, and GlassFish'
# contents of all three files shown here
# development domain properties file
glassfish.domain=development
glassfish.host=glassfish4-app-server
glassfish.adminport=5050
glassfish.user=admin
glassfish.pwdfile=pwdfile_development
# testing domain properties file
@garystafford
garystafford / CreateGlassFishDomain.cmd
Last active December 27, 2015 13:09
Output from creation of GlassFish domain, for my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, JUnit, and GlassFish'
C:\Users\gstaffor>asadmin create-domain --domaindir "%GLASSFISH_HOME%\domains" --adminport 7070 --instanceport 7071 production
Enter admin user name [Enter to accept default "admin" / no password]>admin
Enter the admin password [Enter to accept default of no password]>
Enter the admin password again>
Using port 7070 for Admin.
Using port 7071 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
@garystafford
garystafford / GitMavenGlassFish_Build_config.xml
Last active February 11, 2016 15:53
Jenkins 'GitMavenGlassFish_Build' project config, for my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, JUnit, and GlassFish'. Can be created using restore feature of ThinBackup plugin.
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description>Clean, compile, assemble, test, and deploy application, using Maven, Git, and GlassFish</description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>5</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
@garystafford
garystafford / GitMavenGlassFish_Deploy_config.xml
Last active March 9, 2016 00:59
Jenkins 'GitMavenGlassFish_Deploy' project config, for my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, JUnit, and GlassFish'. Can be created using restore feature of ThinBackup plugin.
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description>Clean, compile, assemble, test, and deploy application, using Maven, Git, and GlassFish</description>
<logRotator class="hudson.tasks.LogRotator">
<daysToKeep>-1</daysToKeep>
<numToKeep>5</numToKeep>
<artifactDaysToKeep>-1</artifactDaysToKeep>
<artifactNumToKeep>-1</artifactNumToKeep>
</logRotator>
@garystafford
garystafford / GitMavenGlassFish_Build_54_Console.txt
Last active December 27, 2015 23:29
From part 2 of my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, and GlassFish (Part 2 of 2)'
Started by user Jenkins User
Building in workspace C:\workspace\GitMavenGlassFish_Build
Cloning the remote Git repository
Cloning repository C:\Users\gstaffor\Documents\GitServer\glassfish-maven-cd-blogpost.git
git --version
git version 1.8.4.msysgit.0
Checking out Revision 6c69a20cd549246cbde1f70ea7aaa66e61505eb3 (origin/master)
Deleting old artifacts from #53
[GitMavenGlassFish_Build] $ "C:\Program Files (x86)\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.1.1\bin\mvn.bat" -f HelloGlassFishMaven\pom.xml -s "C:\Program Files (x86)\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.1.1\conf\settings_paychex_proxy.xml" -Denvironment=testing -Dmaven.repo.local=C:\workspace\GitMavenGlassFish_Build\.repository clean install -e
[INFO] Error stacktraces are turned on.
@garystafford
garystafford / GitMavanGlassFish_Deploy_41_Console.txt
Last active December 27, 2015 23:29
From part 2 of my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, and GlassFish (Part 2 of 2)'
Started by upstream project "GitMavenGlassFish_Build" build number 55
originally caused by:
Started by user Jenkins User
Building in workspace C:\workspace\GitMavanGlassFish_Deploy
Copied 4 artifacts from "GitMavenGlassFish_Build" build number 55
[GitMavanGlassFish_Deploy] $ "C:\Program Files (x86)\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.1.1\bin\mvn.bat" -f HelloGlassFishMaven\pom.xml -s "C:\Program Files (x86)\Jenkins\tools\hudson.tasks.Maven_MavenInstallation\Maven_3.1.1\conf\settings_paychex_proxy.xml" -Denvironment=testing -Dglassfish.properties.file.argument=testing -Dmaven.repo.local=C:\workspace\GitMavanGlassFish_Deploy\.repository properties:read-project-properties glassfish:redeploy -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1/maven-compiler-plugin-3.1.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/3.1
@garystafford
garystafford / post-receive.sh
Last active December 28, 2015 01:59
From part 2 of my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, and GlassFish (Part 2 of 2)'
#!/bin/sh
# Call Jenkins to start build and pass environment parameter
#
echo "executing post-receive hook"
echo "environment=testing"
echo "user=jenkins"
# cURL POST request using jenkins user with API token
curl -u jenkins:{your-api-token-here} \
--data "delay=0sec&environment=testing" \
@garystafford
garystafford / git-clone-bare.cmd
Last active December 28, 2015 02:59
From part 2 of my blog post, 'Building a Deployment Pipeline Using Git, Maven, Jenkins, and GlassFish (Part 2 of 2)'
git clone --bare {path-to-existing-local-repository}\{name-of-repository} {name-of-repository}.git