Skip to content

Commit 0dd274d

Browse files
Multi company feature (#11)
* 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
1 parent 066d93d commit 0dd274d

File tree

104 files changed

+5566
-2570
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+5566
-2570
lines changed

.dockerignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*
2-
!api/target/*-runner
3-
!api/target/*-runner.jar
4-
!api/target/lib/*
2+
!target/*-runner
3+
!target/*-runner.jar
4+
!target/lib/*
5+
!target/quarkus-app/*

.github/docker-prune.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
# pruning is only run when inside CI to avoid accidentally removing stuff
6+
# GITHUB_ACTIONS is always set to true inside Github Actions
7+
# https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables
8+
if [ "${GITHUB_ACTIONS}" == true ] ; then
9+
docker container prune -f
10+
docker image prune -f
11+
docker network prune -f
12+
docker volume prune -f
13+
fi

.github/workflows/ci-actions.yml

Lines changed: 23 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -5,187 +5,60 @@ on:
55
paths-ignore:
66
- 'README.md'
77
pull_request:
8-
types: [assigned, opened, synchronize, reopened, ready_for_review, edited]
98
paths-ignore:
109
- 'README.md'
1110
schedule:
1211
- cron: '0 0 * * *'
1312

14-
env:
15-
JVM_TEST_MAVEN_OPTS: "-e -B"
16-
1713
jobs:
18-
build-jdk11:
19-
name: "JDK 11 Build"
20-
runs-on: ubuntu-latest
21-
# Skip draft PRs and those with WIP in the subject, rerun as soon as its removed
22-
if: "github.event_name != 'pull_request' || ( \
23-
github.event.pull_request.draft == false && \
24-
github.event.pull_request.state != 'closed' && \
25-
contains(github.event.pull_request.title, 'wip ') == false && \
26-
contains(github.event.pull_request.title, '[wip]') == false && \
27-
(
28-
github.event.action != 'edited' || \
29-
contains(github.event.changes.title.from, 'wip ') || \
30-
contains(github.event.changes.title.from, '[wip]') \
31-
) \
32-
)"
33-
steps:
34-
- uses: actions/checkout@v2
35-
- uses: n1hility/cancel-previous-runs@v2
36-
if: github.event_name == 'pull_request'
37-
with:
38-
token: ${{ secrets.GITHUB_TOKEN }}
39-
- name: Set up JDK 11
40-
# Uses sha for added security since tags can be updated
41-
uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d
42-
with:
43-
java-version: 11
44-
- name: Compute cache restore key
45-
# Always recompute on a push so that the maven repo doesnt grow indefinitely with old versions
46-
run: |
47-
if ${{ github.event_name == 'pull_request' }}; then echo "::set-env name=COMPUTED_RESTORE_KEY::q2maven-"; fi
48-
- name: Cache Maven Repository
49-
id: cache-maven
50-
uses: n1hility/cache@v2
51-
with:
52-
path: ~/.m2/repository
53-
# Improves the reusability of the cache to limit key changes
54-
key: q2maven-${{ hashFiles('pom.xml') }}
55-
restore-keys: ${{ env.COMPUTED_RESTORE_KEY }}
56-
restore-only: ${{ github.event_name == 'pull_request' }}
57-
- name: Build
58-
run: |
59-
mvn -e -B -DskipTests=true -DskipDocs clean install
60-
- name: Tar Maven Repo
61-
shell: bash
62-
run: tar -czvf maven-repo.tgz -C ~ .m2/repository
63-
- name: Persist Maven Repo
64-
uses: actions/upload-artifact@v1
65-
with:
66-
name: maven-repo
67-
path: maven-repo.tgz
68-
6914
linux-jvm-tests:
70-
name: JDK 11 JVM Tests
71-
timeout-minutes: 120
72-
needs: build-jdk11
73-
runs-on: ubuntu-latest
74-
steps:
75-
- uses: actions/checkout@v2
76-
- name: Set up JDK ${{ matrix.java-version }}
77-
# Uses sha for added security since tags can be updated
78-
uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d
79-
with:
80-
java-version: 11
81-
- name: Download Maven Repo
82-
uses: actions/download-artifact@v1
83-
with:
84-
name: maven-repo
85-
path: .
86-
- name: Extract Maven Repo
87-
shell: bash
88-
run: tar -xzvf maven-repo.tgz -C ~
89-
- name: Build with Maven
90-
run: mvn test -P '!services'
91-
- name: Prepare failure archive (if maven failed)
92-
if: failure()
93-
shell: bash
94-
run: find . -name '*-reports' -type d | tar -czvf test-reports.tgz -T -
95-
- name: Upload failure Archive (if maven failed)
96-
uses: actions/upload-artifact@v1
97-
if: failure()
98-
with:
99-
name: test-reports-linux-jvm11
100-
path: 'test-reports.tgz'
101-
102-
linux-jvm-tests-ee:
103-
name: JDK 11 JVM Tests EE
104-
timeout-minutes: 120
105-
needs: build-jdk11
15+
name: Tests
10616
runs-on: ubuntu-latest
10717
steps:
10818
- uses: actions/checkout@v2
109-
- name: Set up JDK ${{ matrix.java-version }}
110-
# Uses sha for added security since tags can be updated
111-
uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d
19+
- uses: actions/setup-java@v1
11220
with:
11321
java-version: 11
114-
- name: Download Maven Repo
115-
uses: actions/download-artifact@v1
116-
with:
117-
name: maven-repo
118-
path: .
119-
- name: Extract Maven Repo
120-
shell: bash
121-
run: tar -xzvf maven-repo.tgz -C ~
122-
- name: Build with Maven
123-
run: mvn test -P services -Dopenubl.storage.type=s3 -Dopenubl.event-manager=jms
22+
- name: Maven
23+
run: mvn verify
12424
- name: Prepare failure archive (if maven failed)
12525
if: failure()
12626
shell: bash
12727
run: find . -name '*-reports' -type d | tar -czvf test-reports.tgz -T -
128-
- name: Upload failure Archive (if maven failed)
28+
- name: Upload failure archive (if maven failed)
12929
uses: actions/upload-artifact@v1
13030
if: failure()
13131
with:
132-
name: test-reports-linux-jvm11
32+
name: test-reports
13333
path: 'test-reports.tgz'
13434

135-
java-artifacts:
136-
name: Java Artifacts
137-
needs: build-jdk11
138-
runs-on: ubuntu-latest
139-
steps:
140-
- uses: actions/checkout@v2
141-
- name: Set up JDK 11
142-
# Uses sha for added security since tags can be updated
143-
uses: joschi/setup-jdk@b9cc6eabf7e7e3889766b5cee486f874c9e1bd2d
144-
with:
145-
java-version: 11
146-
- name: Download Maven Repo
147-
uses: actions/download-artifact@v1
148-
with:
149-
name: maven-repo
150-
path: .
151-
- name: Extract Maven Repo
152-
shell: bash
153-
run: tar -xzvf maven-repo.tgz -C ~
154-
- name: Build with Maven
155-
run: |
156-
mvn -DskipTests package
157-
- name: Prepare XML Sender archive
158-
shell: bash
159-
run: |
160-
find api/target -name 'lib' -o -name 'xsender-server-api-*-runner.jar' | tar -czvf xsender-server-java-artifacts.tgz -T -
161-
- name: Upload Archive XML Sender
162-
uses: actions/upload-artifact@v1
163-
with:
164-
name: xsender-server-java-artifacts
165-
path: 'xsender-server-java-artifacts.tgz'
166-
16735
container-images:
16836
name: Container Images
169-
needs: java-artifacts
17037
if: github.event_name != 'pull_request'
17138
runs-on: ubuntu-latest
17239
steps:
17340
- uses: actions/checkout@v2
174-
- name: Download Java XML Sender Artifacts
175-
uses: actions/download-artifact@v1
41+
- uses: actions/setup-java@v1
17642
with:
177-
name: xsender-server-java-artifacts
178-
path: .
179-
- name: Extract Java Artifacs
180-
shell: bash
181-
run: tar -xzvf xsender-server-java-artifacts.tgz
182-
- name: Publish to Registry XML Builder
183-
# Uses sha for added security since tags can be updated
184-
uses: elgohr/Publish-Docker-Github-Action@b2f63259b466ca5a4be395c392546de447450334
43+
java-version: 11
44+
- name: Build with Maven
45+
run: mvn package -DskipTests -Dquarkus.package.type=fast-jar
46+
- name: Push to GitHub Packages
47+
uses: elgohr/Publish-Docker-Github-Action@master
48+
with:
49+
registry: docker.pkg.github.com
50+
name: project-openubl/xsender-server/xsender-server
51+
username: ${{ github.actor }}
52+
password: ${{ secrets.GITHUB_TOKEN }}
53+
dockerfile: src/main/docker/Dockerfile.fast-jar
54+
snapshot: false
55+
tags: "master"
56+
- name: Push to Docker Hub
57+
uses: elgohr/Publish-Docker-Github-Action@master
18558
with:
18659
name: projectopenubl/xsender-server
187-
dockerfile: api/src/main/docker/Dockerfile.jvm
18860
username: ${{ secrets.DOCKER_USERNAME }}
18961
password: ${{ secrets.DOCKER_PASSWORD }}
62+
dockerfile: src/main/docker/Dockerfile.fast-jar
19063
snapshot: false
19164
tags: "master"

.mvn/wrapper/MavenWrapperDownloader.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
/**
2-
* Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3-
* and other contributors as indicated by the @author tags.
1+
/*
2+
* Copyright 2007-present the original author or authors.
43
*
5-
* Licensed under the Eclipse Public License - v 2.0 (the "License");
4+
* Licensed under the Apache License, Version 2.0 (the "License");
65
* you may not use this file except in compliance with the License.
76
* You may obtain a copy of the License at
87
*
9-
* https://www.eclipse.org/legal/epl-2.0/
8+
* http://www.apache.org/licenses/LICENSE-2.0
109
*
1110
* Unless required by applicable law or agreed to in writing, software
1211
* distributed under the License is distributed on an "AS IS" BASIS,
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,2 @@
1-
#
2-
# Copyright 2019 Project OpenUBL, Inc. and/or its affiliates
3-
# and other contributors as indicated by the @author tags.
4-
#
5-
# Licensed under the Eclipse Public License - v 2.0 (the "License");
6-
# you may not use this file except in compliance with the License.
7-
# You may obtain a copy of the License at
8-
#
9-
# https://www.eclipse.org/legal/epl-2.0/
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
#
17-
181
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
192
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

0 commit comments

Comments
 (0)