Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/actions #13

Merged
merged 2 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/01_bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: "\U0001F6A8 Bug"
about: Did you come across a bug or unexpected behaviour differing from the docs?
labels: bug
---

<!--
Thanks for reporting a bug!
Before opening a new issue, please make sure that we do not have any duplicates already open.
You can ensure this by searching the issue list for this repository.
If there is a duplicate, please close your issue and add a comment to the existing issue instead.
-->

## Describe the bug

<!-- Describe your issue, but please be descriptive! Thanks again -->

## Expected behaviour

<!-- A clear and concise description of what you expected to happen. -->

## Steps to reproduce the issue

<!-- include screenshots, logs, code or other info to help explain your problem -->

<!--
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->

## Technical details

- Host Machine OS (Windows/Linux/Mac):

## Possible Fix

<!-- Not obligatory, but suggest a fix or reason for the bug -->

## Additional context

<!-- Add any other context about the problem here. -->
31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/02_feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: "\U0001F381 Feature Request"
about: Do you have an idea for a new feature?
labels: feature request
---

<!--
Thanks for requesting a feature!
Before opening a new issue, please make sure that we do not have any duplicates already open.
You can ensure this by searching the issue list for this repository.
If there is a duplicate, please close your issue and add a comment to the existing issue instead.
-->

## Feature description

<!--
Provide a detailed description of the feature or improvement you are proposing.
What specific solution would you like? What is the expected behaviour?
Add any other context, screenshots, or code snippets about the feature request here as well.
-->

## Problem and motivation

<!--
Why is this change important to you? What is the problem this feature would solve?
How would you use it? How can it benefit other users?
-->

## Is this something you're interested in working on

<!-- Yes or No -->
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/03_enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: "\u23F1\uFE0F Enhancement"
about: Do you have an idea for an enhancement?
labels: enhancement
---

<!--
Thanks for proposing an enhancement!
Before opening a new issue, please make sure that we do not have any duplicates already open.
You can ensure this by searching the issue list for this repository.
If there is a duplicate, please close your issue and add a comment to the existing issue instead.
-->

## Current Implementation

<!-- Describe or point to the current implementation that you would like to see improved -->

## Suggested Enhancement

<!--
Outline the idea of your enhancement, by e.g., describing the algorithm you propose.
You can also create a Pull Request to outline your idea
-->

## Expected Benefits

<!--
Summarize how your enhancement could aid the implementation (performance, readability, memory consumption, battery consumption, etc.).
Please also back up with measurements or give detailed explanations for reduced runtime, memory consumption, etc.
-->
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/04_question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: "\U00002753 Question"
about: If you have questions about pieces of the code or documentation for this component, please post them here.
labels: question
---

<!--
Thanks for submitting your question!
Before opening a new issue, please make sure that we do not have any duplicates already open.
You can ensure this by searching the issue list for this repository. If there is a duplicate, please close your issue and add a comment to the existing issue instead.
Also, please, have a look at our FAQs and existing questions before opening a new question.
-->

## Your Question

<!-- Include details about your question. -->

