forked from nelito/pal-tracker-distributed
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3910577
Showing
128 changed files
with
5,431 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.gradle | ||
build | ||
.idea | ||
*.iml | ||
*.ipr | ||
*.iws | ||
.DS_Store | ||
.env | ||
ci/variables.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
dist: trusty | ||
sudo: required | ||
notifications: | ||
email: false | ||
env: | ||
- RELEASE_TAG="release-$TRAVIS_BUILD_NUMBER" | ||
stages: | ||
- build and publish | ||
- deploy | ||
- migrate | ||
if: tag IS blank | ||
|
||
jobs: | ||
include: | ||
- stage: build and publish | ||
language: java | ||
jdk: openjdk11 | ||
addons: | ||
mariadb: '10.2' | ||
install: skip | ||
before_script: | ||
- mysql -uroot < databases/create_databases.sql | ||
- ./gradlew testMigrate | ||
script: | ||
- APPLICATION=allocations | ||
- ./gradlew clean :applications:${APPLICATION}-server:build | ||
before_deploy: | ||
- git config --local user.name "Travis CI" | ||
- git config --local user.email "[email protected]" | ||
- git tag -f $RELEASE_TAG | ||
deploy: &github | ||
provider: releases | ||
api_key: $GITHUB_OAUTH_TOKEN | ||
file: | ||
- "applications/${APPLICATION}-server/build/libs/${APPLICATION}-server.jar" | ||
skip_cleanup: true | ||
|
||
- stage: build and publish | ||
language: java | ||
jdk: openjdk11 | ||
addons: | ||
mariadb: '10.2' | ||
install: skip | ||
before_script: | ||
- mysql -uroot < databases/create_databases.sql | ||
- ./gradlew testMigrate | ||
script: | ||
- APPLICATION=backlog | ||
- ./gradlew clean :applications:${APPLICATION}-server:build | ||
before_deploy: | ||
- git config --local user.name "Travis CI" | ||
- git config --local user.email "[email protected]" | ||
- git tag -f $RELEASE_TAG | ||
deploy: | ||
<<: *github | ||
|
||
- stage: build and publish | ||
language: java | ||
jdk: openjdk11 | ||
addons: | ||
mariadb: '10.2' | ||
install: skip | ||
before_script: | ||
- mysql -uroot < databases/create_databases.sql | ||
- ./gradlew testMigrate | ||
script: | ||
- APPLICATION=registration | ||
- ./gradlew clean :applications:${APPLICATION}-server:build | ||
before_deploy: | ||
- git config --local user.name "Travis CI" | ||
- git config --local user.email "[email protected]" | ||
- git tag -f $RELEASE_TAG | ||
deploy: | ||
<<: *github | ||
|
||
- stage: build and publish | ||
language: java | ||
jdk: openjdk11 | ||
addons: | ||
mariadb: '10.2' | ||
install: skip | ||
before_script: | ||
- mysql -uroot < databases/create_databases.sql | ||
- ./gradlew testMigrate | ||
script: | ||
- APPLICATION=timesheets | ||
- ./gradlew clean :applications:${APPLICATION}-server:build | ||
before_deploy: | ||
- git config --local user.name "Travis CI" | ||
- git config --local user.email "[email protected]" | ||
- git tag -f $RELEASE_TAG | ||
deploy: | ||
<<: *github | ||
|
||
- stage: deploy | ||
language: bash | ||
script: | ||
- echo "Downloading allocations server $RELEASE_TAG" | ||
- wget -P applications/allocations-server/build/libs https://github.com/$GITHUB_USERNAME/pal-tracker-distributed/releases/download/$RELEASE_TAG/allocations-server.jar | ||
before_deploy: | ||
- cp manifest-allocations.yml manifest.yml | ||
- echo "Deploying allocations server $RELEASE_TAG" | ||
deploy: &cloudfoundry | ||
provider: cloudfoundry | ||
api: $CF_API_URL | ||
username: $CF_USERNAME | ||
password: $CF_PASSWORD | ||
organization: $CF_ORG | ||
space: $CF_SPACE | ||
- stage: deploy | ||
language: bash | ||
script: | ||
- echo "Downloading backlog server $RELEASE_TAG" | ||
- wget -P applications/backlog-server/build/libs https://github.com/$GITHUB_USERNAME/pal-tracker-distributed/releases/download/$RELEASE_TAG/backlog-server.jar | ||
before_deploy: | ||
- cp manifest-backlog.yml manifest.yml | ||
- echo "Deploying backlog server $RELEASE_TAG" | ||
deploy: | ||
<<: *cloudfoundry | ||
- stage: deploy | ||
language: bash | ||
script: | ||
- echo "Downloading registration server $RELEASE_TAG" | ||
- wget -P applications/registration-server/build/libs https://github.com/$GITHUB_USERNAME/pal-tracker-distributed/releases/download/$RELEASE_TAG/registration-server.jar | ||
before_deploy: | ||
- cp manifest-registration.yml manifest.yml | ||
- echo "Deploying registration server $RELEASE_TAG" | ||
deploy: | ||
<<: *cloudfoundry | ||
- stage: deploy | ||
language: bash | ||
script: | ||
- echo "Downloading timesheets server $RELEASE_TAG" | ||
- wget -P applications/timesheets-server/build/libs https://github.com/$GITHUB_USERNAME/pal-tracker-distributed/releases/download/$RELEASE_TAG/timesheets-server.jar | ||
before_deploy: | ||
- cp manifest-timesheets.yml manifest.yml | ||
- echo "Deploying timesheets server $RELEASE_TAG" | ||
deploy: | ||
<<: *cloudfoundry | ||
- stage: migrate | ||
language: java | ||
before_install: | ||
- wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key | sudo apt-key add - | ||
- echo "deb https://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list | ||
- sudo apt-get update | ||
- sudo apt-get install cf-cli | ||
script: | ||
- cf login -a $CF_API_URL -u $CF_USERNAME -p $CF_PASSWORD -o $CF_ORG -s $CF_SPACE | ||
- ./gradlew cfMigrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apply from: "$projectDir/../server.gradle" | ||
|
||
dependencies { | ||
compile project(":components:allocations") | ||
} |
29 changes: 29 additions & 0 deletions
29
applications/allocations-server/src/main/java/io/pivotal/pal/tracker/allocations/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.pivotal.pal.tracker.allocations; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.web.client.RestOperations; | ||
|
||
import java.util.TimeZone; | ||
|
||
|
||
@SpringBootApplication | ||
@ComponentScan({"io.pivotal.pal.tracker.allocations", "io.pivotal.pal.tracker.restsupport"}) | ||
public class App { | ||
|
||
public static void main(String[] args) { | ||
TimeZone.setDefault(TimeZone.getTimeZone("UTC")); | ||
SpringApplication.run(App.class, args); | ||
} | ||
|
||
@Bean | ||
ProjectClient projectClient( | ||
RestOperations restOperations, | ||
@Value("${registration.server.endpoint}") String registrationEndpoint | ||
) { | ||
return new ProjectClient(restOperations, registrationEndpoint); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
applications/allocations-server/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring.application.name=allocations-server | ||
|
||
server.port=8081 | ||
spring.datasource.username=tracker | ||
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_allocations_dev?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false | ||
registration.server.endpoint=http://localhost:8083 |
19 changes: 19 additions & 0 deletions
19
...cations-server/src/test/java/test/pivotal/pal/tracker/allocations/AllocationsAppTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package test.pivotal.pal.tracker.allocations; | ||
|
||
import io.pivotal.pal.tracker.allocations.App; | ||
import org.junit.Test; | ||
import org.springframework.web.client.RestTemplate; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class AllocationsAppTest { | ||
|
||
@Test | ||
public void embedded() { | ||
App.main(new String[]{}); | ||
|
||
String response = new RestTemplate().getForObject("http://localhost:8181/allocations?projectId=0", String.class); | ||
|
||
assertThat(response).isEqualTo("[]"); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
applications/allocations-server/src/test/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring.application.name=allocations-server | ||
|
||
server.port=8181 | ||
spring.datasource.username=tracker | ||
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_allocations_test?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false | ||
registration.server.endpoint=http://localhost:8883 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apply from: "$projectDir/../server.gradle" | ||
|
||
dependencies { | ||
compile project(":components:backlog") | ||
} |
29 changes: 29 additions & 0 deletions
29
applications/backlog-server/src/main/java/io/pivotal/pal/tracker/backlog/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package io.pivotal.pal.tracker.backlog; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.ComponentScan; | ||
import org.springframework.web.client.RestOperations; | ||
|
||
import java.util.TimeZone; | ||
|
||
|
||
@SpringBootApplication | ||
@ComponentScan({"io.pivotal.pal.tracker.backlog", "io.pivotal.pal.tracker.restsupport"}) | ||
public class App { | ||
|
||
public static void main(String[] args) { | ||
TimeZone.setDefault(TimeZone.getTimeZone("UTC")); | ||
SpringApplication.run(App.class, args); | ||
} | ||
|
||
@Bean | ||
ProjectClient projectClient( | ||
RestOperations restOperations, | ||
@Value("${registration.server.endpoint}") String registrationEndpoint | ||
) { | ||
return new ProjectClient(restOperations, registrationEndpoint); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
applications/backlog-server/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring.application.name=backlog-server | ||
|
||
server.port=8082 | ||
spring.datasource.username=tracker | ||
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_backlog_dev?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false | ||
registration.server.endpoint=http://localhost:8083 |
19 changes: 19 additions & 0 deletions
19
...cations/backlog-server/src/test/java/test/pivotal/pal/tracker/backlog/BacklogAppTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package test.pivotal.pal.tracker.backlog; | ||
|
||
import io.pivotal.pal.tracker.backlog.App; | ||
import org.junit.Test; | ||
import org.springframework.web.client.RestTemplate; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class BacklogAppTest { | ||
|
||
@Test | ||
public void embedded() { | ||
App.main(new String[]{}); | ||
|
||
String response = new RestTemplate().getForObject("http://localhost:8181/stories?projectId=0", String.class); | ||
|
||
assertThat(response).isEqualTo("[]"); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
applications/backlog-server/src/test/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring.application.name=backlog-server | ||
|
||
server.port=8181 | ||
spring.datasource.username=tracker | ||
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_backlog_test?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false | ||
registration.server.endpoint=http://localhost:8883 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apply from: "$projectDir/../server.gradle" | ||
|
||
dependencies { | ||
compile project(":components:accounts") | ||
compile project(":components:projects") | ||
compile project(":components:users") | ||
} |
23 changes: 23 additions & 0 deletions
23
applications/registration-server/src/main/java/io/pivotal/pal/tracker/registration/App.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package io.pivotal.pal.tracker.registration; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.ComponentScan; | ||
|
||
import java.util.TimeZone; | ||
|
||
|
||
@SpringBootApplication | ||
@ComponentScan({ | ||
"io.pivotal.pal.tracker.accounts", | ||
"io.pivotal.pal.tracker.restsupport", | ||
"io.pivotal.pal.tracker.projects", | ||
"io.pivotal.pal.tracker.users", | ||
"io.pivotal.pal.tracker.registration" | ||
}) | ||
public class App { | ||
public static void main(String[] args) { | ||
TimeZone.setDefault(TimeZone.getTimeZone("UTC")); | ||
SpringApplication.run(App.class, args); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
applications/registration-server/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring.application.name=registration-server | ||
|
||
server.port=8083 | ||
spring.datasource.username=tracker | ||
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_registration_dev?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false | ||
registration.server.endpoint=http://localhost:8083 |
22 changes: 22 additions & 0 deletions
22
...ation-server/src/test/java/test/pivotal/pal/tracker/registration/RegistrationAppTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package test.pivotal.pal.tracker.registration; | ||
|
||
import io.pivotal.pal.tracker.registration.App; | ||
import org.junit.Test; | ||
import org.springframework.web.client.RestTemplate; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
public class RegistrationAppTest { | ||
|
||
@Test | ||
public void embedded() { | ||
App.main(new String[]{}); | ||
|
||
RestTemplate restTemplate = new RestTemplate(); | ||
|
||
assertThat(restTemplate.getForObject("http://localhost:8181/accounts?ownerId=0", String.class)).isEqualTo("[]"); | ||
assertThat(restTemplate.getForObject("http://localhost:8181/projects?accountId=0", String.class)).isEqualTo("[]"); | ||
assertThat(restTemplate.getForObject("http://localhost:8181/projects/0", String.class)).isEqualTo(null); | ||
assertThat(restTemplate.getForObject("http://localhost:8181/users/0", String.class)).isEqualTo(null); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
applications/registration-server/src/test/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring.application.name=registration-server | ||
|
||
server.port=8181 | ||
spring.datasource.username=tracker | ||
spring.datasource.url=jdbc:mysql://localhost:3306/tracker_registration_test?useSSL=false&useTimezone=true&serverTimezone=UTC&useLegacyDatetimeCode=false | ||
registration.server.endpoint=http://localhost:8883 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apply plugin: "org.springframework.boot" | ||
apply plugin: "io.spring.dependency-management" | ||
|
||
dependencies { | ||
compile project(":components:rest-support") | ||
|
||
compile "org.springframework.boot:spring-boot-starter-web" | ||
|
||
compile "com.zaxxer:HikariCP:$hikariVersion" | ||
compile "mysql:mysql-connector-java:$mysqlVersion" | ||
compile "ch.qos.logback:logback-classic:$logbackVersion" | ||
|
||
testCompile project(":components:test-support") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
apply from: "$projectDir/../server.gradle" | ||
|
||
dependencies { | ||
compile project(":components:timesheets") | ||
} |
Oops, something went wrong.