Skip to content

Commit

Permalink
Release to Sonatype instead (#239)
Browse files Browse the repository at this point in the history
following the method of LiveRamp/daemon_lib#26
  • Loading branch information
joshk0 authored Apr 4, 2019
1 parent e3d0eca commit dee946e
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 319 deletions.
41 changes: 22 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
language:
- ruby

- ruby
rvm:
- 2.3.0

- '2.3'
jdk:
- oraclejdk8

- oraclejdk8
env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true

- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
- secure: aB+J2d/LuddkTmGJ/ygnUFBL7NBJaWXwX5myI7jzJRdiMVvnw6jqpZFqrGJZ3pFp7q5sN+lZCXIG/UGCTHtr/a9I2Yg3wMjSpwp62m+2/1N6vxT+AAz96f76HDTZsIGOkhxOOhLvSg6gOrgLh8wn2xSKbcVRHJjxchD1jTxD6+o=
- secure: mIG7WfaKMeDCnENGCPn6nc3kZta7dKhQcy7mIbmceofifYVa6uXcbpKf7YyXOAlN9nHYUNQsHrThWB94BKh2Ch0/rpZx2E/yKN0ILjSO2xkfWW7LtE9C6LePMDh72VNVKOKJ2mPaLGSHHAYp8prKkGEro5H3WrWb7cPy8Jnln2I=
- secure: ZSBAwRsYDWVLMDuIbwCZhL003XSF1auo9koZ7SFV4adGcZiP+itWkeN7BaFlCLB4SmAHPxFroapyAibVvhEEAYUTeIYwWpb2Wxi0JPdku1nmx4jcRojNTjsmAmicNVykGeZWwJZpCma54OKeRzpdr/6kgIuKC54lwmujIYwhNT4=
- secure: mfJkzhFguMNu2KRSEVgn/1Oi3qJZoc2jbRWwINNuQ0ffk6LhmXh1rdgUWfi86YPoChs+YNEsAt+wgIdsZ4d/N0vthS6wyJge5E+fPHbR2dSqkRSORMLaaoK8ijhoqCQtDFijndGS2IcadoCaYEKk6z0tlVSG4olgy2p11nGHgSA=
notifications:
email: false

services:
- mysql

- mysql
install: true

before_script:
- export RAILS_ENV=development
# This variable needs to be unset because after rvm installs ruby 2.3, BUNDLE_GEMFILE is set to the
# Gemfile under the root path, which fails the dependency installation in the two test projects.
- unset BUNDLE_GEMFILE

- export RAILS_ENV=development
- unset BUNDLE_GEMFILE
script:
- mvn test -B -Pmysql
- bundle exec rspec
- mvn test -B -Pmysql
- bundle exec rspec
before_deploy:
- openssl aes-256-cbc -K $encrypted_498697054cdc_key -iv $encrypted_498697054cdc_iv
-in .travis/gpg.asc.enc -out .travis/gpg.asc -d
deploy:
skip_cleanup: true
on:
branch: master
provider: script
script: rvm use $TRAVIS_RUBY_VERSION do ./deploy
Binary file added .travis/gpg.asc.enc
Binary file not shown.
29 changes: 29 additions & 0 deletions .travis/mvn-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<!-- In order for these credentials to be used for the desired repository/server, the ID
specified here must match the ID of the repositories specified in the distributionManagement
or repositories tags. -->
<id>ossrh</id>
<username>${env.OSSRH_JIRA_USERNAME}</username>
<password>${env.OSSRH_JIRA_PASSWORD}</password>
</server>
</servers>

<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg</gpg.executable>
<gpg.keyname>${env.GPG_KEY_NAME}</gpg.keyname>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
60 changes: 31 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
Project Jack
------------
# Jack

[![Build Status](https://travis-ci.org/LiveRamp/jack.svg?branch=master)](https://travis-ci.org/LiveRamp/jack)
[![Build Status](https://travis-ci.com/LiveRamp/jack.svg?branch=master)](https://travis-ci.com/LiveRamp/jack)

Do you use Ruby/Rails and Java in your company? We do. And we're sick and tired of maintaining two different sets of schemas, models, and whatnot!

Expand All @@ -11,15 +10,14 @@ To that end, we've created Jack (**J**ava **AC**tive record (+**K**)). The proje
- a Ruby parser for schema.rb and ActiveRecord models that generates Java code
- a Java library that provides model-oriented database access and database-wide query on top of standard database connections

Project Organization
====
## Project Organization

A Jack project consists of two things:

1. The **project definition file**
1. One or more Rails project

### Project Definition File ###
### Project Definition File

The project definition file is a YAML file that tells Jack where to find your Rails projects and how to generate code. Here's an annotated example:

Expand Down Expand Up @@ -50,22 +48,20 @@ databases:
models: database_2/app/models
```
### Rails Projects ###
### Rails Projects
Jack supports generating code for an arbitrary number of inter-related Rails 3 projects. If you only have one Rails project, then things are easy - just configure your project.yml appropriately.
If you have more than one project, here's the setup we suggest. (We use this ourselves.)
/all_my_databases
/project.yml
/project.yml
/rails_project_1
/rails_project_2
/ruby_project_that_uses_rails_project_2
/include/rails_project_2 # <= svn external to /all_my_databases/rails_project_2
Running the Generator
====
### Running the Generator
Running the Jack generator is easy. From a fresh clone, do the following:
Expand All @@ -83,16 +79,15 @@ Assuming everything is configured correctly, that's it.

_Note: We know that the path thing stinks. We're going to improve this in a future version._

Layout of the Generated Code
====
### Layout of the Generated Code

The Java code that Jack produces is designed around interfaces so that it is very modular and mockable.

### Models ###
#### Models

The generated models contain getters and setters for all the fields, as well as getters for detected associations. In contrast to ActiveRecord models, there are no CRUD methods on the Java models.

### Model Persistences ###
#### Model Persistences

This is where the CRUD methods live. The generic base class supports:

Expand All @@ -108,38 +103,45 @@ while there is a unique, per-model interface and implementation that additionall

- create

### Databases ###
#### Databases

You get one Database per database entry in your project.yml. Their main purpose is to provide a collection of all the individual model persistences. You can also execute queries across all models within each database.

### All Databases ###
#### All Databases

Finally, there is one overarching Databases class that serves as a collection for all of the databases configured in your project.yml. Generally, this is what you will instantiate, though you can subsequently get the Database or Persistence instance you actually care about and use that.

Download
====
You can either build jack from source or pull the latest jar from the Liveramp Maven repository:
## Download

You can either build jack from source or pull the latest snapshot from
Sonatype:

```xml
<repository>
<id>repository.liveramp.com</id>
<name>liveramp-repositories</name>
<url>http://repository.liveramp.com/artifactory/liveramp-repositories</url>
<id>sonatype-snapshots</id>
<url>http://oss.sonatype.org/content/repositories/snapshots</url>
<layout>default</layout>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</snapshots>
</repository>
```

The 1.0-SNAPSHOT build can be retrieved there:
Depend on the JAR like so:

```xml
<dependency>
<groupId>com.liveramp</groupId>
<artifactId>jack</artifactId>
<version>1.0-SNAPSHOT</version>
<groupId>com.liveramp</groupId>
<artifactId>jack</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
```

License
====
## License

Copyright 2014 LiveRamp

Expand Down
Loading

0 comments on commit dee946e

Please sign in to comment.