* Source File:
* Line(s):
* Question:
40 changes: 40 additions & 0 deletions .github/workflows/ci-dependency-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: ci-dependency-check
on:
schedule:
- cron: '0 1 * * 0' # Each Sunday at 01:00 UTC
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: adopt
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: |
~/.m2/repository
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- name: version
run: |-
APP_SHA=$(git rev-parse --short ${GITHUB_SHA})
APP_LATEST_REV=$(git rev-list --tags --max-count=1)
APP_LATEST_TAG=$(git describe --tags ${APP_LATEST_REV} 2> /dev/null || echo 0.0.0)
echo "APP_VERSION=${APP_LATEST_TAG}-${APP_SHA}" >> ${GITHUB_ENV}
- name: mvn
run: |-
mvn dependency-check:check \
--batch-mode \
--file ./pom.xml \
--settings ./settings.xml \
--define app.packages.username="${APP_PACKAGES_USERNAME}" \
--define app.packages.password="${APP_PACKAGES_PASSWORD}" \
env:
APP_PACKAGES_USERNAME: ${{ github.actor }}
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
37 changes: 37 additions & 0 deletions .github/workflows/ci-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ci-deploy
on:
workflow_dispatch:
inputs:
version:
required: true
description: Version to deploy
jobs:
deploy:
runs-on: ubuntu-20.04
environment: dev
env:
APP_VERSION: ${{ github.event.inputs.version }}
steps:
- name: cf setup
run: |-
curl -sL "https://packages.cloudfoundry.org/stable?release=${CF_RELEASE}&version=${CF_VERSION}" | \
sudo tar -zx -C /usr/local/bin
env:
CF_VERSION: 7.2.0
CF_RELEASE: linux64-binary
- name: cf push
run: |-
cf api ${CF_API}
cf auth
cf target -o ${CF_ORG} -s ${CF_SPACE}
cf push ${APP_NAME} --docker-image ${APP_IMAGE}:${APP_VERSION} --docker-username ${CF_DOCKER_USERNAME}
env:
APP_NAME: dgca-businessrule-service
APP_IMAGE: docker.pkg.github.com/${{ github.repository }}/dgca-businessrule-service
CF_API: ${{ secrets.CF_API }}
CF_ORG: ${{ secrets.CF_ORG }}
CF_SPACE: ${{ secrets.CF_SPACE }}
CF_USERNAME: ${{ secrets.CF_USERNAME }}
CF_PASSWORD: ${{ secrets.CF_PASSWORD }}
CF_DOCKER_USERNAME: ${{ secrets.CF_DOCKER_USERNAME }}
CF_DOCKER_PASSWORD: ${{ secrets.CF_DOCKER_PASSWORD }}
56 changes: 56 additions & 0 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: ci-main
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: adopt
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: |
~/.m2/repository
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- name: version
run: |-
APP_SHA=$(git rev-parse --short ${GITHUB_SHA})
APP_LATEST_REV=$(git rev-list --tags --max-count=1)
APP_LATEST_TAG=$(git describe --tags ${APP_LATEST_REV} 2> /dev/null || echo 0.0.0)
echo "APP_VERSION=${APP_LATEST_TAG}-${APP_SHA}" >> ${GITHUB_ENV}
- name: mvn
run: |-
mvn versions:set \
--batch-mode \
--file ./pom.xml \
--settings ./settings.xml \
--define newVersion="${APP_VERSION}"
mvn clean verify \
--batch-mode \
--file ./pom.xml \
--settings ./settings.xml \
--define app.packages.username="${APP_PACKAGES_USERNAME}" \
--define app.packages.password="${APP_PACKAGES_PASSWORD}"
env:
APP_PACKAGES_USERNAME: ${{ github.actor }}
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: docker
run: |-
echo "${APP_PACKAGES_PASSWORD}" | docker login "${APP_PACKAGES_URL}" \
--username "${APP_PACKAGES_USERNAME}" \
--password-stdin
docker build . \
--file ./Dockerfile \
--tag "${APP_PACKAGES_URL}:${APP_VERSION}"
docker push "${APP_PACKAGES_URL}:${APP_VERSION}"
env:
APP_PACKAGES_URL: docker.pkg.github.com/${{ github.repository }}/dgca-businessrule-service
APP_PACKAGES_USERNAME: ${{ github.actor }}
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
67 changes: 67 additions & 0 deletions .github/workflows/ci-openapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: ci-openapi
on:
workflow_dispatch:
release:
types:
- created
jobs:
release:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: adopt
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: |
~/.m2/repository
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- name: version
run: >-
APP_SHA=$(git rev-parse --short ${GITHUB_SHA});
APP_TAG=${GITHUB_REF/refs\/tags\/}
APP_VERSION=${APP_TAG};
echo "APP_SHA=${APP_SHA}" >> ${GITHUB_ENV};
echo "APP_TAG=${APP_TAG}" >> ${GITHUB_ENV};
echo "APP_VERSION=${APP_VERSION}" >> ${GITHUB_ENV};
- name: mvn
run: >-
mvn versions:set
--batch-mode
--file ./pom.xml
--settings ./settings.xml
--define newVersion="${APP_VERSION}";
mvn clean verify
--batch-mode
--file ./pom.xml
--settings ./settings.xml
--define app.packages.username="${APP_PACKAGES_USERNAME}"
--define app.packages.password="${APP_PACKAGES_PASSWORD}";
env:
APP_PACKAGES_USERNAME: ${{ github.actor }}
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: openapi.json
path: target/openapi.json
- name: Checkout OpenApi Doc Branch
uses: actions/checkout@v2
with:
ref: openapi-doc
- name: Delete existing openapi.json
run: rm -f openapi.json
- name: Download openapi.json
uses: actions/download-artifact@v2
with:
name: openapi.json
- name: Commit and Push changes
run: |
git config user.name github-actions
git config user.email [email protected]
git commit -a --allow-empty -m "Update OpenAPI JSON"
git push
38 changes: 38 additions & 0 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: ci-pull-request
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-java@v2
with:
java-version: 11
distribution: adopt
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v2
with:
path: |
~/.m2/repository
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- name: mvn
run: |-
mvn clean package \
--batch-mode \
--file ./pom.xml \
--settings ./settings.xml \
--define app.packages.username="${APP_PACKAGES_USERNAME}" \
--define app.packages.password="${APP_PACKAGES_PASSWORD}"
env:
APP_PACKAGES_USERNAME: ${{ github.actor }}
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: docker
run: |-
docker build . \
--file ./Dockerfile
19 changes: 19 additions & 0 deletions .github/workflows/ci-release-notes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: ci-release-notes
on:
release:
types:
- created
jobs:
release-notes:
runs-on: ubuntu-20.04
env:
APP_VERSION: ${{ github.event.release.tag_name }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: release-notes
run: npx github-release-notes release --override --tags ${APP_VERSION}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GREN_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading