Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 1.0.0 branch with master branch - 2019-12-19. #12

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
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: 11 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
## Sample artifact resources for AWS Pipeline
## Sample test cases for AWS Pipeline WSO2EI

Sample product artifacts and and sample test cases for WSO2 products. This repository is used as the sample for artifacts repository in WSO2 AWS pipeline..
Sample product artifacts and and sample test cases for WSO2 Enterprise Integrator. This repository is used as the sample for artifacts repository in WSO2 AWS pipeline for WSO2EI..

#### Add new artifacts
* Place the car file in `artifacts/deployment/server/carbonapps/` directory. Follow below naming convention when for artifacts. (c-apps).

* Different endpoint c-apps need to included for different environments. For,
production environment endpoint c-app: should contain "_production" in the name.
eg: helloworld_production_1.0.car

staging environment endpoint c-app: should contain "_staging" in the name.
eg: helloworld_staging_1.0.car

dev environment endpoint c-app: should contain "_dev" in the name.
eg: helloworld_dev_1.0.car

* Common c-app for all the environments.
should contain "_common" in the name
eg: helloworld_common_1.0.car
* A sample scenario test suite implemented using Testng is in `tests/wso2ei/` directory. This run a simple test to validate response code of a rest endpoint.

#### Add new test
* Place the tests in `test/wso2ei/` directory. Update the testng.xml file to include your test class.

* A sample scenario test suite implemented using Testng is in `test/{product}/sample-test-suite{product}` directory. This run a
simple test to validate response code of a rest endpoint. Use following command to run the test,
#### Run test suites
* Use following command to run the tests,
```
mvn test -Dendpoint=<ENDPOINT>
```

#### Add new artifacts
* Place the artifact source code in the repository. Update `buildArtifact.sh` file with correct paths to artifact code.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
37 changes: 37 additions & 0 deletions buildArtifact.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ------------------------------------------------------------------------
# Copyright 2019 WSO2, Inc. (http://wso2.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License
# ------------------------------------------------------------------------

#!/bin/bash

ARTIFACT_LOCATION=${ARTIFACT_LOC}
IMAGE_RESOURCES=${IMAGE_RESOURCES}

cd $ARTIFACT_LOCATION/helloworld/

