Skip to content
This repository was archived by the owner on May 18, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 23 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pipeline {
branch "PR-*"
}
environment {
PREVIEW_VERSION = "7.1.0-SNAPSHOT-$BRANCH_NAME-$BUILD_NUMBER"
PREVIEW_VERSION = maven_project_version().replaceAll("SNAPSHOT","$BRANCH_NAME-$BUILD_NUMBER-SNAPSHOT")
PREVIEW_NAMESPACE = "$APP_NAME-$BRANCH_NAME".toLowerCase()
HELM_RELEASE = "$PREVIEW_NAMESPACE".toLowerCase()
}
Expand All @@ -33,6 +33,9 @@ pipeline {
when {
branch "${RELEASE_BRANCH}"
}
environment {
VERSION = jx_release_version()
}
steps {
container("maven") {
// ensure we're not on a detached head
Expand All @@ -41,25 +44,25 @@ pipeline {

sh "jx step git credentials"
// so we can retrieve the version in later steps
sh "echo \$(jx-release-version) > VERSION"
sh "mvn versions:set -DnewVersion=\$(cat VERSION)"
sh "echo $VERSION > VERSION"
sh "mvn versions:set -DnewVersion=$VERSION"
sh "mvn clean verify"

retry(5){
sh "git add --all"
sh "git commit -m \"Release \$(cat VERSION)\" --allow-empty"
sh "git tag -fa v\$(cat VERSION) -m \"Release version \$(cat VERSION)\""
sh "git commit -m \"Release $VERSION\" --allow-empty"
sh "git tag -fa v$VERSION -m \"Release version $VERSION\""

sh "git push origin v\$(cat VERSION)"
sh "git push origin v$VERSION"
}

sh "mvn clean deploy -DskipTests"

retry(2){
sh "updatebot push-version --kind maven ${RELEASE_ARTIFACT} \$(cat VERSION)"
sh "updatebot push-version --kind maven ${RELEASE_ARTIFACT} $VERSION"
sh "rm -rf .updatebot-repos/"
sh "sleep \$((RANDOM % 10))"
sh "updatebot push-version --kind maven ${RELEASE_ARTIFACT} \$(cat VERSION)"
sh "updatebot push-version --kind maven ${RELEASE_ARTIFACT} $VERSION"
}
}
}
Expand Down Expand Up @@ -104,3 +107,15 @@ pipeline {
}
}
}

def jx_release_version() {
container('maven') {
return sh( script: "echo \$(jx-release-version)", returnStdout: true).trim()
}
}

def maven_project_version() {
container('maven') {
return sh( script: "echo \$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout -f pom.xml)", returnStdout: true).trim()
}
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<activiti-cloud-build.version>7.1.26</activiti-cloud-build.version>
<activiti-cloud-query-service.version>7.1.208</activiti-cloud-query-service.version>
<activiti-cloud-notifications-service-graphql.version>${project.version}</activiti-cloud-notifications-service-graphql.version>
<graphql-jpa-query.version>0.3.35</graphql-jpa-query.version>
<graphql-jpa-query.version>0.4.0</graphql-jpa-query.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down
5 changes: 5 additions & 0 deletions services/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
<artifactId>jackson-annotations</artifactId>
</dependency>

<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
package org.activiti.cloud.services.notifications.graphql.web.api;

import java.util.Collections;
import java.util.Map;

import javax.validation.constraints.NotNull;

/**
* GraphQL JSON HTTP Request Wrapper Class
*/
public class GraphQLQueryRequest {

@NotNull
private String query;

private Map<String, Object> variables;

private GraphQLQueryRequest(Builder builder) {
this.query = builder.query;
this.variables = builder.variables;
}

GraphQLQueryRequest() {
}

/**
* @return the query
*/
public String getQuery() {
return this.query;
}

/**
* @return the variables
*/
public Map<String, Object> getVariables() {
return this.variables;
}

/**
* Creates builder to build {@link GraphQLQueryRequest}.
* @return created builder
*/
public static IQueryStage builder() {
return new Builder();
}

/**
* Definition of a stage for staged builder.
*/
public interface IQueryStage {

/**
* Builder method for query parameter.
* @param query field to set
* @return builder
*/
public IBuildStage withQuery(String query);
}

/**
* Definition of a stage for staged builder.
*/
public interface IBuildStage {

/**
* Builder method for variables parameter.
* @param variables field to set
* @return builder
*/
public IBuildStage withVariables(Map<String, Object> variables);

/**
* Builder method of the builder.
* @return built class
*/
public GraphQLQueryRequest build();
}

/**
* Builder to build {@link GraphQLQueryRequest}.
*/
public static final class Builder implements IQueryStage, IBuildStage {

private String query;
private Map<String, Object> variables = Collections.emptyMap();

private Builder() {
}

@Override
public IBuildStage withQuery(String query) {
this.query = query;
return this;
}

@Override
public IBuildStage withVariables(Map<String, Object> variables) {
this.variables = variables;
return this;
}

@Override
public GraphQLQueryRequest build() {
return new GraphQLQueryRequest(this);
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package org.activiti.cloud.services.notifications.graphql.web.api;

import java.util.Collections;
import java.util.List;
import java.util.Map;

public class GraphQLQueryResult {

private Map<String, Object> data;
private List<Map<String, Object>> errors;
private Map<Object, Object> extensions;

private GraphQLQueryResult(Builder builder) {
this.data = builder.data;
this.errors = builder.errors;
this.extensions = builder.extensions;
}

/**
* Default
*/
GraphQLQueryResult() {
}

public Map<String, Object> getData() {
return data;
}

public List<Map<String, Object>> getErrors() {
return errors;
}

public Map<Object, Object> getExtensions() {
return extensions;
}

/**
* Creates a builder to build {@link GraphQLQueryResult} and initialize it with the given object.
* @param graphQLQueryResult to initialize the builder with
* @return created builder
*/
public static Builder builderFrom(GraphQLQueryResult graphQLQueryResult) {
return new Builder(graphQLQueryResult);
}

/**
* Builder to build {@link GraphQLQueryResult}.
*/
public static final class Builder {

private Map<String, Object> data = Collections.emptyMap();
private List<Map<String, Object>> errors = Collections.emptyList();
private Map<Object, Object> extensions = Collections.emptyMap();

public Builder() {
}

private Builder(GraphQLQueryResult graphQLQueryResult) {
this.data = graphQLQueryResult.data;
this.errors = graphQLQueryResult.errors;
this.extensions = graphQLQueryResult.extensions;
}

/**
* Builder method for data parameter.
* @param data field to set
* @return builder
*/
public Builder withData(Map<String, Object> data) {
this.data = data;
return this;
}

/**
* Builder method for errors parameter.
* @param errors field to set
* @return builder
*/
public Builder withErrors(List<Map<String, Object>> errors) {
this.errors = errors;
return this;
}

/**
* Builder method for extensions parameter.
* @param extensions field to set
* @return builder
*/
public Builder withExtensions(Map<Object, Object> extensions) {
this.extensions = extensions;
return this;
}

/**
* Builder method of the builder.
* @return built class
*/
public GraphQLQueryResult build() {
return new GraphQLQueryResult(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@

import javax.persistence.EntityManager;

import com.introproventures.graphql.jpa.query.schema.JavaScalars;
import com.introproventures.graphql.jpa.query.schema.impl.GraphQLJpaSchemaBuilder;
import graphql.GraphQL;
import graphql.schema.GraphQLScalarType;
import graphql.schema.GraphQLSchema;
import org.activiti.cloud.notifications.graphql.schema.GraphQLSchemaConfigurer;
import org.activiti.cloud.notifications.graphql.schema.GraphQLShemaRegistration;
import org.activiti.cloud.services.query.model.ProcessInstanceEntity;
import org.activiti.cloud.services.query.model.VariableValue;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.context.annotation.Configuration;

import com.introproventures.graphql.jpa.query.autoconfigure.GraphQLSchemaConfigurer;
import com.introproventures.graphql.jpa.query.autoconfigure.GraphQLShemaRegistration;
import com.introproventures.graphql.jpa.query.schema.JavaScalars;
import com.introproventures.graphql.jpa.query.schema.impl.GraphQLJpaSchemaBuilder;
import graphql.GraphQL;
import graphql.schema.GraphQLScalarType;
import graphql.schema.GraphQLSchema;

/**
* Spring Boot auto configuration of Activiti GraphQL Query Service components
*/
Expand Down
4 changes: 4 additions & 0 deletions services/schema/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
<groupId>com.graphql-java</groupId>
<artifactId>graphql-java</artifactId>
</dependency>
<dependency>
<groupId>com.introproventures</groupId>
<artifactId>graphql-jpa-query-autoconfigure</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
Expand Down
Loading