Skip to content
This repository has been archived by the owner on May 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #272 from Open-MBEE/release/3.3.0
Browse files Browse the repository at this point in the history
Release/3.3.0
  • Loading branch information
HuiJun authored Jun 8, 2018
2 parents 1b805af + 9d24b8b commit fc3d23f
Show file tree
Hide file tree
Showing 379 changed files with 13,150 additions and 93,319 deletions.
122 changes: 122 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
defaults: &defaults
working_directory: ~/projects
docker:
- image: circleci/openjdk:8

version: 2
jobs:
build_amps:
<<: *defaults
steps:
- checkout

- restore_cache:
key: mms-{{ checksum "mms-ent/pom.xml" }}

- run:
name: Run Maven Build
command: cd mms-ent && sh mvnw install -Pbuild

- save_cache:
paths:
- ~/.m2
key: mms-{{ checksum "mms-ent/pom.xml" }}

- run:
name: Prepare Store Artifacts
command: mkdir -p tmp/artifacts

- store_artifacts:
path: mms-ent/repo-amp/target/mms-amp-3.3.0-SNAPSHOT.amp
destination: tmp/artifacts/mms-amp-3.3.0-SNAPSHOT.amp

- store_artifacts:
path: mms-ent/share-amp/target/mms-share-amp-3.3.0-SNAPSHOT.amp
destination: tmp/artifacts/mms-share-amp-3.3.0-SNAPSHOT.amp

- store_artifacts:
path: mms-ent/repo-amp/target/mms-java-client-3.3.0-SNAPSHOT.zip
destination: tmp/artifacts/mms-java-client-3.3.0-SNAPSHOT.zip

- store_artifacts:
path: mms-ent/repo-amp/target/mms-python-client-3.3.0-SNAPSHOT.zip
destination: tmp/artifacts/mms-python-client-3.3.0-SNAPSHOT.zip

- store_artifacts:
path: mms-ent/repo-amp/target/mms-mathematica-client-3.3.0-SNAPSHOT.zip
destination: tmp/artifacts/mms-mathematica-client-3.3.0-SNAPSHOT.zip

- persist_to_workspace:
root: mms-ent
paths:
- repo-amp/target
- share-amp/target

deploy_snapshot:
<<: *defaults
steps:
- attach_workspace:
at: mms-ent
- run:
name: Get jfrog
command: curl -fL https://getcli.jfrog.io | sh
- run:
name: Set Permissions
command: sudo chmod +x jfrog
- run:
name: Configure jfrog
command: ./jfrog rt config --url $ARTIFACTORY_URL --user $ARTIFACTORY_USER --apikey $ARTIFACTORY_APIKEY --interactive false
- run:
name: Send mms-amp
command: ./jfrog rt u 'mms-ent/repo-amp/target/*.amp' libs-snapshot-local/gov/nasa/jpl/mms/mms-amp/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms-share-amp
command: ./jfrog rt u 'mms-ent/share-amp/target/*.amp' libs-snapshot-local/gov/nasa/jpl/mms/mms-share-amp/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms java client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-java-*.zip' libs-snapshot-local/gov/nasa/jpl/mms/mms-java-client/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms python client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-python-*.zip' libs-snapshot-local/gov/nasa/jpl/mms/mms-python-client/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms mathematica client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-mathematica-*.zip' libs-snapshot-local/gov/nasa/jpl/mms/mms-mathematica-client/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true

deploy_release:
<<: *defaults
steps:
- attach_workspace:
at: mms-ent
- run:
name: Get jfrog
command: curl -fL https://getcli.jfrog.io | sh
- run:
name: Set Permissions
command: sudo chmod +x jfrog
- run:
name: Configure jfrog
command: ./jfrog rt config --url $ARTIFACTORY_URL --user $ARTIFACTORY_USER --apikey $ARTIFACTORY_APIKEY --interactive false
- run:
name: Send mms-amp
command: ./jfrog rt u 'mms-ent/repo-amp/target/*.amp' libs-release-local/gov/nasa/jpl/mms/mms-amp/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms-share-amp
command: ./jfrog rt u 'mms-ent/share-amp/target/*.amp' libs-release-local/gov/nasa/jpl/mms/mms-share-amp/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms java client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-java-*.zip' libs-release-local/gov/nasa/jpl/mms/mms-java-client/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms python client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-python-*.zip' libs-release-local/gov/nasa/jpl/mms/mms-python-client/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true
- run:
name: Send mms mathematica client
command: ./jfrog rt u 'mms-ent/repo-amp/target/mms-mathematica-*.zip' libs-release-local/gov/nasa/jpl/mms/mms-mathematica-client/3.3.0-SNAPSHOT/ --build-name=mms-circleci --build-number=$CIRCLE_BUILD_NUM --flat=true

