Skip to content

Commit

Permalink
Add workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kamfosica committed May 4, 2022
1 parent 6f8ed6f commit 032bacf
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/spring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
permissions: write-all
name: Release
on:
push:
tags:
- v*
jobs:
release-and-sign:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 16

- name: Maven cache
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Build
run: mvn -B package -DskipTests

- name: Prepare release
run: |
mkdir -p release-assets/mis release-assets/api
cp sctp-api/target/sctp-api*.jar release-assets/api/
cp sctp-mis/target/sctp-mis*.jar release-assets/mis/
cp sctp-common.example.yaml release-assets/sctp-common-local.yaml
cp sctp-mis/application-example.yaml release-assets/mis/application-prod.yaml
cp sctp-api/application-prod-example.yaml release-assets/api/application-prod.yaml
cp README.txt release-assets/
- name: Action Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
release-assets/*
3 changes: 3 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Run MIS using: java -jar sctp-mis-x.x.x.jar -spring.profiles.active=prod

Run API using: java -jar sctp-api-x.x.x.jar -spring.profiles.active=prod
25 changes: 25 additions & 0 deletions sctp-api/application-prod-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
spring:
config:
import: file:../sctp-common-local.yaml

---
# Authentication
auth:
max_attempts: 5
jwt:
iss: # issuer
secret: # secret

# Logging level
logging:
level:
org:
cga: INFO
root: ERROR

# Spring Doc + API documentation configuration (/api-doc.yaml or /api-doc)
springdoc:
api-docs:
enabled: true
swagger-ui:
enabled: true
56 changes: 56 additions & 0 deletions sctp-common.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Core configuration file. Import this file in the MIS and API configuration files using the following
# This file is not checked into version control. The import must be the first thing in the file
#
#spring:
# config:
#import: file:<some-path>/sctp-core.yaml

auth:
max_attempts: 3
jwt:
iss: sctp

spring:
resources:
cache:
cachecontrol:
max-age: 365d
datasource:
username: sctp
password: toor
url: jdbc:mysql://localhost/sctp

# Email/SMTP settings
simplejavamail:
transportstrategy: SMTP
fromName: SCTP MIS
fromAddress: no-reply@target.ministryofgender-socialcashtransfer.com
smtp:
host: localhost
port: 25
password:
username:
javaxmail:
debug: false

# Data importation setting.
# If importing data through CSV, this path will be used to temporarily hold files
imports:
staging: ./staging

# Targeting related settings
targeting:
pictures: ./beneficiary-images # Where to save beneficiary pictures. If the directory does not exist, it will be created.

sctp:
transfers:
# Number of months in a transfer period for manual transfers, defaults to 2
manualTransferFrequency: 2

# Ubr API settings
ubr:
api:
baseUrl: http://localhost:8082/
fetchHouseholdData: /api/v2/get_households_data
username:
password:
5 changes: 5 additions & 0 deletions sctp-mis/application-example.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
spring:
config:
import: file:../sctp-common-local.yaml

---
# Logging level
logging:
level:
Expand Down

0 comments on commit 032bacf

Please sign in to comment.