Added Circle CI integration
This commit is contained in:
73
.settings.xml
Normal file
73
.settings.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<settings>
|
||||
<servers>
|
||||
<server>
|
||||
<id>repo.spring.io</id>
|
||||
<username>${env.CI_DEPLOY_USERNAME}</username>
|
||||
<password>${env.CI_DEPLOY_PASSWORD}</password>
|
||||
</server>
|
||||
</servers>
|
||||
<profiles>
|
||||
<profile>
|
||||
<!--
|
||||
N.B. this profile is only here to support users and IDEs that do not use Maven 3.3.
|
||||
It isn't needed on the command line if you use the wrapper script (mvnw) or if you use
|
||||
a native Maven with the right version. Eclipse users should points their Maven tooling to
|
||||
this settings file, or copy the profile into their ~/.m2/settings.xml.
|
||||
-->
|
||||
<id>spring</id>
|
||||
<activation><activeByDefault>true</activeByDefault></activation>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>http://repo.spring.io/libs-snapshot-local</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spring-milestones</id>
|
||||
<name>Spring Milestones</name>
|
||||
<url>http://repo.spring.io/libs-milestone-local</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
<repository>
|
||||
<id>spring-releases</id>
|
||||
<name>Spring Releases</name>
|
||||
<url>http://repo.spring.io/release</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>http://repo.spring.io/libs-snapshot-local</url>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
<pluginRepository>
|
||||
<id>spring-milestones</id>
|
||||
<name>Spring Milestones</name>
|
||||
<url>http://repo.spring.io/libs-milestone-local</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
<profile>
|
||||
<!--
|
||||
Turns on jdk8 for tests
|
||||
-->
|
||||
<id>ide</id>
|
||||
<activation><activeByDefault>true</activeByDefault></activation>
|
||||
</profile>
|
||||
</profiles>
|
||||
</settings>
|
||||
24
.travis.yml
24
.travis.yml
@@ -1,24 +0,0 @@
|
||||
language: java
|
||||
jdk:
|
||||
- oraclejdk8
|
||||
sudo: required
|
||||
dist: trusty
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
- $HOME/.gradle
|
||||
install:
|
||||
- ./mvnw install -P docs -q -U -DskipTests=true $MVN_LOCAL_OPTS
|
||||
script:
|
||||
- |
|
||||
echo "Running Spring Cloud Contract Verifier"
|
||||
./mvnw clean install
|
||||
cd spring-cloud-contract-verifier-gradle-plugin
|
||||
./gradlew clean build install
|
||||
|
||||
echo "Checking if samples are not broken"
|
||||
cd ..
|
||||
./scripts/runTests.sh
|
||||
env:
|
||||
global:
|
||||
- TERM=dumb
|
||||
@@ -7,7 +7,7 @@
|
||||
:documentation_url: http://codearte.github.io/accurest
|
||||
|
||||
image::https://badges.gitter.im/Join%20Chat.svg[Gitter, link="https://gitter.im/spring-cloud/spring-cloud-contract?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]
|
||||
image::https://travis-ci.org/spring-cloud/spring-cloud-contract.svg?branch=master[Build Status, link=https://travis-ci.org/spring-cloud/spring-cloud-contract]
|
||||
image:https://circleci.com/gh/spring-cloud/spring-cloud-contract.svg?style=svg["CircleCI", link="https://circleci.com/gh/spring-cloud/spring-cloud-contract"]
|
||||
|
||||
= Spring Cloud Contract
|
||||
|
||||
@@ -190,7 +190,7 @@ follow the guidelines below.
|
||||
|
||||
=== Sign the Contributor License Agreement
|
||||
Before we accept a non-trivial patch or pull request we will need you to sign the
|
||||
https://support.springsource.com/spring_committer_signup[contributor's agreement].
|
||||
https://cla.pivotal.io/sign/spring[Contributor License Agreement].
|
||||
Signing the contributor's agreement does not grant anyone commit rights to the main
|
||||
repository, but it does mean that we can accept your contributions, and you will get an
|
||||
author credit if we do. Active contributors might be asked to join the core team, and
|
||||
|
||||
47
circle.yml
Normal file
47
circle.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
machine:
|
||||
java:
|
||||
version: oraclejdk8
|
||||
environment:
|
||||
_JAVA_OPTIONS: "-Xms512m -Xmx1024m"
|
||||
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1024m -XX:+HeapDumpOnOutOfMemoryError"'
|
||||
TERM: dumb
|
||||
dependencies:
|
||||
pre:
|
||||
- |
|
||||
sudo service zookeeper stop || echo "Service not running"
|
||||
sudo service cassandra stop || echo "Service not running"
|
||||
sudo service elasticsearch stop || echo "Service not running"
|
||||
sudo service rabbitmq-server stop || echo "Service not running"
|
||||
sudo service redis stop || echo "Service not running"
|
||||
sudo service riak stop || echo "Service not running"
|
||||
sudo service beanstalkd stop || echo "Service not running"
|
||||
sudo service couchbase-server stop || echo "Service not running"
|
||||
sudo service neo4j stop || echo "Service not running"
|
||||
sudo service sphinxsearch stop || echo "Service not running"
|
||||
sudo service postgresql stop || echo "Service not running"
|
||||
- touch ~/.gradle/gradle.properties && echo "org.gradle.daemon=false" >> ~/.gradle/gradle.properties
|
||||
override:
|
||||
- ./mvnw -s .settings.xml --fail-never dependency:go-offline || true
|
||||
test:
|
||||
override:
|
||||
# docs take 15 minutes to run
|
||||
#- ./mvnw install -P docs -q -U -DskipTests=true $MVN_LOCAL_OPTS
|
||||
- |
|
||||
echo "Running Spring Cloud Contract Verifier"
|
||||
./mvnw clean install --batch-mode -Dmaven.test.redirectTestOutputToFile=true -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
|
||||
- |
|
||||
echo "Running Spring Cloud Contract Verifier Gradle Plugin"
|
||||
cd spring-cloud-contract-verifier-gradle-plugin
|
||||
./gradlew clean build install
|
||||
- |
|
||||
echo "Checking if samples are not broken"
|
||||
./scripts/runTests.sh
|
||||
post:
|
||||
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
|
||||
- find . -type f -regex ".*/target/.*-reports/.*" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
|
||||
- find . -type f -regex ".*/build/test-results/.*" -exec cp {} $CIRCLE_TEST_REPORTS/junit/ \;
|
||||
notify:
|
||||
webhooks:
|
||||
# A list of hook hashes, containing the url field
|
||||
# gitter hook
|
||||
- url: https://webhooks.gitter.im/e/ece0ece9a76a5af2aa91
|
||||
@@ -5,7 +5,7 @@
|
||||
:documentation_url: http://codearte.github.io/accurest
|
||||
|
||||
image::https://badges.gitter.im/Join%20Chat.svg[Gitter, link="https://gitter.im/spring-cloud/spring-cloud-contract?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge"]
|
||||
image::https://travis-ci.org/spring-cloud/spring-cloud-contract.svg?branch=master[Build Status, link=https://travis-ci.org/spring-cloud/spring-cloud-contract]
|
||||
image:https://circleci.com/gh/spring-cloud/spring-cloud-contract.svg?style=svg["CircleCI", link="https://circleci.com/gh/spring-cloud/spring-cloud-contract"]
|
||||
|
||||
= Spring Cloud Contract
|
||||
|
||||
|
||||
5
pom.xml
5
pom.xml
@@ -96,11 +96,6 @@
|
||||
<artifactId>spring-cloud-verifier-messaging-stream</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud.contract</groupId>
|
||||
<artifactId>spring-cloud-verifier-camel</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-ribbon</artifactId>
|
||||
|
||||
@@ -16,23 +16,24 @@
|
||||
|
||||
package org.springframework.cloud.contract.stubrunner.spring.cloud
|
||||
|
||||
import groovy.util.logging.Slf4j
|
||||
import org.apache.curator.test.TestingServer
|
||||
import org.springframework.beans.factory.annotation.Autowired
|
||||
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
|
||||
import org.springframework.boot.test.IntegrationTest;
|
||||
import org.springframework.boot.test.IntegrationTest
|
||||
import org.springframework.boot.test.SpringApplicationContextLoader
|
||||
import org.springframework.boot.test.WebIntegrationTest
|
||||
import org.springframework.cloud.contract.stubrunner.StubFinder
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient
|
||||
import org.springframework.cloud.client.loadbalancer.LoadBalanced
|
||||
import org.springframework.cloud.contract.stubrunner.StubFinder
|
||||
import org.springframework.cloud.zookeeper.ZookeeperProperties
|
||||
import org.springframework.cloud.zookeeper.discovery.ZookeeperServiceDiscovery
|
||||
import org.springframework.context.ConfigurableApplicationContext
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
import org.springframework.test.context.ContextConfiguration
|
||||
import org.springframework.util.SocketUtils
|
||||
import org.springframework.web.client.RestTemplate
|
||||
import spock.lang.AutoCleanup
|
||||
import spock.lang.Shared
|
||||
import spock.lang.Specification
|
||||
|
||||
/**
|
||||
@@ -41,13 +42,13 @@ import spock.lang.Specification
|
||||
@ContextConfiguration(classes = Config, loader = SpringApplicationContextLoader)
|
||||
@WebIntegrationTest(randomPort = true)
|
||||
@IntegrationTest
|
||||
@Slf4j
|
||||
class StubRunnerSpringCloudAutoConfigurationSpec extends Specification {
|
||||
|
||||
@Autowired StubFinder stubFinder
|
||||
@Autowired @LoadBalanced RestTemplate restTemplate
|
||||
@Autowired ZookeeperServiceDiscovery zookeeperServiceDiscovery
|
||||
@Autowired ConfigurableApplicationContext applicationContext
|
||||
@Shared @AutoCleanup TestingServer testingServer = new TestingServer(2181)
|
||||
|
||||
def 'should make service discovery work'() {
|
||||
expect: 'WireMocks are running'
|
||||
@@ -58,15 +59,33 @@ class StubRunnerSpringCloudAutoConfigurationSpec extends Specification {
|
||||
restTemplate.getForObject('http://someNameThatShouldMapFraudDetectionServer/name', String) == 'fraudDetectionServer'
|
||||
}
|
||||
|
||||
TestingServer startTestingServer() {
|
||||
try {
|
||||
return new TestingServer(SocketUtils.findAvailableTcpPort())
|
||||
} catch (Exception e) {
|
||||
log.error("Exception occurred ")
|
||||
}
|
||||
}
|
||||
|
||||
def cleanup() {
|
||||
zookeeperServiceDiscovery.serviceDiscovery.close()
|
||||
applicationContext.close()
|
||||
}
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
@EnableDiscoveryClient
|
||||
static class Config {
|
||||
|
||||
@Bean
|
||||
TestingServer testingServer() {
|
||||
return new TestingServer(SocketUtils.findAvailableTcpPort())
|
||||
}
|
||||
|
||||
@Bean
|
||||
ZookeeperProperties zookeeperProperties() {
|
||||
return new ZookeeperProperties(connectString: testingServer().connectString)
|
||||
}
|
||||
|
||||
@Bean
|
||||
@LoadBalanced
|
||||
RestTemplate restTemplate() {
|
||||
|
||||
@@ -22,7 +22,7 @@ follow the guidelines below.
|
||||
|
||||
=== Sign the Contributor License Agreement
|
||||
Before we accept a non-trivial patch or pull request we will need you to sign the
|
||||
https://support.springsource.com/spring_committer_signup[contributor's agreement].
|
||||
https://cla.pivotal.io/sign/spring[Contributor License Agreement].
|
||||
Signing the contributor's agreement does not grant anyone commit rights to the main
|
||||
repository, but it does mean that we can accept your contributions, and you will get an
|
||||
author credit if we do. Active contributors might be asked to join the core team, and
|
||||
|
||||
Reference in New Issue
Block a user