Skip to content

Commit

Permalink
Merge pull request hygieia#321 from jimzucker/mergecollector
Browse files Browse the repository at this point in the history
Merge Collector DockerFile changes to master
  • Loading branch information
Tapabrata "Topo" Pal committed Feb 9, 2016
2 parents 76c74f4 + 70e9c1c commit 4a28e21
Show file tree
Hide file tree
Showing 28 changed files with 1,117 additions and 800 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ logs
# Eclipse specific ignore settings
.settings/
.project
.pmdruleset.xml
.pmd
.classpath
89 changes: 68 additions & 21 deletions Setup.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://pbs.twimg.com/profile_images/461570480298663937/N78Jgl-f_400x400.jpeg" width="150";height="50"/>![Image](/UI/src/assets/images/Hygieia_b.png)
:<img src="https://pbs.twimg.com/profile_images/461570480298663937/N78Jgl-f_400x400.jpeg" width="150";height="50"/>![Image](/UI/src/assets/images/Hygieia_b.png)
--

### Build Hygieia
Expand Down Expand Up @@ -28,18 +28,18 @@ The following components are required to run Hygieia:
switched to db dashboardb
> db.createUser(
{
user: "dashboarduser",
pwd: "1qazxSw2",
user: "db",
pwd: "dbpass",
roles: [
{role: "readWrite", db: "dashboarddb"}
{role: "readWrite", db: "dashboard"}
]
})
Successfully added user: {
"user" : "dashboarduser",
"user" : "db",
"roles" : [
{
"role" : "readWrite",
"db" : "dashboarddb"
"db" : "dashboard"
}
]
}
Expand Down Expand Up @@ -124,22 +124,12 @@ Tests should now run/pass when built from behind a corporate proxy, even if it i

Only the above proxy settings (non authentication) may required to be set on your deployment instance. Additionally, please updated all property files for each collector/API configuration with their specific proxy setting property.

### Build Docker images
### Build Docker images and setup id for mongodb

* Build the API Image
* Build the containers

```bash
mvn clean package
```

```bash
mvn -pl api docker:build
```

* Build the UI Image

```bash
mvn -pl UI docker:build
mvn docker:build
```

* Bring up the container images
Expand All @@ -148,12 +138,50 @@ mvn -pl UI docker:build
docker-compose up -d
```

* Create user in mongo
* Create user in mongo (if you log into the container then you dont have to install mongo locally)

```bash
docker exec -t -i mongodb2 bash
```
```bash
mongo 192.168.64.2/admin --eval 'db.getSiblingDB("dashboard").createUser({user: "db", pwd: "dbpass", roles: [{role: "readWrite", db: "dashboard"}]})'
```

## Create a docker-compose.override.yml to configure your environment
### These are the most common entries, the uncommented ones are mandatory if you want the collector to work
### For dev/testing you will find it useful to change the CRON entries to "0 * * * * *"
```
hygieia-github-scm-collector:
environment:
- GITHUB_HOST=github.com
- GITHUB_CRON=0 * * * * *
- GITHUB_COMMIT_THRESHOLD_DAYS=300
hygieia-jira-feature-collector:
environment:
- JIRA_BASE_URL=https://mycompany.atlassian.net/
- JIRA_CREDENTIALS=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- JIRA_ISSUE_TYPE_ID=10200
- JIRA_SPRINT_DATA_FIELD_NAME=customfield_10007
- JIRA_EPIC_FIELD_NAME=customfield_10008
hygieia-jenkins-build-collector:
environment:
- JENKINS_CRON=0 * * * * *
- JENKINS_MASTER=https://192.168.99.100:9100
- JENKINS_USERNAME=XXXXXXXXXXXXXXXXXXXXXX
- JENKINS_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXX
hygieia-jenkins-cucumber-test-collector:
environment:
- JENKINS_CRON=0 * * * * *
- JENKINS_MASTER=https://192.168.99.100:9100
- JENKINS_USERNAME=XXXXXXXXXXXXXXXXXXXXXX
- JENKINS_API_KEY=XXXXXXXXXXXXXXXXX
- JENKINS_CUCUMBER_JSON_FILENAME=cucumber-report.json
hygieia-sonar-codequality-collector:
environment:
- SONAR_URL=https://192.168.99.100:9000
- SONAR_CRON=0 * * * * *
```

* Make sure everything is restarted _it may fail if the user doesn't exist at start up time_

```bash
Expand All @@ -166,7 +194,26 @@ docker-compose restart
docker port hygieia-ui
```

### Start Collectors
## How to setup test data
###1. Setup GIT - by configuring it to point to the github master branch for Hygieia
a. In the SCM panel, select 'git'
b. Enter the URL: 'https://github.com/capitalone/Hygieia.git' (without the quotes)
c. Set the branch to 'master' (without the quotes)
ote: For this to work you will need to have set your credentials on the ID that the collectors is running under, the best way to do this is first clone the repo to set your credentials.

###2. Setup Sonar - by running a test instance of sonar
a. docker-compose -f test-servers/sonar/sonar.yml up -d
b. Fill it with data from the Hygieia project
mvn sonar:sonar -Dsonar.host.url=https://$(docker-machine ip default):9000 -Dsonar.jdbc.url="jdbc:h2:tcp:https://$(docker-machine ip default)/sonar"
c. You can now go in and configure the quality panel in the UI.

###3. Setup Jenkins w/cucumber output - by starting a test jenkins master
a. docker-compose -f test-servers/jenkins/jenkins.yml up -d
b. Run the job: https://192.168.99.100:9100/job/Hygieia_Example_Job/build
c. Configure the Jenkins Build and Jenkins Cucumber panels using this jobs output.


## Start Collectors in the background (optional as they are all running in containers by default)
* To start individual collector as a background process please run the command in below format
* On linux platform
```bash
Expand Down
171 changes: 86 additions & 85 deletions UI/pom.xml
Original file line number Diff line number Diff line change
@@ -1,100 +1,101 @@
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>UI</artifactId>
<packaging>pom</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<description>Hygieia UI module</description>
<url>https://github.com/capitalone/Hygieia</url>
<project xmlns="https://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 https://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>UI</artifactId>
<packaging>pom</packaging>
<name>${project.groupId}:${project.artifactId}</name>
<description>Hygieia UI module</description>
<url>https://github.com/capitalone/Hygieia</url>

