-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
163 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: Java CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Test, validate and build Java application | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Cache local Maven repository | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Build with Maven | ||
run: mvn verify | ||
- name: Run Checkstyle | ||
run: mvn checkstyle:check | ||
- name: Run SpotBugs | ||
run: mvn com.github.spotbugs:spotbugs-maven-plugin:check | ||
- name: Run OWASP dependency-check (only on dev) | ||
run: mvn org.owasp:dependency-check-maven:check | ||
if: ${{ github.ref == 'refs/heads/dev' }} | ||
|
||
- name: Extract Version | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
run: | | ||
mvn help:evaluate -Dexpression=project.version -q -DforceStdout > version.txt | ||
- name: Store artifacts | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: build-artifacts | ||
path: | | ||
version.txt | ||
target/seqdb.api-*.jar | ||
Dockerfile | ||
push: | ||
name: Build Docker Image and Push to DockerHub | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
|
||
steps: | ||
- name: Download artifacts from build job | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: build-artifacts | ||
|
||
- name: Set VERSION_TAG ENV variable | ||
run: | | ||
echo "VERSION_TAG=$(cat version.txt)" >> $GITHUB_ENV | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Build Image and Push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
push: true | ||
tags: aafcbicoe/seqdb-api:${{ env.VERSION_TAG }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
/target/ | ||
.vscode | ||
.factorypath | ||
*.env | ||
*.env | ||
docker-compose.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
version: '3' | ||
version: '3.7' | ||
services: | ||
db: | ||
seqdb-db: | ||
image: "postgres:10" | ||
container_name: "seqdbapi_test_postgres" | ||
environment: | ||
POSTGRES_DB: seqdb_api_test | ||
POSTGRES_PASSWORD: mypassword | ||
env_file: | ||
- ${BASE_PATH_TO_SEQDB:-.}/pg.env | ||
volumes: | ||
- ./src/test/resources/init-db.sql:/docker-entrypoint-initdb.d/1-init-schema.sql | ||
- ${BASE_PATH_TO_SEQDB:-.}/src/test/resources/init-test-db.sql:/docker-entrypoint-initdb.d/1-init-schema.sql | ||
|
||
seqdb-api: | ||
build: ${BASE_PATH_TO_SEQDB:-.} | ||
ports: | ||
- "5432:5432" | ||
- "8084:8080" | ||
env_file: | ||
- ${BASE_PATH_TO_SEQDB:-.}/seqdb-api.env | ||
networks: | ||
default: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
POSTGRES_DB=seqdb_test | ||
POSTGRES_PASSWORD= mypassword |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
spring.datasource.url=jdbc:postgresql://seqdb-db/seqdb_test?currentSchema=seqdb | ||
spring.datasource.username=web_user | ||
spring.datasource.password=test | ||
spring.liquibase.user=migration_user | ||
spring.liquibase.password=test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.