Skip to content

Commit 6da72d1

Browse files
authored
Merge pull request #89 from RADAR-base/release-1.2.0
Release 1.2.0
2 parents 6fc8631 + 54137a4 commit 6da72d1

21 files changed

+1109
-485
lines changed

.github/workflows/main.yml

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Continuous integration, including test and integration test
2+
name: CI
3+
4+
# Run in master and dev branches and in all pull requests to those branches
5+
on:
6+
push:
7+
branches: [ master, dev ]
8+
pull_request:
9+
branches: [ master, dev ]
10+
11+
env:
12+
DOCKER_IMAGE: radarbase/radar-output-restructure
13+
14+
jobs:
15+
# Build and test the code
16+
build:
17+
# The type of runner that the job will run on
18+
runs-on: ubuntu-latest
19+
20+
# Steps represent a sequence of tasks that will be executed as part of the job
21+
steps:
22+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23+
- uses: actions/checkout@v2
24+
25+
- uses: actions/setup-java@v1
26+
with:
27+
java-version: 11
28+
29+
- name: Gradle cache
30+
uses: actions/cache@v2
31+
with:
32+
# Cache gradle directories
33+
path: |
34+
~/.gradle/caches
35+
~/.gradle/wrapper
36+
# An explicit key for restoring and saving the cache
37+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts', 'gradle.properties') }}
38+
restore-keys: |
39+
${{ runner.os }}-gradle-
40+
41+
# Compile the code
42+
- name: Compile code
43+
run: ./gradlew assemble
44+
45+
# Gradle check
46+
- name: Check
47+
run: ./gradlew check
48+
49+
- uses: actions/upload-artifact@v2
50+
if: always()
51+
with:
52+
name: integration-test-logs
53+
path: build/container-logs/
54+
retention-days: 7
55+
56+
# Check that the docker image builds correctly
57+
docker:
58+
# The type of runner that the job will run on
59+
runs-on: ubuntu-latest
60+
61+
# Steps represent a sequence of tasks that will be executed as part of the job
62+
steps:
63+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
64+
- uses: actions/checkout@v2
65+
66+
- name: Cache Docker layers
67+
uses: actions/cache@v2
68+
with:
69+
path: /tmp/.buildx-cache
70+
key: ${{ runner.os }}-buildx-${{ hashFiles('Dockerfile', '**/*.gradle.kts', 'gradle.properties', 'src/main/**') }}
71+
restore-keys: |
72+
${{ runner.os }}-buildx-
73+
74+
# Add Docker labels and tags
75+
- name: Docker meta
76+
id: docker_meta
77+
uses: crazy-max/ghaction-docker-meta@v2
78+
with:
79+
images: ${{ env.DOCKER_IMAGE }}
80+
81+
- name: Login to Docker Hub
82+
uses: docker/login-action@v1
83+
with:
84+
username: ${{ secrets.DOCKERHUB_USERNAME }}
85+
password: ${{ secrets.DOCKERHUB_TOKEN }}
86+
87+
# Setup docker build environment
88+
- name: Set up QEMU
89+
uses: docker/setup-qemu-action@v1
90+
91+
- name: Set up Docker Buildx
92+
uses: docker/setup-buildx-action@v1
93+
94+
- name: Build
95+
uses: docker/build-push-action@v2
96+
with:
97+
context: ./
98+
file: ./Dockerfile
99+
cache-from: type=local,src=/tmp/.buildx-cache
100+
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
101+
load: true
102+
tags: ${{ steps.docker_meta.outputs.tags }}
103+
# Use runtime labels from docker_meta as well as fixed labels
104+
labels: |
105+
${{ steps.docker_meta.outputs.labels }}
106+
maintainer=Joris Borgdorff <[email protected]>
107+
org.opencontainers.image.authors=Joris Borgdorff <[email protected]>
108+
org.opencontainers.image.vendor=RADAR-base
109+
org.opencontainers.image.licenses=Apache-2.0
110+
111+
- name: Inspect image
112+
run: |
113+
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
114+
docker run --rm ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }} --help
115+
116+
# If the image was pushed, we need to pull it again to inspect it
117+
- name: Push image
118+
if: ${{ github.event_name != 'pull_request' }}
119+
run: docker push ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Continuous integration, including test and integration test
2+
name: Publish snapshots
3+
4+
# Run in master and dev branches and in all pull requests to those branches
5+
on:
6+
push:
7+
branches: [ dev ]
8+
9+
jobs:
10+
# Build and test the code
11+
build:
12+
# The type of runner that the job will run on
13+
runs-on: ubuntu-latest
14+
15+
# Steps represent a sequence of tasks that will be executed as part of the job
16+
steps:
17+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
18+
- uses: actions/checkout@v2
19+
20+
- name: Has SNAPSHOT version
21+
id: is-snapshot
22+
run: grep 'version = ".*-SNAPSHOT"' build.gradle.kts
23+
24+
- uses: actions/setup-java@v1
25+
with:
26+
java-version: 11
27+
28+
- name: Cache
29+
uses: actions/cache@v2
30+
with:
31+
# Cache gradle directories
32+
path: |
33+
~/.gradle/caches
34+
~/.gradle/wrapper
35+
# Key for restoring and saving the cache
36+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts', 'gradle.properties') }}
37+
restore-keys: |
38+
${{ runner.os }}-gradle
39+
40+
- name: Install gpg secret key
41+
run: |
42+
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
43+
gpg --list-secret-keys --keyid-format LONG
44+
45+
- name: Publish
46+
env:
47+
OSSRH_USER: ${{ secrets.OSSRH_USER }}
48+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
49+
run: ./gradlew -Psigning.gnupg.keyName=${{ secrets.OSSRH_GPG_SECRET_KEY_NAME }} -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} publish