<parent>
<groupId>com.capitalone.dashboard</groupId>
<artifactId>Hygieia</artifactId>
<version>1.5.0-SNAPSHOT</version>
</parent>
<parent>
<groupId>com.capitalone.dashboard</groupId>
<artifactId>Hygieia</artifactId>
<version>1.5.0-SNAPSHOT</version>
</parent>

<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- if you have issues with your proxy, be careful https://github.com/eirslett/frontend-maven-plugin/commit/bcd8a7883703e28e3c5346e1f34c64332994e442 -->
<version>0.0.25</version>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- if you have issues with your proxy, be careful https://github.com/eirslett/frontend-maven-plugin/commit/bcd8a7883703e28e3c5346e1f34c64332994e442 -->
<version>0.0.25</version>

<configuration>
<workingDirectory>./</workingDirectory>
</configuration>
<configuration>
<workingDirectory>./</workingDirectory>
</configuration>

<executions>
<executions>

<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v0.12.0</nodeVersion>
<npmVersion>2.7.1</npmVersion>
</configuration>
</execution>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v0.12.0</nodeVersion>
<npmVersion>2.7.1</npmVersion>
</configuration>
</execution>

<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
<arguments>install</arguments>
</configuration>
</execution>

<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>

<execution>
<id>gulp build</id>
<goals>
<goal>gulp</goal>
</goals>
<execution>
<id>gulp build</id>
<goals>
<goal>gulp</goal>
</goals>

<!-- optional: the default phase is "generate-resources" -->
<phase>generate-resources</phase>
<!-- optional: the default phase is "generate-resources" -->
<phase>generate-resources</phase>

<configuration>
<!-- optional: if not specified, it will run gulp's default
task (and you can remove this whole <configuration> section.) -->
<arguments>build</arguments>
</configuration>
</execution>
<configuration>
<!-- optional: if not specified, it will run gulp's default task (and
you can remove this whole <configuration> section.) -->
<arguments>build</arguments>
</configuration>
</execution>

</executions>
</executions>

</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.3.3</version>
<configuration>
<imageName>hygieia-ui</imageName>
<dockerDirectory>${project.basedir}/docker</dockerDirectory>
<resources>
</plugin>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<skipDockerBuild>false</skipDockerBuild>
<imageName>hygieia-ui</imageName>
<dockerDirectory>${project.basedir}/docker</dockerDirectory>
<resources>

<resource>
<targetPath>html</targetPath>
<directory>${project.basedir}/dist</directory>
<include>*/**</include>
</resource>
<resource>
<targetPath>html</targetPath>
<directory>${project.basedir}/dist</directory>
<include>*/**</include>
</resource>

</resources>
</configuration>
</plugin>
</plugins>
</build>
</resources>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 4a28e21

Please sign in to comment.