diff --git a/.github/workflows/spring.yml b/.github/workflows/spring.yml new file mode 100644 index 00000000..e99dcbdb --- /dev/null +++ b/.github/workflows/spring.yml @@ -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/* \ No newline at end of file diff --git a/README.txt b/README.txt new file mode 100644 index 00000000..165cf229 --- /dev/null +++ b/README.txt @@ -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 \ No newline at end of file diff --git a/sctp-api/application-prod-example.yaml b/sctp-api/application-prod-example.yaml new file mode 100644 index 00000000..a5a2a76f --- /dev/null +++ b/sctp-api/application-prod-example.yaml @@ -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 \ No newline at end of file diff --git a/sctp-common.example.yaml b/sctp-common.example.yaml new file mode 100644 index 00000000..881445af --- /dev/null +++ b/sctp-common.example.yaml @@ -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:/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: \ No newline at end of file diff --git a/sctp-mis/application-example.yaml b/sctp-mis/application-example.yaml index fb81a0f3..01c08783 100644 --- a/sctp-mis/application-example.yaml +++ b/sctp-mis/application-example.yaml @@ -1,3 +1,8 @@ +spring: + config: + import: file:../sctp-common-local.yaml + +--- # Logging level logging: level: