Skip to content

Commit

Permalink
interim checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-gupta committed Sep 19, 2015
1 parent 1641002 commit 3fc00c1
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 15 deletions.
2 changes: 1 addition & 1 deletion attendees/cicd/jenkins/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM jenkins
FROM jenkinsci/jenkins

USER root

Expand Down
4 changes: 3 additions & 1 deletion attendees/cicd/jenkins/plugins.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ workflow-cps 1.10
git-server 1.5
docker-workflow 1.2
docker-commons 1.0
script-security 1.15
script-security 1.15
authentication-tokens 1.1
docker-commons 1.0
59 changes: 46 additions & 13 deletions attendees/cicd/readme.adoc
Original file line number Diff line number Diff line change
@@ -1,31 +1,64 @@
== Continuous Deployment using Jenkins and Docker
== Continuous Deployment using Jenkins and Docker Workflow

All instructions and resources are in `attendees/cicd` directory.
All instructions and resources are in `attendees/cicd` directory.

NOTE: Change IP address to the Docker host where Git server is running.

=== Git
=== Configure Docker Machine

. Start Git server by following link:git-server/README.adoc[]
. Create a new repository `javaee7-docker-workflow`.
. Add a new Java EE sample that has Arquillian tests and packaged as Docker image:
. Enable Docker commands in Jenkins `docker-machine ssh <MACHINE_NAME> "sudo chmod 777 /var/run/docker.sock"`

git clone https://github.com/javaee-samples/javaee7-docker-workflow.git
git remote add gogs http://192.168.99.101:3000/arun/javaee7-docker-workflow.git
=== Start Services

Start all services in detached mode by giving the command:

docker-compose up -d

This shows the output:

Creating git_serverdata...
Creating cicd_registry_1...
Creating cicd_jenkins_1...
Creating cicd_git_dbdata_1...
Creating cicd_git_db_1...
Creating git...

The exact output will differ as all the images may be downloaded.

=== Setup Gogs server

. Configure Gogs server by executing the script:
+
./install-gogs.sh <DOCKER_HOST_IP> <git_server_PORT>
+
For example: `./install-gogs.sh 192.168.99.100 3000`
+
This brings up the page http://<DOCKER_HOST_IP>:3000/user/sign_up in your default browser.
+
. Create an account and login using the credentials
. Create a new repository `javaee7-docker-workflow` (take all defaults)
. In a shell:
+
git clone https://github.com/arun-gupta/javaee7-docker-workflow
cd javaee7-docker-workflow
git remote add gogs http://192.168.99.100:3000/arun/javaee7-docker-workflow.git
git push gogs master
+
This workspace is a Java EE sample that has Arquillian tests and can be packaged as a Docker image.

=== Jenkins

. Start Jenkins in `jenkins` directory by giving the command `docker-compose up -d`
. Enable Docker commands in Jenkins `docker-machine ssh default "sudo chmod 777 /var/run/docker.sock"`
. Create a new workflow and use "`Workflow script from SCM`". Use the "`Repository URL`" as "`https://github.com/arun-gupta/javaee7-docker-workflow`" and "`Script Path`" as "`Jenkinsfile`".
. Access Jenkins at http://192.168.99.100:8084
. Create a new workflow and use "`Workflow script from SCM`".
. Use the "`Repository URL`" as "`https://github.com/arun-gupta/javaee7-docker-workflow`" and "`Script Path`" as "`Jenkinsfile`".
. Start a build

=== Current Status

. Checks out the application workspace from Gogs server
. Builds the application and runs the test
. Creates a Docker image for the application
. Builds the application
. Runs the test (using `mvn test -Pwildfly-managed`)
. Creates a Docker image for the application (`mvn package -Pdocker -DskipTests`)

=== TODO

Expand Down

0 comments on commit 3fc00c1

Please sign in to comment.