Skip to content

Commit

Permalink
Enabling artifact deploys for master and tags
Browse files Browse the repository at this point in the history
  • Loading branch information
shantstepanian committed Dec 6, 2018
1 parent 60d7d6e commit 98c2692
Show file tree
Hide file tree
Showing 21 changed files with 162 additions and 71 deletions.
18 changes: 13 additions & 5 deletions .travis-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,19 @@
# specific language governing permissions and limitations
# under the License.
#
VERSION=$1
set -e
echo "Deploying to Maven Central Repo"
openssl aes-256-cbc -K $encrypted_a2f0f379c735_key -iv $encrypted_a2f0f379c735_iv -in codesigning.asc.enc -out codesigning.asc -d
gpg --fast-import codesigning.asc
cp .travis.maven.settings.xml $HOME/.m2/settings.xml && mvn -Drevision=7.0.2-SNAPSHOT -DskipTests -P release deploy
cp .travis.maven.settings.xml $HOME/.m2/settings.xml && mvn -DskipTests -P release deploy


echo "Deploying to Docker Hub"
echo "$SONATYPE_PASSWORD" | docker login -u "$SONATYPE_USERNAME" --password-stdin
#docker push shantstepanian/obevo:$VERSION
#docker tag shantstepanian/obevo:$VERSION shantstepanian/obevo:latest
#docker push shantstepanian/obevo:latest

if [[ "$VERSION" != "*-SNAPSHOT" ]];
then
echo "Applying latest tag to fixed release version $VERSION"
docker tag shantstepanian/obevo:$VERSION shantstepanian/obevo:latest
fi
docker push shantstepanian/obevo
47 changes: 26 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,48 @@ services:

env:
global:
- DEPLOY_ENABLED=`if [[ (! -z "$TRAVIS_TAG") || ("$TRAVIS_BRANCH" == "master") ]]; then echo true; else echo false; fi`
- VERSION=`if [[ -z "$TRAVIS_TAG" ]]; then echo $TRAVIS_BRANCH-SNAPSHOT; else echo $TRAVIS_TAG; fi`
- JAVA7_HOME=/usr/lib/jvm/java-7-openjdk-amd64
- MAVEN_OPTS="-DskipTests -Dmaven.repo.local=$HOME/.m2/repository -Xmx2g -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
# sonatype user
- MAVEN_OPTS="-Drevision=$VERSION -Dmaven.repo.local=$HOME/.m2/repository -Xmx2g -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
# SONATYPE_USERNAME
- secure: "Rp3iGAP4E9jzUKJnIswrRvMJnx/69W7LMqidDsUA12+aQQwMl9Ukm9SPKW6l67Z2Yt9bsDltnkISqJ4Zgxp2DLH+g8Oqq0vz7E5vs9JEXJUGEzyVp2jsDskrAjT2V7HVpnxB6iDG6NNxDGV12UkmV2aCbBLWNiLNZDd1W/wS84G/I9Qx8FVoYl4glFCHbfw4JBcUtSb66tdZ2UjqSzyAIPJYZHO8FJyiygj+/rY1fvqH1Pbw8tY0g5gshmGNdrXqETukpx+fxpL8KCEpUy7XWKS6h1b/AH8AEepmG3WYY0O5mqPV/y/OKrtnJSoWOW6sp+o9eiCx/Kmt04Qvv4Uc4b/3YMQs9oaPyhNnu2g1IgJXhYbYZMzZbhEfXsMGoBKV139n+mT70scXVkmvQy/5nqD2RtNTSV9Y0NWy0am11vFWbGMnlvmsrtgt/6VBQ4xMEr+NiSo1IiqiEpT1regFKuI9wUbMDbmJD6oO8rvhwBKUKjPZ46OO5skdpBNlgWoJYUgs0BvwqRjTXS6m9y4pxrLgcLxmnJ5Vu184zLroO6fjN1NB3BttfN42VHXPv8aKN3R6wXArnm520ZLfX7BfzolJzmYW+tFD7XirGSYu7lFwV2HOptceTmnicVSwHZrmV5/cpxadakSuhxCeys12IwYXhHjInhy2D+LrMEKvTXA="
# sonatype password
# SONATYPE_PASSWORD
- secure: "XPgn7whcluc0CORzkyxsjLwRsOyMGJbJ9FakpB+E6zzvc1mXc0HyAl7ZXrLJwL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Va3DIO/3Zc6PyWs9IjS/JBOlDXePWFKs89veBrGZfmUSeKHgi9dUK27rZoSQB7zJ2z6ilva1QQWPsKXKn0X1wTUNmwi5f1xQuS7EK9ZsloA8BSdwko8kAdnIdOFLevQAqNlQBOJPQTlUUMIsAFnPiJU5U5XlCvc+ee6pYkMB3fK7mNrMsvQM71p/pTnMmN9sCdw2Um2DdtjJU5O0domvphAzv2WUbsLyZHGLJjY3kQavE3hxHAcqJsRunw8z6YxE/c0="
# sonatype gpg passphrase
# SONATYPE_GPG_PASSPHRASE
- secure: "DQv13K0u47VszRGvxlyRea2UE9aacNWvPuft55eXYMOdQh00kb6MW74WqU+UQBJpmDJ4gmZVwrXqzbPit/s/yFqagxLf4fuF3geYqApST/FRRgLLnQhQ/kFYtRfDKM6gsKAV4nsLxGDJkvHNRb1vZdAvsI8GMxLw6MSVnKclOMTmiJcqOwwFKXU7dqbXnPay3D+YqA3PoN2xQn+278+fZiK0PeMTuvFNEVesITXInS2mnQ9JgLzKfO4Bmx5sjo5o+ZpTHlcQDpDJkObLiynlTkjo1OUB4Kh6yRTeSc83CgURWLo8ZPodJncAERjSJOn3TKCDqcrw6Ij3IwZAsQiAMk/Wemfcdw44lgjAKbzkOGmKj26r+ZcRAFtzHlGYN6qjnH1PvwQup5JyTYARFjk0BiA3lWlr7w5kd1x2AR05w/2aIGZxOkhnIMxrFXzr1NmSujQgFEtejSipZYB+mazEWTKR/MiwNtff3507rFY9Yjp118IhzsIFu4x7i/GpeRP/yJhYMAps9w1ILkVAK/IorypGZqgfZCGHtENUHOQnd+owaS0eV2FRDCoUOdOZ62cEcez3CAP7X5J2VlBq1sADSb5tki6ZzOBUyYP0bpG3Gr4ayTg5YFrbQ+bYsgR8bXZuDj4sBDfVSho0l1vKAdMrGaeKDvbJOBGRV6keSybKHPo="