.github/workflows/release.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# Create release files
2+
name: Release
3+
4+
on:
5+
release:
6+
types: [published]
7+
8+
jobs:
9+
upload:
10+
# The type of runner that the job will run on
11+
runs-on: ubuntu-latest
12+
13+
# Steps represent a sequence of tasks that will be executed as part of the job
14+
steps:
15+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
16+
- uses: actions/checkout@v2
17+
- uses: actions/setup-java@v1
18+
with:
19+
java-version: 11
20+
21+
- name: Gradle cache
22+
uses: actions/cache@v2
23+
with:
24+
# Cache gradle directories
25+
path: |
26+
~/.gradle/caches
27+
~/.gradle/wrapper
28+
# An explicit key for restoring and saving the cache
29+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts', 'gradle.properties') }}
30+
restore-keys: |
31+
${{ runner.os }}-gradle-
32+
33+
# Compile code
34+
- name: Compile code
35+
run: ./gradlew assemble
36+
37+
# Upload it to GitHub
38+
- name: Upload to GitHub
39+
uses: AButler/[email protected]
40+
with:
41+
files: 'build/libs/*;build/distributions/*'
42+
repo-token: ${{ secrets.GITHUB_TOKEN }}
43+
44+
- name: Install gpg secret key
45+
run: |
46+
cat <(echo -e "${{ secrets.OSSRH_GPG_SECRET_KEY }}") | gpg --batch --import
47+
gpg --list-secret-keys --keyid-format LONG
48+
49+
- name: Publish
50+
env:
51+
OSSRH_USER: ${{ secrets.OSSRH_USER }}
52+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
53+
run: ./gradlew -Psigning.gnupg.keyName=${{ secrets.OSSRH_GPG_SECRET_KEY_NAME }} -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} publish closeAndReleaseSonatypeStagingRepository
54+
55+
# Build and push tagged release docker image
56+
docker:
57+
# The type of runner that the job will run on
58+
runs-on: ubuntu-latest
59+
60+
# Steps represent a sequence of tasks that will be executed as part of the job
61+
steps:
62+
- uses: actions/checkout@v2
63+
64+
# Add Docker labels and tags
65+
- name: Docker meta
66+
id: docker_meta
67+
uses: crazy-max/ghaction-docker-meta@v2
68+
with:
69+
images: ${{ env.DOCKER_IMAGE }}
70+
tags: |
71+
type=match,pattern=v(.*),group=1
72+
73+
# Setup docker build environment
74+
- name: Set up QEMU
75+
uses: docker/setup-qemu-action@v1
76+
- name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v1
78+
79+
- name: Login to DockerHub
80+
uses: docker/login-action@v1
81+
with:
82+
username: ${{ secrets.DOCKERHUB_USERNAME }}
83+
password: ${{ secrets.DOCKERHUB_TOKEN }}
84+
85+
- name: Build and push
86+
id: docker_build
87+
uses: docker/build-push-action@v2
88+
with:
89+
context: ./
90+
file: ./Dockerfile
91+
# Allow running the image on the architectures supported by openjdk:11-jre-slim
92+
platforms: linux/amd64,linux/arm64
93+
push: true
94+
tags: ${{ steps.docker_meta.outputs.tags }}
95+
# Use runtime labels from docker_meta as well as fixed labels
96+
labels: |
97+
${{ steps.docker_meta.outputs.labels }}
98+
maintainer=Joris Borgdorff <[email protected]>
99+
org.opencontainers.image.authors=Joris Borgdorff <[email protected]>
100+
org.opencontainers.image.vendor=RADAR-base
101+
org.opencontainers.image.licenses=Apache-2.0
102+
103+
- name: Inspect image
104+
run: |
105+
docker pull ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
106+
docker image inspect ${{ env.DOCKER_IMAGE }}:${{ steps.docker_meta.outputs.version }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Snyk scheduled test
2+
on:
3+
schedule:
4+
- cron: '0 2 * * 1'
5+
jobs:
6+
security:
7+
runs-on: ubuntu-latest
8+
env:
9+
REPORT_FILE: test.json
10+
steps:
11+
- uses: actions/checkout@master
12+
13+
- name: Run Snyk to check for vulnerabilities
14+
uses: snyk/actions/gradle-jdk11@master
15+
env:
16+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
17+
with:
18+
command: test
19+
args: --json-file-output=${{ env.REPORT_FILE }}
20+
21+
- name: Report new vulnerabilities
22+
uses: thehyve/report-vulnerability@master
23+
with:
24+
report-file: ${{ env.REPORT_FILE }}
25+
env:
26+
TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
if: ${{ failure() }}

.github/workflows/snyk.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Snyk test
2+
on:
3+
pull_request:
4+
branches:
5+
- master
6+
jobs:
7+
security:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@master
11+
- name: Run Snyk to check for vulnerabilities
12+
uses: snyk/actions/gradle-jdk11@master
13+
env:
14+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
15+
with:
16+
args: --severity-threshold=high

.travis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212

13-
FROM gradle:6.7.1-jdk11 AS builder
13+
FROM gradle:7.0-jdk11 AS builder
1414

1515
RUN mkdir /code
1616
WORKDIR /code
1717

1818
ENV GRADLE_USER_HOME=/code/.gradlecache
1919

20-
COPY ./build.gradle ./gradle.properties ./settings.gradle /code/
20+
COPY ./build.gradle.kts ./gradle.properties ./settings.gradle.kts /code/
2121

22-
RUN gradle downloadDependencies copyDependencies startScripts
22+
RUN gradle downloadDependencies copyDependencies startScripts --no-watch-fs
2323

2424
COPY ./src /code/src
2525

26-
RUN gradle jar
26+
RUN gradle jar --no-watch-fs
2727

2828
FROM openjdk:11-jre-slim
2929

0 commit comments

Comments
 (0)