workflows:
version: 2
build-deploy-snapshot:
jobs:
- build_amps
- deploy_snapshot:
requires:
- build_amps
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
*.idea
*.iml
.directory

5 changes: 2 additions & 3 deletions ...p/web/mms/raml/fonts/LICENSE-OpenSans.txt → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
Expand Down Expand Up @@ -179,15 +178,15 @@
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]
Copyright {yyyy} {name of copyright owner}

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
71 changes: 50 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
# Model Management System
**Alfresco version 5.1.g**

<!--- Comment the download links until we can display them better or something --->
<!--- [ ![Download](https://api.bintray.com/packages/openmbee/maven/mms-amp/images/download.svg) ](https://bintray.com/openmbee/maven/mms-amp/_latestVersion) mms-amp --->

<!--- [ ![Download](https://api.bintray.com/packages/openmbee/maven/mms-share-amp/images/download.svg) ](https://bintray.com/openmbee/maven/mms-share-amp/_latestVersion) mms-share-amp --->

[![CircleCI](https://circleci.com/gh/Open-MBEE/mms.svg?style=svg)](https://circleci.com/gh/Open-MBEE/mms)

**AMP for Alfresco (5.1.g)**

Use this table to check what version of the mms - mdk - ve triple you should be using: https://github.com/Open-MBEE/mdk/blob/support/2.5/manual/MDK%20-%20MMS%20-%20VE%20Compatibility%20Matrix.pdf
## Developer Setup

### Dependencies
* ElasticSearch 5.x
* PostgreSQL 9.x

### Optional Dependencies
* ActiveMQ 5.X

### 1a. Using Intellij
* Open Project with root of 'mms-ent'
* Import Maven Project
Expand Down Expand Up @@ -44,25 +59,25 @@ Use this table to check what version of the mms - mdk - ve triple you should be
* If it's not installed, download and install Java 8. Afterward, return to here and select Java 8.

## Install Dependencies
### 1. Install and Configure Elastic Search
* Download Elasticsearch 5.X
* Install Elasticsearch
* Start Elasticsearch then run `mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/mms-mappings.sh`

### 2. Install and Configure Postgresql
* Download Postgresql 9.x
* If using Postgresql as the database for Alfresco, Postgresl 9.3 is the latest supported version
* Install Postgresql
* Start Postgresql server
* Connect to the Postgresql server and:
### 1. Install and Configure ElasticSearch
* Download ElasticSearch 5.X
* Install ElasticSearch
* Start ElasticSearch then run `mms-ent/repo-amp/src/main/resources/mms-mappings.sh`

### 2. Install and Configure PostgreSQL
* Download PostgreSQL 9.x
* If using PostgreSQL as the database for Alfresco, PostgreSQL 9.4 is the latest supported version
* Install PostgreSQL
* Start PostgreSQL server
* Connect to the PostgreSQL server and:
* Create a `mms` user (referenced by pg.user in your `mms-ent/mms.properties` file)
* Ensure you set a password (referenced by pg.pass)
* Create a `mms` database ( referenced by pg.name)
* Execute `mms-ent/repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/mms.sql`
* Execute `mms-ent/repo-amp/src/main/resources/mms.sql`
* windows CMD e.g.: `psql -h localhost -p 5432 -U mms -d mms -v schema=public < C:\path\to\mms\repo\mms.sql`

### 3. Install and Configure ActiveMQ
* Download ActiveMQ
* Download ActiveMQ 5.X
* Install ActiveMQ
* Start ActiveMQ service

Expand All @@ -83,7 +98,7 @@ Use this table to check what version of the mms - mdk - ve triple you should be
3. Enter **admin** for password

## Design Documentation
### 1. MMS using ElaticSearch and PostgreSQL
### 1. MMS using ElasticSearch and PostgreSQL

-----

Expand Down Expand Up @@ -211,9 +226,9 @@ curl -w "\n%{http_code}\n" -H "Content-Type: application/json" -u admin:admin --
curl -w "\n%{http_code}\n" -H "Content-Type: application/json" -u admin:admin --data '{"projects": [{"id": "123456","name": "vetest","type": "Project"}]}' -X POST "http://localhost:8080/alfresco/service/orgs/vetest/projects"
```

Then you can post some elements. For convenience, there is a json file in repo-amp/test-data/javawebscripts/JsonData. Using the project from above:
Then you can post some elements. For convenience, there is a json file in `runner/src/test/robotframework/JsonData`. Using the project from above:
```
curl -w "\n%{http_code}\n" -H "Content-Type: application/json" -u admin:admin --data @JsonData/elementsNew.json -X POST "http://localhost:8080/alfresco/service/projects/123456/refs/master/elements"
curl -w "\n%{http_code}\n" -H "Content-Type: application/json" -u admin:admin --data @JsonData/PostNewElements.json -X POST "http://localhost:8080/alfresco/service/projects/123456/refs/master/elements"
```

Make sure the elements went in:
Expand All @@ -224,17 +239,19 @@ curl -w "\n%{http_code}\n" -H "Content-Type: application/json" -u admin:admin -X
### Robotframework test suite
Robot tests can be run with the following maven profiles in the mms-ent directory:
```
./mvnw install -Ddependency.surf.version=6.3 -Prun,robot-tests
./mvnw install -Prun,robot-tests
```
Please note that tests should be run on a clean instance, therefore, it may be helpful to run clean.sh before running the tests

The Robotframework tests require the 'requests' python module. Install it as follows:
The Robotframework tests require the 'requests' and 'robotframework-requests' python modules. Install it as follows:
```
pip install --target=runner/src/test/robotframework/libraries requests
pip install --target=runner/src/test/robotframework/libraries robotframework-requests
```
OR:
```
pip install --target=$HOME/.m2/repository/org/robotframework/robotframework/{ROBOTPLUGINVERSION}/Lib requests
pip install --target=$HOME/.m2/repository/org/robotframework/robotframework/{ROBOTPLUGINVERSION}/Lib robotframework-requests
```

### Changing debug levels on the fly
Expand All @@ -257,7 +274,19 @@ It takes as input JSON that specifies the classes and the log levels. For exampl
```

## API Documentation
API Documentation is located at the following endpoint:
API Documentation is located at the following endpoints:

Swagger CodeGen:
```
alfresco/mms
```

Swagger UI:
```
alfresco/mms/swagger-ui
```

Swagger YAML file:
```
alfresco/mms/raml/index.html
alfresco/mms/mms.swagger.yaml
```
2 changes: 2 additions & 0 deletions mms-ent/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ mms.properties
/share/target/*
/share-amp/target/*
/solr-config/target/*
/repo/overlays/*
/share/overlays/*
/runner/src/test/robotframework/libraries/*
*.log
*.log.*
Expand Down
28 changes: 24 additions & 4 deletions mms-ent/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ if [[ "$OSTYPE" == "darwin" ]]; then
dropdb -U $dbuser _PB
dropdb -U $dbuser _PC
dropdb -U $dbuser _PD
dropdb -U $dbuser _MountCommit
dropdb -U $dbuser _CollaboratorProject
dropdb -U $dbuser _CompleteModelGet
dropdb -U $dbuser $usedb
createdb -U $dbuser $usedb
psql -U $dbuser -f ./repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/mms.sql $usedb
psql -U $dbuser -f ./repo-amp/src/main/resources/mms.sql $usedb
else
if [ ! -z $password ];then
EXPECT=$(which expect)
Expand Down Expand Up @@ -104,6 +106,14 @@ EOD

$EXPECT <<EOD
log_user 0
spawn dropdb -U $dbuser _MountCommit
expect "*Password*"
send "$password\r"
expect eof
EOD

$EXPECT <<EOD
log_user 0
spawn dropdb -U $dbuser _CollaboratorProject
expect "*Password*"
send "$password\r"
Expand All @@ -112,6 +122,14 @@ EOD

$EXPECT <<EOD
log_user 0
spawn dropdb -U $dbuser _CompleteModelGet
expect "*Password*"
send "$password\r"
expect eof
EOD

$EXPECT <<EOD
log_user 0
spawn dropdb -U $dbuser $usedb
expect "*Password*"
send "$password\r"
Expand All @@ -128,7 +146,7 @@ EOD

$EXPECT <<EOD
log_user 0
spawn psql -U $dbuser -f ./repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/mms.sql $usedb
spawn psql -U $dbuser -f ./repo-amp/src/main/resources/mms.sql $usedb
expect "*Password*"
send "$password\r"
expect eof
Expand All @@ -139,17 +157,19 @@ EOD
dropdb -U $dbuser _PB
dropdb -U $dbuser _PC
dropdb -U $dbuser _PD
dropdb -U $dbuser _MountCommit
dropdb -U $dbuser _CollaboratorProject
dropdb -U $dbuser _CompleteModelGet
dropdb -U $dbuser $usedb
createdb -U $dbuser $usedb
psql -U $dbuser -f ./repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/mms.sql $usedb
psql -U $dbuser -f ./repo-amp/src/main/resources/mms.sql $usedb

echo "Dropping previous databases"
fi
fi

echo -n "deleting elastic db: "
curl -XDELETE 'http://localhost:9200/_all/'
sh ./repo-amp/src/main/java/gov/nasa/jpl/view_repo/db/mms_mappings.sh
sh ./repo-amp/src/main/resources/mms_mappings.sh
rm -rf ./alf_data_dev
./mvnw clean -Ddependency.surf.version=6.3 -Ppurge
Loading

0 comments on commit fc3d23f

Please sign in to comment.