Skip to content

Commit

Permalink
Merge pull request #69 from niveathika/master
Browse files Browse the repository at this point in the history
Change org name to ballerina
  • Loading branch information
niveathika authored Mar 22, 2020
2 parents d9b632d + 3141697 commit c19027d
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 37 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- run: mvn clean install -pl mongo-utils
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@master
with:
args:
build -a -c --skip-tests --sourceroot mongodb
env:
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

name: Deployment

on: [release]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- run: mvn clean install -pl mongo-utils
- name: Ballerina Build
uses: ballerina-platform/ballerina-action/@master
with:
args:
build -a -c --skip-tests --sourceroot mongodb
env:
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true

- name: Ballerina Push
uses: ballerina-platform/ballerina-action/@master
with:
args:
push -a
env:
WORKING_DIR: ./mongodb
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}
11 changes: 5 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
# limitations under the License.

script:
- wget https://product-dist.ballerina.io/downloads/1.1.0/ballerina-linux-installer-x64-1.1.0.deb
- sudo dpkg -i ballerina-linux-installer-x64-1.1.0.deb
- wget https://product-dist.ballerina.io/downloads/1.2.0/ballerina-linux-installer-x64-1.2.0.deb
- sudo dpkg -i ballerina-linux-installer-x64-1.2.0.deb
- sudo apt-get install -f
- cd mongo-utils
- mvn clean install
- cd ../mongodb
- ballerina build -a -c --skip-tests
- export JAVA_OPTS="-DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true"
- mvn clean install -pl mongo-utils
- ballerina build -a -c --skip-tests --sourceroot mongodb
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/wso2-ballerina/module-mongodb.svg?branch=master)](https://travis-ci.org/wso2-ballerina/module-mongodb)
[![Build Status](https://travis-ci.org/ballerina-platform/module-mongodb.svg?branch=master)](https://travis-ci.org/ballerina-platform/module-mongodb)

Ballerina MongoDB Client is used to connect Ballerina with MongoDB data source.<br/> <br/>
With the Ballerina MongoDB client following operations are supported.
Expand All @@ -18,7 +18,7 @@ Following is a simple Ballerina program that can be used to perform CRUD operati

```ballerina
import ballerina/io;
import wso2/mongodb;
import ballerina/mongodb;
import ballerina/log;
mongodb:ClientEndpointConfig mongoConfig = {
Expand Down
2 changes: 1 addition & 1 deletion mongo-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>module-mongo</artifactId>
<groupId>org.wso2.ei</groupId>
<version>0.9.0</version>
<version>0.10.0</version>
</parent>

<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
* Constants used in the module-mongodb.
*/
public class MongoDBConstants {
public static final String ORGANIZATION_NAME = "wso2";
public static final String ORGANIZATION_NAME = "ballerina";
public static final String MODULE_NAME = "mongodb";
public static final String MODULE_VERSION = "0.9.0";
public static final String ERROR_DETAIL_RECORD_TYPE_NAME = "ErrorDetail";

//Error reasons
public static final String DATABASE_ERROR_REASON = "{wso2/mongodb}DatabaseError";
public static final String APPLICATION_ERROR_REASON = "{wso2/mongodb}ApplicationError";
public static final String DATABASE_ERROR_REASON = "{ballerina/mongodb}DatabaseError";
public static final String APPLICATION_ERROR_REASON = "{ballerina/mongodb}ApplicationError";
}
3 changes: 1 addition & 2 deletions mongo-utils/src/main/java/org/wso2/mongo/MongoDBUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import static org.wso2.mongo.MongoDBConstants.DATABASE_ERROR_REASON;
import static org.wso2.mongo.MongoDBConstants.ERROR_DETAIL_RECORD_TYPE_NAME;
import static org.wso2.mongo.MongoDBConstants.MODULE_NAME;
import static org.wso2.mongo.MongoDBConstants.MODULE_VERSION;
import static org.wso2.mongo.MongoDBConstants.ORGANIZATION_NAME;

/**
Expand All @@ -44,7 +43,7 @@ public static ErrorValue createBallerinaApplicationError(BallerinaMongoDbExcepti
}

private static MapValue createRecordValue(BallerinaMongoDbException e) {
BPackage bpackage = new BPackage(ORGANIZATION_NAME, MODULE_NAME, MODULE_VERSION);
BPackage bpackage = new BPackage(ORGANIZATION_NAME, MODULE_NAME);
MapValue recordValue = BallerinaValues.createRecordValue(bpackage, ERROR_DETAIL_RECORD_TYPE_NAME);
return BallerinaValues.createRecord(recordValue, e.getMessage(), e.getCause(), e.getDetail());
}
Expand Down
11 changes: 3 additions & 8 deletions mongodb/Ballerina.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
org_name = "wso2"
version = "0.9.0"
org_name = "ballerina"
version = "0.10.0"
lockfile_version = "1.0.0"
ballerina_version = "1.1.4"

[[imports."wso2/mongodb:0.9.0"]]
org_name = "ballerinax"
name = "java"
version = "0.0.0"
ballerina_version = "1.2.0"
12 changes: 8 additions & 4 deletions mongodb/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[project]
org-name= "wso2"
version= "0.9.0"
org-name= "ballerina"
version= "0.10.0"
license= ["Apache-2.0"]
authors = ["Ballerina"]
keywords = ["MongoDB", "NoSQL"]
repository = "https://github.com/ballerina-platform/module-mongodb"

[dependencies]

Expand All @@ -9,7 +13,7 @@ target = "java8"

[[platform.libraries]]
module = "mongodb"
path = "../mongo-utils/target/mongo-utils-0.9.0.jar"
path = "../mongo-utils/target/mongo-utils-0.10.0.jar"
artafactId = "mongo-utils"
version = "0.9.0"
version = "0.10.0"
groupId = "org.wso2.ei"
4 changes: 2 additions & 2 deletions mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,12 @@
<parent>
<artifactId>module-mongo</artifactId>
<groupId>org.wso2.ei</groupId>
<version>0.9.0</version>
<version>0.10.0</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>mongodb</artifactId>
<version>0.9.0</version>
<packaging>pom</packaging>
<name>MongoDB Module - Ballerina Implementation</name>
<url>https://ballerina.io/</url>
Expand All @@ -54,6 +53,7 @@
<argument>build</argument>
<argument>-c</argument>
<argument>-a</argument>
<argument>--skip-tests</argument>
</arguments>
</configuration>
</plugin>
Expand Down
6 changes: 3 additions & 3 deletions mongodb/src/mongodb/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ The Mongo DB connector allows you to connect to Mongo DB from Ballerina and perf

| | Version |
|:---------------------------:|:---------------------------:|
| Ballerina Language | 1.1.x |
| Ballerina Language | 1.2.0 |
| Mongo DB | V4.2.0 |

## Sample

First, import the `wso2/mongodb` module into the ballerina project.
First, import the `ballerina/mongodb` module into the ballerina project.

```ballerina
import ballerina/config;
import ballerina/log;
import wso2/mongodb;
import ballerina/mongodb;
public function main() returns error? {
host: config:getAsString("MONGO_HOST"),
Expand Down
2 changes: 1 addition & 1 deletion mongodb/src/mongodb/endpoint.bal
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
// MongoDB Client Endpoint
///////////////////////////////

import ballerinax/java;
import ballerina/java;

///////////////////////////////
// MongoDB Client Endpoint
Expand Down
4 changes: 2 additions & 2 deletions mongodb/src/mongodb/errors.bal
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public type ErrorDetail record {
};

// Error reasons
public const DATABASE_ERROR_REASON = "{wso2/mongodb}DatabaseError";
public const APPLICATION_ERROR_REASON = "{wso2/mongodb}ApplicationError";
public const DATABASE_ERROR_REASON = "{ballerina/mongodb}DatabaseError";
public const APPLICATION_ERROR_REASON = "{ballerina/mongodb}ApplicationError";

public type DatabaseError error<DATABASE_ERROR_REASON, ErrorDetail>;
public type ApplicationError error<APPLICATION_ERROR_REASON, ErrorDetail>;
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<groupId>org.wso2.ei</groupId>
<artifactId>module-mongo</artifactId>
<packaging>pom</packaging>
<version>0.9.0</version>
<version>0.10.0</version>
<name>Ballerina MongoDB Module</name>

<modules>
Expand Down Expand Up @@ -81,7 +81,7 @@
<properties>
<project-home>${project.basedir}</project-home>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<ballerina.version>1.1.4</ballerina.version>
<ballerina.version>1.2.0</ballerina.version>
<maven.checkstyleplugin.excludes>**/generated/**</maven.checkstyleplugin.excludes>
<maven.spotbugsplugin.exclude.file>spotbugs-exclude.xml</maven.spotbugsplugin.exclude.file>
<slf4j.version>1.7.21</slf4j.version>
Expand Down

0 comments on commit c19027d

Please sign in to comment.