if [ -d "artifacts" ]; then
rm -rf $ARTIFACT_LOCATION/helloworld/artifacts/*
else
mkdir artifacts
fi

cd $ARTIFACT_LOCATION/helloworld/helloworld
mvn clean install >> $ARTIFACT_LOCATION/helloworld/artifact.log
cd ../helloworld_common
mvn clean install >> $ARTIFACT_LOCATION/helloworld/artifact.log
cp -r target/* $ARTIFACT_LOCATION/helloworld/artifacts/

cp -r $ARTIFACT_LOCATION/helloworld/artifacts/* $IMAGE_RESOURCES
rm -rf $ARTIFACT_LOCATION/helloworld/artifacts
8 changes: 8 additions & 0 deletions helloworld/helloworld/artifact.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?><artifacts>
<artifact name="helloworld" groupId="com.example.helloworld.api" version="1.0.0" type="synapse/api" serverRole="EnterpriseServiceBus">
<file>src/main/synapse-config/api/helloworld.xml</file>
</artifact>
<artifact name="development" groupId="com.example.helloworld.endpoint" version="1.0.0" type="synapse/endpoint" serverRole="EnterpriseServiceBus">
<file>src/main/synapse-config/endpoints/development.xml</file>
</artifact>
</artifacts>
148 changes: 148 additions & 0 deletions helloworld/helloworld/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.helloworld</groupId>
<artifactId>helloworld</artifactId>
<version>1.0.0</version>
<packaging>pom</packaging>
<name>helloworld</name>
<description>helloworld</description>
<properties>
<maven.test.skip>false</maven.test.skip>
<CApp.type>bpel/workflow=zip,lib/registry/filter=jar,webapp/jaxws=war,lib/library/bundle=jar,service/dataservice=dbs,synapse/local-entry=xml,synapse/proxy-service=xml,carbon/application=car,registry/resource=zip,lib/dataservice/validator=jar,synapse/endpoint=xml,web/application=war,lib/carbon/ui=jar,service/axis2=aar,synapse/sequence=xml,synapse/configuration=xml,wso2/gadget=dar,lib/registry/handlers=jar,lib/synapse/mediator=jar,synapse/task=xml,synapse/api=xml,synapse/template=xml,synapse/message-store=xml,synapse/message-processors=xml,synapse/inbound-endpoint=xml</CApp.type>
</properties>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<id>wso2-nexus</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<id>wso2-nexus</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</pluginRepository>
</pluginRepositories>
<build>
<directory>target/capp</directory>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.4.0</version>
<extensions>true</extensions>
<executions>
<execution>
<id>package</id>
<phase>package</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>clean</argument>
<argument>package</argument>
<argument>-Dmaven.test.skip=${maven.test.skip}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>clean</argument>
<argument>install</argument>
<argument>-Dmaven.test.skip=${maven.test.skip}</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>deploy</id>
<phase>deploy</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>mvn</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>deploy</argument>
<argument>-Dmaven.test.skip=${maven.test.skip}</argument>
</arguments>
</configuration>
</execution>
</executions>
<configuration />
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<buildcommands />
<projectnatures>
<projectnature>org.wso2.developerstudio.eclipse.esb.project.nature</projectnature>
</projectnatures>
</configuration>
</plugin>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>wso2-esb-api-plugin</artifactId>
<version>2.1.0</version>
<extensions>true</extensions>
<executions>
<execution>
<id>api</id>
<phase>process-resources</phase>
<goals>
<goal>pom-gen</goal>
</goals>
<configuration>
<artifactLocation>.</artifactLocation>
<typeList>${artifact.types}</typeList>
</configuration>
</execution>
</executions>
<configuration />
</plugin>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>wso2-esb-endpoint-plugin</artifactId>
<version>2.1.0</version>
<extensions>true</extensions>
<executions>
<execution>
<id>endpoint</id>
<phase>process-resources</phase>
<goals>
<goal>pom-gen</goal>
</goals>
<configuration>
<artifactLocation>.</artifactLocation>
<typeList>${artifact.types}</typeList>
</configuration>
</execution>
</executions>
<configuration />
</plugin>
</plugins>
</build>
</project>
20 changes: 20 additions & 0 deletions helloworld/helloworld/src/main/synapse-config/api/helloworld.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<api context="/helloworld" name="helloworld" xmlns="http://ws.apache.org/ns/synapse">
<resource methods="GET">
<inSequence>
<property expression="$url:name" name="user_name" scope="default" type="STRING"/>
<log level="full">
<property expression="$ctx:user_name" name="user_name"/>
</log>
<payloadFactory media-type="json">
<format>{name: "WSO2 Enterprise Integrator" , message: "You have successfully deployed helloworld artifact"}</format>
<args>
<arg evaluator="xml" expression="$ctx:user_name"/>
</args>
</payloadFactory>
<respond/>
</inSequence>
<outSequence/>
<faultSequence/>
</resource>
</api>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<endpoint name="development" xmlns="http://ws.apache.org/ns/synapse">
<address uri="http://localhost:8080"/>
</endpoint>
117 changes: 117 additions & 0 deletions helloworld/helloworld_common/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example.helloworld_common</groupId>
<artifactId>helloworld_common</artifactId>
<version>1.0.0</version>
<packaging>carbon/application</packaging>
<name>helloworld_common</name>
<description>helloworld_common</description>
<properties>
<com.example.helloworld.api_._helloworld>capp/EnterpriseServiceBus</com.example.helloworld.api_._helloworld>
<com.example.helloworld.endpoint_._development>capp/EnterpriseServiceBus</com.example.helloworld.endpoint_._development>
<artifact.types>jaggery/app=zip,lib/library/bundle=jar,service/rule=aar,event/receiver=xml,synapse/message-processors=xml,synapse/endpointTemplate=xml,synapse/message-store=xml,synapse/proxy-service=xml,event/execution-plan=siddhiql,carbon/application=car,registry/resource=zip,lib/dataservice/validator=jar,synapse/endpoint=xml,web/application=war,synapse/inbound-endpoint=xml,synapse/sequence=xml,synapse/configuration=xml,synapse/task=xml,synapse/api=xml,webapp/jaxws=war,service/meta=xml,bpel/workflow=zip,synapse/lib=zip,service/dataservice=dbs,event/publisher=xml,synapse/local-entry=xml,synapse/priority-executor=xml,synapse/template=xml,synapse/event-source=xml,event/stream=json,lib/carbon/ui=jar,service/axis2=aar,synapse/sequenceTemplate=xml,wso2/gadget=dar,lib/synapse/mediator=jar</artifact.types>
</properties>
<dependencies>
<dependency>
<groupId>com.example.helloworld.api</groupId>
<artifactId>helloworld</artifactId>
<version>1.0.0</version>
<type>xml</type>
</dependency>
<dependency>
<groupId>com.example.helloworld.endpoint</groupId>
<artifactId>development</artifactId>
<version>1.0.0</version>
<type>xml</type>
</dependency>
</dependencies>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<id>wso2-nexus</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</repository>
<repository>
<id>wso2-maven2-repository-1</id>
<url>http://dist.wso2.org/maven2</url>
</repository>
<repository>
<id>wso2-nexus-repository-1</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<releases>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<id>wso2-nexus</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</pluginRepository>
<pluginRepository>
<id>wso2-maven2-repository-1</id>
<url>http://dist.wso2.org/maven2</url>
</pluginRepository>
<pluginRepository>
<id>wso2-nexus-repository-1</id>
<url>http://maven.wso2.org/nexus/content/groups/wso2-public/</url>
</pluginRepository>
</pluginRepositories>
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<buildcommands />
<projectnatures>
<projectnature>org.wso2.developerstudio.eclipse.distribution.project.nature</projectnature>
</projectnatures>
</configuration>
</plugin>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-car-plugin</artifactId>
<version>2.1.1</version>
<extensions>true</extensions>
<executions>
<execution>
<id>car</id>
<phase>package</phase>
<goals>
<goal>car</goal>
</goals>
</execution>
</executions>
<configuration />
</plugin>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>maven-car-deploy-plugin</artifactId>
<version>1.1.1</version>
<extensions>true</extensions>
<configuration>
<carbonServers>
<CarbonServer>
<trustStorePath>${basedir}/src/main/resources/security/wso2carbon.jks</trustStorePath>
<trustStorePassword>wso2carbon</trustStorePassword>
<trustStoreType>JKS</trustStoreType>
<serverUrl>https://localhost:9443</serverUrl>
<userName>admin</userName>
<password>admin</password>
<operation>deploy</operation>
</CarbonServer>
</carbonServers>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading