Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #91 from livepoll/develop
Browse files Browse the repository at this point in the history
Continuous release
  • Loading branch information
marcauberer authored Jun 7, 2021
2 parents 75bdaae + 9f1417c commit ab7909d
Show file tree
Hide file tree
Showing 76 changed files with 4,663 additions and 690 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# For more details, read the following article on GitHub: https://help.github.com/articles/about-codeowners/.

# These are the default owners for the whole content of this repository. The default owners are automatically added as reviewers when you open a pull request, unless different owners are specified in the file.
* @Ordinateur-Hack @Niklas-23
* @Splines @Niklas-23
52 changes: 52 additions & 0 deletions .github/scripts/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: "3.9"
services:
db:
image: mysql:8.0
networks:
- app-db
environment:
MYSQL_ROOT_PASSWORD: qCNyq2SazD9vHqre5PPR7dCLs84Jhk
MYSQL_DATABASE: livepoll
MYSQL_USER: livepoll
MYSQL_PASSWORD: M3uBcPLbM7RmgX4C3wAUej6WPzq886
healthcheck:
test: ["CMD", "mysqladmin", "ping"]
interval: 10s
retries: 10
timeout: 5s
start_period: 40s
api:
build: ../..
networks:
- app-db
ports:
- 8080:8080
environment:
LIVE_POLL_MYSQL_URL: jdbc:mysql://db:3306/livepoll
LIVE_POLL_MYSQL_USER: livepoll
LIVE_POLL_MYSQL_PASSWORD: M3uBcPLbM7RmgX4C3wAUej6WPzq886
LIVE_POLL_DEV_URL: localhost:4200
LIVE_POLL_SERVER_URL: localhost:8080
LIVE_POLL_MAIL_HOST: ${LIVE_POLL_MAIL_HOST}
LIVE_POLL_MAIL_PORT: ${LIVE_POLL_MAIL_PORT}
LIVE_POLL_MAIL_USERNAME: ${LIVE_POLL_MAIL_USERNAME}
LIVE_POLL_MAIL_PASSWORD: ${LIVE_POLL_MAIL_PASSWORD}
LIVE_POLL_JWT_AUTH_COOKIE_NAME: jaQ83KNSgsquPRGy8b8HraKB5kUQC3
LIVE_POLL_JWT_COOKIE_KEY_VALUE: 4Vdx8rg84SvGYbhNwdsS8s6ZwH94LC
LIVE_POLL_JWT_SECRET: xyqCc3h3Z2DSYvz7ELEQMsv4U4b7jg
LIVE_POLL_HTTPS_ENABLED: "false"
LIVE_POLL_HTTPS_CERT_PASSWORD: ${LIVE_POLL_HTTPS_CERT_PASSWORD}
LIVE_POLL_POSTMAN: "true"
server.error.include-message: "always"
depends_on:
db:
condition: service_healthy
healthcheck:
test: "curl --fail --silent localhost:8080/actuator/health | grep UP || exit 1"
interval: 10s
timeout: 5s
retries: 10
start_period: 40s

networks:
app-db: {}
23 changes: 15 additions & 8 deletions .github/workflows/ci-with-docker-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.11
uses: actions/setup-java@v1
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.11
distribution: zulu
java-version: 11

- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn package --file pom.xml --batch-mode --quiet --no-transfer-progress
env:
LIVE_POLL_MYSQL_URL: ${{ secrets.API_LIVE_POLL_MYSQL_URL }}
LIVE_POLL_MYSQL_USER: ${{ secrets.API_LIVE_POLL_MYSQL_USER }}
Expand All @@ -30,13 +34,14 @@ jobs:
LIVE_POLL_MAIL_PASSWORD: ${{ secrets.API_LIVE_POLL_MAIL_PASSWORD }}
LIVE_POLL_JWT_AUTH_COOKIE_NAME: ${{ secrets.API_LIVE_POLL_JWT_AUTH_COOKIE_NAME }}
LIVE_POLL_JWT_COOKIE_KEY_VALUE: ${{ secrets.API_LIVE_POLL_JWT_COOKIE_KEY_VALUE }}
LIVE_POLL_JWT_SECRET: ${{ secrets.API_LIVE_POLL_JWT_SECRET }}
LIVE_POLL_HTTPS_ENABLED: ${{ secrets.API_LIVE_POLL_HTTPS_ENABLED }}
LIVE_POLL_HTTPS_CERT_PASSWORD: ${{ secrets.API_LIVE_POLL_HTTPS_CERT_PASSWORD }}
LIVE_POLL_H2_URL: ${{ secrets.API_LIVE_POLL_H2_URL }}
TEST_USER_NAME: ${{ secrets.API_TEST_USER_NAME }}
TEST_USER_PASSWORD: ${{ secrets.API_TEST_USER_PASSWORD }}
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}

