Skip to content

Commit

Permalink
Initial CICD Docker Swarm suite
Browse files Browse the repository at this point in the history
  • Loading branch information
maxyermayank committed May 19, 2019
0 parents commit 2c6c22b
Show file tree
Hide file tree
Showing 23 changed files with 768 additions and 0 deletions.
112 changes: 112 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@

# Created by https://www.gitignore.io/api/macos,intellij
# Edit at https://www.gitignore.io/?templates=macos,intellij

### Intellij ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/modules.xml
# .idea/*.iml
# .idea/modules

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### Intellij Patch ###
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721

# *.iml
# modules.xml
# .idea/misc.xml
# *.ipr

# Sonarlint plugin
.idea/sonarlint

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# End of https://www.gitignore.io/api/macos,intellij
93 changes: 93 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# **CI/CD Suite Docker Application Package**

## **Prerequisite**
- [x] Docker: 18.09.1
- [x] Docker Compose: 1.23.2
- [x] Docker Swarm enabled (docker swarm init)
- [x] [Docker APP](https://github.com/docker/app)
- [x] [Download Docker App from here for your Environment](https://github.com/docker/app/releases)

<span style="color:green">***NOTE:*** docker-app will be available in main Docker bundle in future release.</span>

## **Add entry in /etc/hosts files**
```
127.0.0.1 test.company.com
```

## **Initialize Docker Swarm**
```
docker swarm init
```

## **Deploy Docker Registry**
```
docker run -d -p 5000:5000 --name registry registry:2
```

## **Tools**
- [x] [Jenkins](http://test.company.com/jenkins/)
- **Ports:** 8080, 443, 50000
- [x] [Nexus](http://test.company.com/nexus/)
- **Ports:** 8081
- [x] [Sonarqube](http://test.company.com/sonarqube/about)
- **Ports:** 9000
- [x] Postgres
- **Ports:** 5432
- [x] [Traefik](http://test.company.com:8080/dashboard/)
- **Ports:** 8080, 443

## **Build and Publish Jenkins Master Image**
```
docker build -t localhost:5000/jenkins:latest jenkins/
docker push localhost:5000/jenkins:latest
```

## **Build and Publish Jenkins Build Agent Image**
```
docker build -t localhost:5000/jenkinsagent:latest jenkinsagent/
docker push localhost:5000/jenkinsagent:latest
```

## **Create Docker Secret**
```
echo "admin" | docker secret create jenkins_username -
echo "admin" | docker secret create jenkins_password -
echo "admin" | docker secret create pg_password -
```

<span style="color:red">***NOTE:*** PLEASE DO NOT USE ADMIN/ADMIN as your credentials.</span>

## **Deploy Docker Application Package**
```
docker-app deploy
```
![](images/deploy.png)

## **Check Docker Service Status**
```
docker service ls
```
![](images/ServiceStatus.png)

## **Open Jenkins Master in Browser**
```
open http://test.company.com/jenkins/
```
![](images/JenkinsHome.png)

## **Open Nexus Repository Manager in Browser**
```
open http://test.company.com/nexus
```
![](images/NexusHome.png)
<span style="color:blue">***NOTE:*** Default credential admin/admin123.</span>

## **Open Sonarqube in Browser**
```
open http://test.company.com/sonarqube/
```
![](images/SonarHome.png)
<span style="color:blue">***NOTE:*** Default credential admin/admin.</span>

## **Resources**
* [Official Jenkins Docker image](https://github.com/jenkinsci/docker/blob/master/README.md)
Loading

0 comments on commit 2c6c22b

Please sign in to comment.