Skip to content

Commit

Permalink
Merge branch 'main' into feature/4-Implement-the-checkBalance
Browse files Browse the repository at this point in the history
  • Loading branch information
NkwaTambe authored Jun 11, 2024
2 parents 818bb3d + 8314af3 commit 0ac8bd5
Show file tree
Hide file tree
Showing 58 changed files with 12,213 additions and 2,961 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/build-deploy-and-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ on:
- 'v*'
paths:
- 'power-pay-frontend/**'
- '.github/workflows/build-deploy-and-docker-build.yml'

pull_request:
branches:
- '**'
paths:
- 'power-pay-frontend/**'

- '.github/workflows/build-deploy-and-docker-build.yml'
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-frontend
jobs:
# Build Job
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: power-pay-frontend
steps:
- name: Checkout Code
uses: actions/checkout@v3
Expand All @@ -30,10 +34,10 @@ jobs:
with:
node-version: 20
- name: Install Dependencies
run: cd power-pay-frontend && npm ci
run: npm ci

- name: Build Project
run: cd power-pay-frontend && npm run build-for-gh
run: npm run build-for-gh

- name: Upload artifact to enable deployment
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -72,7 +76,8 @@ jobs:
packages: write

steps:
- uses: actions/checkout@v4
- name: Checkout Code
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand Down
55 changes: 37 additions & 18 deletions .github/workflows/build-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ on:
- 'v*'
paths:
- 'power-pay-backend/**'

pull_request:
branches:
- '**'
paths:
- 'power-pay-backend/**'
- '.github/workflows/build-service.yml'

env:
REGISTRY: ghcr.io
Expand All @@ -22,46 +17,70 @@ env:

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: power-pay-backend

steps:
- name: Clone the project
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Maven build
run: mvn clean package -q
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: power-pay-backend
path: power-pay-backend/target/*.jar

docker-build:
needs:
- build
runs-on: ubuntu-latest
defaults:
run:
working-directory: power-pay-backend

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
- name: Clone the project
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
distribution: 'temurin'
java-version: '17'

name: power-pay-backend
path: power-pay-backend/target

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}


- id: string
- id: lowercase_name
uses: ASzc/change-string-case-action@v6
with:
string: ${{ env.IMAGE_NAME}}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ steps.string.outputs.lowercase }}
images: ${{ env.REGISTRY }}/${{ steps.lowercase_name.outputs.lowercase }}

- name: Build and push image
uses: docker/build-push-action@v5
if: github.event_name != 'pull_request'
with:
context: ./power-pay-backend
file: ./power-pay-backend/Dockerfile
push: true
push: "${{ github.ref == 'refs/heads/main' && 'true' || 'false' }}"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/build-translator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,20 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 20

- name: Install OpenAPI Generator
run: npm install @openapitools/openapi-generator-cli -g

- name: Run OpenAPI
run: cd power-pay-translator && openapi-generator-cli generate -i ../docs/pps-ppt.openapi.yaml -g rust-server -o crates/server-ppt --additional-properties packageName=server-ppt

- name: Build Translator
run: cd power-pay-translator && cargo build --verbose && cargo test --verbose


- name: Login to the Docker registry
id: login
uses: docker/login-action@v3
Expand Down
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
## WorkFlow Status
[![Build, deploy and docker build frontend](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-deploy-and-docker-build.yml/badge.svg)](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-deploy-and-docker-build.yml) [![Build Translator](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-translator.yml/badge.svg)](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-translator.yml) [![Build Backend](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-service.yml/badge.svg)](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-service.yml)

[![Build, deploy and docker build frontend](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-deploy-and-docker-build.yml/badge.svg)](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-deploy-and-docker-build.yml)

[![Build Translator](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-translator.yml/badge.svg)](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-translator.yml)

[![Build Backend](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-service.yml/badge.svg)](https://github.com/ADORSYS-GIS/e2e-banking-app/actions/workflows/build-service.yml)

# e2e-banking-app
# E2E Banking App
Welcome to the e2e-banking-app project! This repository contains the code for the end-to-end banking application.

## Prerequisites
Expand Down Expand Up @@ -112,4 +106,4 @@ To run the e2e-banking-app project locally, follow these steps:
- Start application:
```bash
cargo run
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ Github Actions is a continuous integration and continuous delivery (CI/CD) platf

### Step 1.
- Create new files named:
.github/workflows/maven.yml,
.github/workflows/node.yml, and
.github/workflows/rust.yml
.github/workflows/build-service.yml,
.github/workflows/build-deploy-and-docker-build.yml, and
.github/workflows/build-translator.yml
in the main project directory for the backend, frontend and translator respectively.

### Step 2.
Expand Down
82 changes: 82 additions & 0 deletions docs/pps-ppt.openapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
openapi: 3.0.3
info:
title: PPS (client) to PPT (server) Converter
description: Some description
version: 1.0.0
servers:
- url: 'http://localhost:{port}'
variables:
port:
default: '8080'
- url: 'https://translator.powerpay.internal'
tags:
- name: SMS
description: Operations related to SMS
paths:
'/send-sms':
post:
tags:
- SMS
summary: Send SMS
operationId: sendSms
description: Send SMS to a phone number
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SendSmsPayload'
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/SendSmsResponse'
'400':
description: Bad Request
'500':
description: Internal Server Error
'/hello':
get:
summary: Hello
operationId: hello
description: Hello
responses:
'200':
description: OK
content:
text/plain:
schema:
type: string

components:
schemas:
SendSmsPayload:
type: object
properties:
phone_number:
type: string
example: '+237 6 23 45 17 89'
description: Phone number to which the SMS will be sent
message:
type: string
description: Message to be sent
SendSmsResponse:
type: object
properties:
status_description:
type: string
description: Detailed status of the operation.
status:
type: boolean
description: Status of the operation.
Error:
type: object
properties:
status:
type: string
description: Status
message:
type: string
description: Message
Loading

0 comments on commit 0ac8bd5

Please sign in to comment.