Skip to content

Commit

Permalink
Multi company feature (#11)
Browse files Browse the repository at this point in the history
* add keycloak to process

* add keycloak to process

* trying to use uma

* change names

* multi company

* multi company

* a

* fix maven configuration

* fix maven configuration

* first template

* first template

* create docker image

* create docker image

* enable test

* fix CI actions

* fix CI actions
  • Loading branch information
carlosthe19916 committed Nov 15, 2020
1 parent 066d93d commit 0dd274d
Show file tree
Hide file tree
Showing 104 changed files with 5,566 additions and 2,570 deletions.
7 changes: 4 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*
!api/target/*-runner
!api/target/*-runner.jar
!api/target/lib/*
!target/*-runner
!target/*-runner.jar
!target/lib/*
!target/quarkus-app/*
13 changes: 13 additions & 0 deletions .github/docker-prune.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

set -e

# pruning is only run when inside CI to avoid accidentally removing stuff
# GITHUB_ACTIONS is always set to true inside Github Actions
# https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
if [ "${GITHUB_ACTIONS}" == true ] ; then
docker container prune -f
docker image prune -f
docker network prune -f
docker volume prune -f
fi
173 changes: 23 additions & 150 deletions .github/workflows/ci-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,187 +5,60 @@ on:
paths-ignore:
- 'README.md'
pull_request:
types: [assigned, opened, synchronize, reopened, ready_for_review, edited]
paths-ignore:
- 'README.md'
schedule:
- cron: '0 0 * * *'

env:
JVM_TEST_MAVEN_OPTS: "-e -B"

jobs:
build-jdk11:
name: "JDK 11 Build"
runs-on: ubuntu-latest
# Skip draft PRs and those with WIP in the subject, rerun as soon as its removed
if: "github.event_name != 'pull_request' || ( \
github.event.pull_request.draft == false && \
github.event.pull_request.state != 'closed' && \
contains(github.event.pull_request.title, 'wip ') == false && \
contains(github.event.pull_request.title, '[wip]') == false && \
(
github.event.action != 'edited' || \
contains(github.event.changes.title.from, 'wip ') || \
contains(github.event.changes.title.from, '[wip]') \
) \
)"
steps:
- uses: actions/checkout@v2
- uses: n1hility/cancel-previous-runs@v2
if: github.event_name == 'pull_request'
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up JDK 11
# Uses sha for added security since tags can be updated
uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d
with:
java-version: 11
- name: Compute cache restore key
# Always recompute on a push so that the maven repo doesnt grow indefinitely with old versions
run: |
if ${{ github.event_name == 'pull_request' }}; then echo "::set-env name=COMPUTED_RESTORE_KEY::q2maven-"; fi
- name: Cache Maven Repository
id: cache-maven
uses: n1hility/cache@v2
with:
path: ~/.m2/repository
# Improves the reusability of the cache to limit key changes
key: q2maven-${{ hashFiles('pom.xml') }}
restore-keys: ${{ env.COMPUTED_RESTORE_KEY }}
restore-only: ${{ github.event_name == 'pull_request' }}
- name: Build
run: |
mvn -e -B -DskipTests=true -DskipDocs clean install
- name: Tar Maven Repo
shell: bash
run: tar -czvf maven-repo.tgz -C ~ .m2/repository
- name: Persist Maven Repo
uses: actions/upload-artifact@v1
with:
name: maven-repo
path: maven-repo.tgz

linux-jvm-tests:
name: JDK 11 JVM Tests
timeout-minutes: 120
needs: build-jdk11
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
# Uses sha for added security since tags can be updated
uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d
with:
java-version: 11
- name: Download Maven Repo
uses: actions/download-artifact@v1
with:
name: maven-repo
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzvf maven-repo.tgz -C ~
- name: Build with Maven
run: mvn test -P '!services'
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -name '*-reports' -type d | tar -czvf test-reports.tgz -T -
- name: Upload failure Archive (if maven failed)
uses: actions/upload-artifact@v1
if: failure()
with:
name: test-reports-linux-jvm11
path: 'test-reports.tgz'

linux-jvm-tests-ee:
name: JDK 11 JVM Tests EE
timeout-minutes: 120
needs: build-jdk11
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK ${{ matrix.java-version }}
# Uses sha for added security since tags can be updated
uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Download Maven Repo
uses: actions/download-artifact@v1
with:
name: maven-repo
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzvf maven-repo.tgz -C ~
- name: Build with Maven
run: mvn test -P services -Dopenubl.storage.type=s3 -Dopenubl.event-manager=jms
- name: Maven
run: mvn verify
- name: Prepare failure archive (if maven failed)
if: failure()
shell: bash
run: find . -name '*-reports' -type d | tar -czvf test-reports.tgz -T -
- name: Upload failure Archive (if maven failed)
- name: Upload failure archive (if maven failed)
uses: actions/upload-artifact@v1
if: failure()
with:
name: test-reports-linux-jvm11
name: test-reports
path: 'test-reports.tgz'

java-artifacts:
name: Java Artifacts
needs: build-jdk11
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
# Uses sha for added security since tags can be updated
uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d
with:
java-version: 11
- name: Download Maven Repo
uses: actions/download-artifact@v1
with:
name: maven-repo
path: .
- name: Extract Maven Repo
shell: bash
run: tar -xzvf maven-repo.tgz -C ~
- name: Build with Maven
run: |
mvn -DskipTests package
- name: Prepare XML Sender archive
shell: bash
run: |
find api/target -name 'lib' -o -name 'xsender-server-api-*-runner.jar' | tar -czvf xsender-server-java-artifacts.tgz -T -
- name: Upload Archive XML Sender
uses: actions/upload-artifact@v1
with:
name: xsender-server-java-artifacts
path: 'xsender-server-java-artifacts.tgz'

container-images:
name: Container Images
needs: java-artifacts
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download Java XML Sender Artifacts
uses: actions/download-artifact@v1
- uses: actions/setup-java@v1
with:
name: xsender-server-java-artifacts
path: .
- name: Extract Java Artifacs
shell: bash
run: tar -xzvf xsender-server-java-artifacts.tgz
- name: Publish to Registry XML Builder
# Uses sha for added security since tags can be updated
uses: elgohr/Publish-Docker-Github-Action@b2f63259b466ca5a4be395c392546de447450334
java-version: 11
- name: Build with Maven
run: mvn package -DskipTests -Dquarkus.package.type=fast-jar
- name: Push to GitHub Packages
uses: elgohr/Publish-Docker-Github-Action@master
with:
registry: docker.pkg.github.com
name: project-openubl/xsender-server/xsender-server
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
dockerfile: src/main/docker/Dockerfile.fast-jar
snapshot: false
tags: "master"
- name: Push to Docker Hub
uses: elgohr/Publish-Docker-Github-Action@master
with:
name: projectopenubl/xsender-server
dockerfile: api/src/main/docker/Dockerfile.jvm
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
dockerfile: src/main/docker/Dockerfile.fast-jar
snapshot: false
tags: "master"
9 changes: 4 additions & 5 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/**
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
* and other contributors as indicated by the @author tags.
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Eclipse Public License - v 2.0 (the "License");
* 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
*
* https://www.eclipse.org/legal/epl-2.0/
* 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,
Expand Down
17 changes: 0 additions & 17 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
#
# Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
# and other contributors as indicated by the @author tags.
#
# Licensed under the Eclipse Public License - v 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
#
# https://www.eclipse.org/legal/epl-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.
#

distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
Loading

0 comments on commit 0dd274d

Please sign in to comment.