- name: CodeCov report deploy
run: bash <(curl -s https://codecov.io/bash)

- name: Prepare environment
run: |
sudo apt-get install --yes --no-install-recommends libxml-xpath-perl
Expand All @@ -45,11 +50,13 @@ jobs:
export VERSION=$(xpath -q -e "/project/version/text()" pom.xml)
export VERSION=${VERSION//-SNAPSHOT}-$(git rev-parse --short ${GITHUB_SHA})
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: GH Packages deploy
uses: actions/upload-artifact@v1
with:
name: target
path: target

- name: Docker build and push
run: |
echo ${CR_PAT} | docker login ghcr.io -u ${GITHUB_REPOSITORY_OWNER} --password-stdin
Expand Down
23 changes: 15 additions & 8 deletions .github/workflows/ci-with-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.11
uses: actions/setup-java@v1
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.11
distribution: zulu
java-version: 11

- name: Build with Maven
run: mvn -B package --file pom.xml
run: mvn package --file pom.xml --batch-mode --quiet --no-transfer-progress
env:
LIVE_POLL_MYSQL_URL: ${{ secrets.API_LIVE_POLL_MYSQL_URL }}
LIVE_POLL_MYSQL_USER: ${{ secrets.API_LIVE_POLL_MYSQL_USER }}
Expand All @@ -32,13 +36,14 @@ jobs:
LIVE_POLL_MAIL_PASSWORD: ${{ secrets.API_LIVE_POLL_MAIL_PASSWORD }}
LIVE_POLL_JWT_AUTH_COOKIE_NAME: ${{ secrets.API_LIVE_POLL_JWT_AUTH_COOKIE_NAME }}
LIVE_POLL_JWT_COOKIE_KEY_VALUE: ${{ secrets.API_LIVE_POLL_JWT_COOKIE_KEY_VALUE }}
LIVE_POLL_JWT_SECRET: ${{ secrets.API_LIVE_POLL_JWT_SECRET }}
LIVE_POLL_HTTPS_ENABLED: ${{ secrets.API_LIVE_POLL_HTTPS_ENABLED }}
LIVE_POLL_HTTPS_CERT_PASSWORD: ${{ secrets.API_LIVE_POLL_HTTPS_CERT_PASSWORD }}
LIVE_POLL_H2_URL: ${{ secrets.API_LIVE_POLL_H2_URL }}
TEST_USER_NAME: ${{ secrets.API_TEST_USER_NAME }}
TEST_USER_PASSWORD: ${{ secrets.API_TEST_USER_PASSWORD }}
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}

- name: CodeCov report deploy
run: bash <(curl -s https://codecov.io/bash)

- name: Prepare environment
run: |
sudo apt-get install --yes --no-install-recommends libxml-xpath-perl
Expand All @@ -47,11 +52,13 @@ jobs:
export VERSION=$(xpath -q -e "/project/version/text()" pom.xml)
export VERSION=${VERSION//-SNAPSHOT}-$(git rev-parse --short ${GITHUB_SHA})
echo "VERSION=${VERSION}" >> $GITHUB_ENV
- name: GH Packages deploy
uses: actions/upload-artifact@v1
with:
name: target
path: target

- name: Docker build and push
run: |
echo ${CR_PAT} | docker login ghcr.io -u ${GITHUB_REPOSITORY_OWNER} --password-stdin
Expand Down
55 changes: 42 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,26 @@ name: CI

on:
push:
branches: [ develop ]
branches: [ develop, feature/** ]
pull_request:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 1.11
uses: actions/setup-java@v1
with:
java-version: 1.11
- name: Build and test project with Maven
run: mvn -B package --file pom.xml --batch-mode --update-snapshots clean verify
env:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
distribution: zulu
java-version: 11

- name: Build and test project with Maven
run: mvn package --file pom.xml --batch-mode --update-snapshots --quiet --no-transfer-progress
env:
LIVE_POLL_MYSQL_URL: ${{ secrets.API_LIVE_POLL_MYSQL_URL }}
LIVE_POLL_MYSQL_USER: ${{ secrets.API_LIVE_POLL_MYSQL_USER }}
LIVE_POLL_MYSQL_PASSWORD: ${{ secrets.API_LIVE_POLL_MYSQL_PASSWORD }}
Expand All @@ -33,8 +36,34 @@ jobs:
LIVE_POLL_MAIL_PASSWORD: ${{ secrets.API_LIVE_POLL_MAIL_PASSWORD }}
LIVE_POLL_JWT_AUTH_COOKIE_NAME: ${{ secrets.API_LIVE_POLL_JWT_AUTH_COOKIE_NAME }}
LIVE_POLL_JWT_COOKIE_KEY_VALUE: ${{ secrets.API_LIVE_POLL_JWT_COOKIE_KEY_VALUE }}
LIVE_POLL_JWT_SECRET: ${{ secrets.API_LIVE_POLL_JWT_SECRET }}
LIVE_POLL_HTTPS_ENABLED: ${{ secrets.API_LIVE_POLL_HTTPS_ENABLED }}
LIVE_POLL_HTTPS_CERT_PASSWORD: ${{ secrets.API_LIVE_POLL_HTTPS_CERT_PASSWORD }}
LIVE_POLL_H2_URL: ${{ secrets.API_LIVE_POLL_H2_URL }}
TEST_USER_NAME: ${{ secrets.API_TEST_USER_NAME }}
TEST_USER_PASSWORD: ${{ secrets.API_TEST_USER_PASSWORD }}
CUCUMBER_PUBLISH_TOKEN: ${{ secrets.CUCUMBER_PUBLISH_TOKEN }}

- name: Setup testing environment
working-directory: ./.github/scripts
run: docker-compose up -d
env:
LIVE_POLL_MAIL_HOST: ${{ secrets.API_LIVE_POLL_MAIL_HOST }}
LIVE_POLL_MAIL_PORT: ${{ secrets.API_LIVE_POLL_MAIL_PORT }}
LIVE_POLL_MAIL_USERNAME: ${{ secrets.API_LIVE_POLL_MAIL_USERNAME }}
LIVE_POLL_MAIL_PASSWORD: ${{ secrets.API_LIVE_POLL_MAIL_PASSWORD }}
LIVE_POLL_HTTPS_CERT_PASSWORD: ${{ secrets.API_LIVE_POLL_HTTPS_CERT_PASSWORD }}

- name: SonarQube report deployment
uses: kitabisa/sonarqube-action@master
env:
JAVA_HOME: '' # Avoid 'java: not found' error
with:
host: ${{ secrets.SONARQUBE_HOST }}
login: ${{ secrets.SONARQUBE_TOKEN }}

- name: Install Newman
run: sudo npm i -g newman

- name: API healthcheck
run: curl -sSLf --retry-delay 5 --retry 5 --retry-connrefused --insecure http://example.org > /dev/null

- name: Run Newman tests
run: newman run ./postman/Livepoll.postman_collection.json --iteration-count 3 --folder "Integration Test" --insecure
15 changes: 10 additions & 5 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@ name: Docs Build & Deploy

on:
push:
branches: [ main ]
branches: [ main, develop ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.11
uses: actions/setup-java@v1
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 1.11
distribution: zulu
java-version: 11

- name: Build Documentation
run: |
mvn clean dokka:dokka
git reset --hard HEAD
- name: Deploy docs
uses: SamKirkland/[email protected]
with:
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/sonarqube-checks.yml

This file was deleted.

9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
<p align="center">Easy to use, web-based poll management system.</p>
<p align="center">
<a target="_blank" href="https://github.com/livepoll/live-poll-api/releases/latest"><img src="https://img.shields.io/github/v/release/livepoll/live-poll-api?include_prereleases"></a>
<a target="_blank" href="https://github.com/livepoll/live-poll-api/blob/develop/.github/workflows/ci-with-docker.yml"><img src="https://img.shields.io/github/workflow/status/livepoll/live-poll-api/CI%20with%20Docker?label=Docker%20build"></a>
<a target="_blank" href="https://github.com/livepoll/live-poll-api/blob/develop/.github/workflows/ci-with-docker.yml"><img src="https://img.shields.io/github/workflow/status/livepoll/live-poll-api/CI%20with%20Docker?label=Docker%20build"></a>
<a target="_blank" href="./.github/workflows/ci.yml"><img src="https://github.com/livepoll/live-poll-api/workflows/CI/badge.svg"></a>
<a target="_blank" href="https://sonarqube.live-poll.de/dashboard?id=live-poll-api"><img src="https://sonarqube.live-poll.de/api/project_badges/measure?project=live-poll-api&metric=alert_status"></a>
<a target="_blank" href="https://codecov.io/gh/livepoll/live-poll-api"><img src="https://codecov.io/gh/livepoll/live-poll-api/branch/master/graph/badge.svg"></a>
<a target="_blank" href="https://reports.cucumber.io/report-collections/e912a74d-c89f-4b69-b276-a0f8658945c7"><img src="https://img.shields.io/badge/Cucumber-passed-brightgreen"></a>
<a target="_blank" href="https://sonarqube.live-poll.de/dashboard?id=live-poll-api"><img src="https://sonarqube.live-poll.de/api/project_badges/measure?project=live-poll-api&metric=alert_status"></a>
<a href="https://codecov.io/gh/livepoll/live-poll-api"><img src="https://codecov.io/gh/livepoll/live-poll-api/branch/develop/graph/badge.svg?token=K9GLhwYRDI"/></a>
<a target="_blank" href="https://makeapullrequest.com"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg"></a>
<a target="_blank" href="./LICENSE"><img src="https://img.shields.io/github/license/livepoll/live-poll-api"></a>
</p>
Expand All @@ -21,4 +22,4 @@
## Security policy
If you want to report a security vulnerability, please read our security policy in the [SECURITY.md](SECURITY.md) file.

© Live-Poll 2020-2021
© Live-Poll 2020-2021
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ That's why we rely on you, the open source contributors, to inform us about actu
Please follow the guideline below to get in touch with us, even if you're not sure, if your issue is regarding the data security.

## Reporting a Vulnerability
**Please do not open GitHub issues for security vulnerabilities, cause they are publicly accessible!!!**
**Please do not open GitHub issues for security vulnerabilities since they are publicly accessible!!!**

Instead, contact us per mail. We guarantee a response within two workdays and a security patch as fast as possible.

Expand Down
2 changes: 1 addition & 1 deletion env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following sections contain instructions about the selected services and inst
MySQL is a relational database.

### Setup
Compose Generator will ask you for the name of a dedicated database and the name of a dedicated user for your application. This database and user will be created on the first startup of the database container. Furthermore the cli automatically generates database user password for you, so you don't need to specify them yourself.
Compose Generator will ask you for the name of a dedicated database and the name of a dedicated user for your application. This database and user will be created on the first startup of the database container. Furthermore, the cli automatically generates a database user password for you, so you don't need to specify it yourself.

## PhpMyAdmin
*To be extended ...*
Expand Down
Empty file removed env/volumes/mysql-data/.gitkeep
Empty file.
Empty file removed env/volumes/mysql-logs/.gitkeep
Empty file.
Binary file added media/answers_old.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ab7909d

Please sign in to comment.