script:
# We need to run this first to install the maven jars (otherwise, the regular build won't work that references those jars)
# - mvn -f obevo-db-impls/obevo-db-db2 -Pinstall-jars-db2 antrun:run@install-jars-db2
# Travis already runs maven test as part of its run script. We add the verify step to get integration tests: https://docs.travis-ci.com/user/languages/java/
# - mvn -Dtest=noUnitTestsInThisPhase -DfailIfNoTests=false -Ddocker.build.enabled=true verify
# - ./.travis-deploy.sh 7.0.2-SNAPSHOT
- mvn -B -f obevo-db-impls/obevo-db-db2 -Pinstall-jars-db2 antrun:run@install-jars-db2
# Then we run the full build (unit tests + integration tests)
- mvn -B -Ddocker.build.enabled=true verify

# see this - https://docs.travis-ci.com/user/deployment/
# possibly an open issue around master + tags
deploy:
- provider: script
script: ./.travis-deploy.sh $TRAVIS_TAG
script: ./.travis-deploy.sh
skip_cleanup: true
on:
tags: true
- provider: script
script: ./.travis-deploy.sh master-SNAPSHOT
all_branches: true
condition: $DEPLOY_ENABLED == true
- provider: pages
skip_cleanup: true
github-token: $GH_TOKEN
local-dir: obevo-site/target/site
on:
branch: master
- provider: script
script: ./.travis-deploy.sh 7.0.2-SNAPSHOT
all_branches: true
condition: $DEPLOY_ENABLED == true
- provider: releases
skip_cleanup: true
api_key: $GH_TOKEN
draft: true
file_glob: true
file: obevo-dists/obevo-cli/target/obevo-cli-*-dist.zip
on:
branch: dockerAndSdlcRelease

#before_install:
#- openssl aes-256-cbc -K $encrypted_7343a0e3b48e_key -iv $encrypted_7343a0e3b48e_iv
# -in signingkey.asc.enc -out signingkey.asc -d
all_branches: true
condition: $DEPLOY_ENABLED == true
55 changes: 29 additions & 26 deletions SDLC_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
# Releasing Obevo
Note: this page is for Obevo-project developers, not users.

## Release Steps
# Releasing Obevo

Run the maven release plugin to prepare the build. This will invoke the tests.
Simply create a tag in Github named with a semantic version number (e.g. X.Y.Z).

```mvn release:clean release:prepare```
The build script takes care of the rest (see .travis.yml):
* Builds and tests
* Deploys to Maven Central, Docker Hub, Github Releases page, and the site docs

Once succeeded, perform the release to upload the artifacts to maven central. Watch out for the GPG keychain password prompt.

```mvn release:perform```
# Implementation Details on Release

## Maven Build

## Implementation Details
We have moved to [Maven CI-Friendly Builds](https://maven.apache.org/maven-ci-friendly.html) and away from the Maven versions/release plugin.

(We document this here only for knowledge purposes)
Hence, we require Maven >= 3.5.0 to build

Follow the instructions on the [Sonatype OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html).
## Maven Central Upload

Include the drilldown page that [deploys via Apache Maven](http://central.sonatype.org/pages/apache-maven.html).
Maven Central upload instructions: see [Sonatype OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) and [deploys via Apache Maven](http://central.sonatype.org/pages/apache-maven.html).
* We do not follow the steps on "Nexus Staging Maven Plugin for Deployment and Release"
* Instead, we use the maven-release-plugin: see the "Performing a Release Deployment with the Maven Release Plugin" section

Note the "maven-release-plugin" declaration in the parent pom here; see the references to the _release_ profile and the
release profile definition itself.
We integrate that into travis.ci using the example here: https://jakob.soy/blog/2016/maven-central-and-travis/

This requires GPG keys to be created and published to the Travis servers. See here for steps (will add more docs on this soon)
```
gpg --export --armor youremail@yourdomain.com > codesigning.asc
gpg --export-secret-keys --armor youremail@yourdomain.com >> codesigning.asc
travis encrypt-file codesigning.asc
```


## Docker Hub Upload
For Docker deploy instructions from Travis, see [here](https://docs.travis-ci.com/user/docker/)

* Note - we chose not to go with the Docker-Github integration as we prefer not to have the Docker build re-execute our
Maven build when the Travis build already does that.


# Dealing with branches in Github

# Dealing with forks in Github

## When committing

Expand All @@ -39,7 +54,7 @@ git rebase -i HEAD~3
git push -f
```

Finally, do a pull reqeust in Github.
Finally, do a pull request in Github.


## When pulling changes from upstream
Expand All @@ -48,15 +63,3 @@ Finally, do a pull reqeust in Github.
git pull --rebase upstream master
git push -f
```


# Deploying to remote repos:

To Sonatype via Github - used code here: https://jakob.soy/blog/2016/maven-central-and-travis/
For Docker - https://docs.travis-ci.com/user/docker/

# GPG setup

Shants-MacBook-Pro:obevo shantstepanian$ gpg --export --armor shant.p.stepanian@gmail.com > codesigning.asc
Shants-MacBook-Pro:obevo shantstepanian$ gpg --export-secret-keys --armor shant.p.stepanian@gmail.com >> codesigning.asc
Shants-MacBook-Pro:obevo shantstepanian$ travis encrypt-file codesigning.asc
4 changes: 4 additions & 0 deletions obevo-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
</parent>
<artifactId>obevo-core</artifactId>

<properties>
<jacoco.minCoverage>0.40</jacoco.minCoverage>
</properties>

<build>
<resources>
<resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ environments:
schemas:
schema:
- name: DEPLOY_TRACKER
- name: SCHEMA_ONLY_FOR_SETUP
schemaOverrides:
schemaOverride:
- schema: DEPLOY_TRACKER
overrideValue: DBDEPLOY01
- schema: SCHEMA_ONLY_FOR_SETUP # setting this up so that we can have the metaschema setup as well. ParamReader class needs improvement to avoid this hack
overrideValue: DBDEPLOY03
driverClass: com.ibm.db2.jcc.DB2Driver
cleanBuildAllowed: true
# Add progressiveStreaming variable to avoid issues against LOB data types. Doesn't happen against all environments: https://pdn.pega.com/support-articles/pega-718-installation-db2-fails-lob-closed-error
Expand Down
4 changes: 4 additions & 0 deletions obevo-db-impls/obevo-db-h2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

<artifactId>obevo-db-h2</artifactId>

<properties>
<jacoco.minCoverage>0.75</jacoco.minCoverage>
</properties>

<dependencies>
<dependency>
<groupId>com.goldmansachs.obevo</groupId>
Expand Down
4 changes: 4 additions & 0 deletions obevo-db-impls/obevo-db-hsql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

<artifactId>obevo-db-hsql</artifactId>

<properties>
<jacoco.minCoverage>0.85</jacoco.minCoverage>
</properties>

<dependencies>
<dependency>
<groupId>com.goldmansachs.obevo</groupId>
Expand Down
4 changes: 4 additions & 0 deletions obevo-db-impls/obevo-db-mssql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

<artifactId>obevo-db-mssql</artifactId>

<properties>
<jacoco.minCoverage>0.15</jacoco.minCoverage>
</properties>

<dependencies>
<dependency>
<groupId>com.goldmansachs.obevo</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@ environments:
schemas:
schema:
- name: oats
- name: schemaOnlyForSetup
schemaOverrides:
schemaOverride:
- schema: oats
overrideValue: dbdeploy01
- schema: schemaOnlyForSetup # setting this up so that we can have the metaschema setup as well. ParamReader class needs improvement to avoid this hack
overrideValue: dbdeploy03
driverClass: com.microsoft.sqlserver.jdbc.SQLServerDriver
cleanBuildAllowed: true
forceEnvInfraSetup: true
Expand Down
4 changes: 4 additions & 0 deletions obevo-db-impls/obevo-db-oracle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@

<artifactId>obevo-db-oracle</artifactId>

<properties>
<jacoco.minCoverage>0.50</jacoco.minCoverage>
</properties>

<dependencies>
<dependency>
<groupId>com.goldmansachs.obevo</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ environments:
schema:
- name: schema1
- name: schema2
- name: schema3
schemaOverrides:
schemaOverride:
- schema: schema1
overrideValue: DBDEPLOY01
- schema: schema2
overrideValue: DBDEPLOY02
- schema: schema3
overrideValue: DBDEPLOY03
driverClass: oracle.jdbc.OracleDriver
cleanBuildAllowed: true
jdbcUrl: jdbc:oracle:thin:@dbdeploy-oracle-12-1.cck7fvo3o8pf.us-east-1.rds.amazonaws.com:1521:DBDEPLOY
Expand Down
4 changes: 4 additions & 0 deletions obevo-db-impls/obevo-db-postgresql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

<artifactId>obevo-db-postgresql</artifactId>

<properties>
<jacoco.minCoverage>0.75</jacoco.minCoverage>
</properties>

<dependencies>
<dependency>
<groupId>com.goldmansachs.obevo</groupId>
Expand Down
4 changes: 4 additions & 0 deletions obevo-db-impls/obevo-db-sybase-iq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

<artifactId>obevo-db-sybase-iq</artifactId>

<properties>
<jacoco.minCoverage>0.01</jacoco.minCoverage>
</properties>

<dependencies>
<dependency>
<groupId>com.goldmansachs.obevo</groupId>
Expand Down
4 changes: 4 additions & 0 deletions obevo-dbmetadata-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

<artifactId>obevo-dbmetadata-impl</artifactId>

<properties>
<jacoco.minCoverage>0.15</jacoco.minCoverage>
</properties>

<build>
<plugins>
<plugin>
Expand Down
11 changes: 4 additions & 7 deletions obevo-dists/obevo-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,11 @@
</execution>
</executions>
<configuration>
<!--
<from>
<image>openjdk:7-jre</image>
</from>
-->
<to>
<!--<image>shantstepanian/obevo</image>-->
<image>shantstepanian/obevo:${project.version}</image>
<image>shantstepanian/obevo</image>
<tags>
<tag>${project.version}</tag>
</tags>
</to>
<container>
<mainClass>com.gs.obevo.dist.Main</mainClass>
Expand Down
17 changes: 17 additions & 0 deletions obevo-dists/obevo-db-client-alldbs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,21 @@
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>report-aggregate</id>
<phase>verify</phase>
<goals>
<goal>report-aggregate</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 2 additions & 0 deletions obevo-internal-comparer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

<properties>
<net.sourceforge.collections.collections-generic.version>4.01</net.sourceforge.collections.collections-generic.version>

<jacoco.minCoverage>0.75</jacoco.minCoverage>
</properties>

<build>
Expand Down
4 changes: 4 additions & 0 deletions obevo-mongodb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

<artifactId>obevo-mongodb</artifactId>

<properties>
<jacoco.minCoverage>0.01</jacoco.minCoverage>
</properties>

<dependencies>
<dependency>
<groupId>com.goldmansachs.obevo</groupId>
Expand Down
4 changes: 4 additions & 0 deletions obevo-utils/obevo-db-unittest-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
<version>${revision}</version>
</parent>

<properties>
<jacoco.minCoverage>0.00</jacoco.minCoverage>
</properties>

<dependencies>
<dependency>
<groupId>com.goldmansachs.obevo</groupId>
Expand Down
4 changes: 4 additions & 0 deletions obevo-utils/obevo-reladomo-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

<artifactId>obevo-reladomo-util</artifactId>

<properties>
<jacoco.minCoverage>0.70</jacoco.minCoverage>
</properties>

<dependencies>
<dependency>
<!-- This is only needed to get the reverse engineering classes out -->
Expand Down
Loading

0 comments on commit 98c2692

Please sign in to comment.