Skip to content

Commit d7834ae

Browse files
committed
ci/workflow-added
1 parent 046bb21 commit d7834ae

File tree

3 files changed

+151
-149
lines changed

3 files changed

+151
-149
lines changed

.github/workflows/main.yml

Lines changed: 113 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,130 +1,113 @@
1-
#name: auth-provider-application devsandbox
2-
#
3-
#on:
4-
# push:
5-
# branches: [ "main" ]
6-
#
7-
#jobs:
8-
# build:
9-
#
10-
# runs-on: ubuntu-latest
11-
# permissions:
12-
# contents: read
13-
# packages: write
14-
#
15-
# steps:
16-
# - uses: actions/checkout@v3
17-
# - name: Set up JDK 17
18-
# uses: actions/setup-java@v3
19-
# with:
20-
# java-version: '17'
21-
# distribution: 'temurin'
22-
# server-id: github
23-
# settings-path: ${{ github.workspace }}
24-
# - uses: docker/login-action@v1
25-
# with:
26-
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
27-
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
28-
#
29-
# - name: Build with Maven
30-
# run: mvn clean install
31-
#
32-
# - name: Cleaning Docker File
33-
# uses: appleboy/ssh-action@master
34-
# with:
35-
# host: ${{ secrets.V4_HOST }}
36-
# username: ${{ secrets.V4_USERNAME }}
37-
# password: ${{ secrets.V4_VPS_PRIVATE_KEY }}
38-
# port: 22
39-
# script: |
40-
# cd /root/bloggios-deployment-docker-files
41-
# git stash
42-
# git pull origin main
43-
#
44-
# - name: Cleaning File
45-
# uses: appleboy/ssh-action@master
46-
# with:
47-
# host: ${{ secrets.V4_HOST }}
48-
# username: ${{ secrets.V4_USERNAME }}
49-
# password: ${{ secrets.V4_VPS_PRIVATE_KEY }}
50-
# port: 22
51-
# script: |
52-
# cd /root/microservices/auth-provider-application
53-
# git stash
54-
# git pull origin main
55-
#
56-
# - name: Add Logback File
57-
# uses: appleboy/ssh-action@master
58-
# with:
59-
# host: ${{ secrets.V4_HOST }}
60-
# username: ${{ secrets.V4_USERNAME }}
61-
# key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
62-
# port: 22
63-
# script: |
64-
# rm /root/microservices/auth-provider-application/src/main/resources/auth-logback.xml
65-
# cp /root/secrets/logback/auth-logback.xml /root/microservices/auth-provider-application/src/main/resources
66-
#
67-
# - name: Add Keys
68-
# uses: appleby/ssh-action@master
69-
# with:
70-
# host: ${{ secrets.V4_HOST }}
71-
# username: ${{ secrets.V4_USERNAME }}
72-
# key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
73-
# port: 22
74-
# script: |
75-
# set +e
76-
# rm /root/microservices/auth-provider-application/src/main/resources/security/privkey.pem
77-
# /root/microservices/auth-provider-application/src/main/resources/security/pubkey.pem
78-
# set -e
79-
# cp /root/spring-boot/certificates/privkey.pem /root/microservices/auth-provider-application/src/main/resources/security
80-
# cp /root/spring-boot/certificates/pubkey.pem /root/microservices/auth-provider-application/src/main/resources/security
81-
#
82-
# - name: Stopping Container
83-
# uses: appleboy/ssh-action@master
84-
# with:
85-
# host: ${{ secrets.V4_HOST }}
86-
# username: ${{ secrets.V4_USERNAME }}
87-
# key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
88-
# port: 22
89-
# script: |
90-
# cd /root/bloggios-deployment-docker-files
91-
# set +e
92-
# docker-compose -f docker-compose-devsandbox.yml stop auth-provider-application
93-
# docker-compose -f docker-compose-devsandbox.yml stop auth-provider-social-application
94-
# docker rmi -f auth-provider-application:1.0
95-
# set -e
96-
#
97-
# - name: Generating Docker Image
98-
# uses: appleboy/ssh-action@master
99-
# with:
100-
# host: ${{ secrets.V4_HOST }}
101-
# username: ${{ secrets.V4_USERNAME }}
102-
# key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
103-
# port: 22
104-
# script: |
105-
# cd /root/microservices/auth-provider-application
106-
# chmod +x mvnw
107-
# ./mvnw clean package
108-
#
109-
# - name: Deploy Docker Image
110-
# uses: appleboy/ssh-action@master
111-
# with:
112-
# host: ${{ secrets.V4_HOST }}
113-
# username: ${{ secrets.V4_USERNAME }}
114-
# key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
115-
# port: 22
116-
# script: |
117-
# cd /root/bloggios-deployment-docker-files
118-
# docker-compose -f docker-compose-devsandbox.yml up -d auth-provider-application
119-
# docker-compose -f docker-compose-devsandbox.yml up -d auth-provider-social-application
120-
#
121-
# - name: Cleaning Targets
122-
# uses: appleboy/ssh-action@master
123-
# with:
124-
# host: ${{ secrets.V4_HOST }}
125-
# username: ${{ secrets.V4_USERNAME }}
126-
# key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
127-
# port: 22
128-
# script: |
129-
# cd /root/microservices/auth-provider-application
130-
# rm target -r
1+
name: bloggios-mail-service devsandbox
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Set up JDK 17
18+
uses: actions/setup-java@v3
19+
with:
20+
java-version: '17'
21+
distribution: 'temurin'
22+
server-id: github
23+
settings-path: ${{ github.workspace }}
24+
- uses: docker/login-action@v1
25+
with:
26+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
27+
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
28+
29+
- name: Build with Maven
30+
run: mvn clean install
31+
32+
- name: Cleaning Docker File
33+
uses: appleboy/ssh-action@master
34+
with:
35+
host: ${{ secrets.V4_HOST }}
36+
username: ${{ secrets.V4_USERNAME }}
37+
password: ${{ secrets.V4_VPS_PRIVATE_KEY }}
38+
port: 22
39+
script: |
40+
cd /root/bloggios-deployment-docker-files
41+
git stash
42+
git pull origin main
43+
44+
- name: Cleaning File
45+
uses: appleboy/ssh-action@master
46+
with:
47+
host: ${{ secrets.V4_HOST }}
48+
username: ${{ secrets.V4_USERNAME }}
49+
password: ${{ secrets.V4_VPS_PRIVATE_KEY }}
50+
port: 22
51+
script: |
52+
cd /root/microservices/bloggios-mail-service
53+
git stash
54+
git pull origin main
55+
56+
- name: Add Logback File
57+
uses: appleboy/ssh-action@master
58+
with:
59+
host: ${{ secrets.V4_HOST }}
60+
username: ${{ secrets.V4_USERNAME }}
61+
key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
62+
port: 22
63+
script: |
64+
rm /root/microservices/bloggios-mail-service/src/main/resources/mail-logback.xml
65+
cp /root/secrets/logback/mail-logback.xml /root/microservices/bloggios-mail-service/src/main/resources
66+
67+
- name: Stopping Container
68+
uses: appleboy/ssh-action@master
69+
with:
70+
host: ${{ secrets.V4_HOST }}
71+
username: ${{ secrets.V4_USERNAME }}
72+
key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
73+
port: 22
74+
script: |
75+
cd /root/bloggios-deployment-docker-files
76+
set +e
77+
docker-compose -f docker-compose-devsandbox.yml stop bloggios-mail-service
78+
docker rmi -f bloggios-mail-service:1.0
79+
set -e
80+
81+
- name: Generating Docker Image
82+
uses: appleboy/ssh-action@master
83+
with:
84+
host: ${{ secrets.V4_HOST }}
85+
username: ${{ secrets.V4_USERNAME }}
86+
key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
87+
port: 22
88+
script: |
89+
cd /root/microservices/bloggios-mail-service
90+
chmod +x mvnw
91+
./mvnw clean package
92+
93+
- name: Deploy Docker Image
94+
uses: appleboy/ssh-action@master
95+
with:
96+
host: ${{ secrets.V4_HOST }}
97+
username: ${{ secrets.V4_USERNAME }}
98+
key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
99+
port: 22
100+
script: |
101+
cd /root/bloggios-deployment-docker-files
102+
docker-compose -f docker-compose-devsandbox.yml up -d bloggios-mail-service
103+
104+
- name: Cleaning Targets
105+
uses: appleboy/ssh-action@master
106+
with:
107+
host: ${{ secrets.V4_HOST }}
108+
username: ${{ secrets.V4_USERNAME }}
109+
key: ${{ secrets.V4_VPS_PRIVATE_KEY }}
110+
port: 22
111+
script: |
112+
cd /root/microservices/bloggios-mail-service
113+
rm target -r

README.md

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,22 @@
2828

2929
## <a name="introduction">🤖 Introduction</a>
3030

31-
Built using Java 17 and Spring Boot, the mail is central to all notification functions using mail within a system, ensuring scalability and enhancing user experience through various features.
31+
Bloggios Mail Service, constructed with Java 17, Spring Boot, Java Mail, and Kafka, facilitates seamless email
32+
notifications in HTML format using Thymeleaf. This robust combination allows for efficient handling of email
33+
functionalities, ensuring reliable delivery of messages. Leveraging Kafka enables asynchronous processing, enhancing
34+
performance and scalability. With its integration of Thymeleaf, personalized and visually appealing email templates can
35+
be effortlessly created and dispatched. Bloggios Mail Service simplifies the process of sending dynamic email
36+
notifications, making it an indispensable tool for various applications and businesses.
3237

3338
## Key Features
3439

35-
- **Consuming Kafka Events**: Automatically sending mail as soon as receiving any event from Kafka.
36-
- **Sending HTML Mails**: Sending mails in more user friendly Interface with Thymeleaf.
37-
- **Persisting Mail Records**: Persisting each and every record of mails in Postgres Database
38-
- **OTP Management**: Handles the generation and validation of one-time passwords for 2FA or account recovery, adding an extra layer of security.
40+
- **HTML Email Support:** Enables sending of visually rich HTML-formatted emails.
41+
- **Thymeleaf Integration:** Utilizes Thymeleaf for easy creation of dynamic and personalized email templates.
42+
- **Asynchronous Processing with Kafka:** Enhances performance by leveraging Kafka for asynchronous message processing.
43+
- **Java Mail API:** Integrates Java Mail API for reliable and efficient email handling.
3944

40-
Join our newly active Discord community for support, bug reporting, and feature requests. Here, we strive to address every issue, and developers and testers can collaborate and assist each other effectively.
45+
Join our newly active Discord community for support, bug reporting, and feature requests. Here, we strive to address
46+
every issue, and developers and testers can collaborate and assist each other effectively.
4147

4248
<a href="https://discord.gg/sEerF8HuKC" target="_blank">
4349
<img src="https://img.shields.io/badge/-Join_our_Community-4258ff?style=for-the-badge&logoColor=white&logo=discord&color=5865F2" alt="Discord" />
@@ -48,13 +54,13 @@ Join our newly active Discord community for support, bug reporting, and feature
4854
- Java 17
4955
- Spring Boot
5056
- PostgreSQL
51-
- Elasticsearch
52-
- OAuth2.0
5357
- Kafka
5458

5559
## <a name="documentation">🔋 API Documentation</a>
5660

57-
To help you get started with our API and understand all its features and endpoints, we have created detailed documentation available on Postman. This documentation includes comprehensive information about each endpoint, including:
61+
To help you get started with our API and understand all its features and endpoints, we have created detailed
62+
documentation available on Postman. This documentation includes comprehensive information about each endpoint,
63+
including:
5864

5965
- **Endpoint URLs**: Specific paths to access various functionalities.
6066
- **HTTP Methods**: The method type (GET, POST, PUT, DELETE, etc.) for each endpoint.
@@ -66,12 +72,16 @@ To help you get started with our API and understand all its features and endpoin
6672
To access the documentation:
6773

6874
1. **Visit our Postman Documentation Page**: [Visit Documentation](https://www.postman.com/rohit-zip/workspace/bloggios)
69-
2. **Explore the Collection**: Navigate through the collection to find detailed descriptions and examples for each endpoint.
70-
3. **Run Requests Directly in Postman**: Use the "Run in Postman" button to directly import the collection into your Postman workspace for testing and exploration.
75+
2. **Explore the Collection**: Navigate through the collection to find detailed descriptions and examples for each
76+
endpoint.
77+
3. **Run Requests Directly in Postman**: Use the "Run in Postman" button to directly import the collection into your
78+
Postman workspace for testing and exploration.
7179

72-
By leveraging the Postman documentation, you can quickly integrate our API into your application and take full advantage of its capabilities.
80+
By leveraging the Postman documentation, you can quickly integrate our API into your application and take full advantage
81+
of its capabilities.
7382

74-
For any further assistance, feel free to contact our support team or refer to the additional resources section in the documentation.
83+
For any further assistance, feel free to contact our support team or refer to the additional resources section in the
84+
documentation.
7585

7686
## <a name="quick-start">🤸 Quick Start</a>
7787

@@ -101,6 +111,7 @@ We recommended Intellij Idea
101111

102112
Make sure you have Java 17 Installed in your system
103113
Please execute the below command to check installed version of Java in your system
114+
104115
```bash
105116
java --version
106117
```
@@ -110,6 +121,7 @@ java --version
110121
Navigate to `src/main/resources/application.yml` and add the required environment variables
111122

112123
If you are new at setting environment variables the please go through the below videos
124+
113125
- Intellij Idea [See Video](https://www.youtube.com/watch?v=jNOh4jQJG2U)
114126
- Eclipse or STS [See Video](https://www.youtube.com/watch?v=ypvGDkbp8Ac)
115127

@@ -119,6 +131,10 @@ POSTGRES_DATABASE -> Postgresql Database name
119131
POSTGRES_HOST -> Postgres Database Host
120132
POSTGRES_PASSWORD -> Postgres Database Password
121133
POSTGRES_USERNAME -> Postgresq Database Username
134+
MAIL_HOST -> Mail Host
135+
MAIL_PORT
136+
MAIL_USERNAME -> Username of Mail
137+
MAIL_PASSWORD -> Password of Mail
122138
```
123139

124140
Replace the placeholder values with your actual credentials
@@ -141,9 +157,11 @@ If you wish to contribute, you can,
141157
- Improve documentation.
142158
- Create content about Bloggios and share it with the world.
143159

144-
> Please read [`CONTRIBUTING`](CONTRIBUTING.md) for details on our [`CODE OF CONDUCT`](CODE_OF_CONDUCT.md), and the process for submitting pull requests to us.
160+
> Please read [`CONTRIBUTING`](CONTRIBUTING.md) for details on our [`CODE OF CONDUCT`](CODE_OF_CONDUCT.md), and the
161+
> process for submitting pull requests to us.
145162
146-
🆕 New to Open Source? 💡 Follow this [guide](https://opensource.guide/how-to-contribute/) to jumpstart your Open Source journey 🚀.
163+
🆕 New to Open Source? 💡 Follow this [guide](https://opensource.guide/how-to-contribute/) to jumpstart your Open Source
164+
journey 🚀.
147165

148166
## <a name="links">🔗 Links</a>
149167

@@ -156,7 +174,8 @@ If you wish to contribute, you can,
156174

157175
## <a name="support">🙏Support</a>
158176

159-
We all need support and motivation. `Bloggios` is not an exception. Please give this project repositories a ⭐️ to encourage and show that you liked it. Don't forget to leave a star ⭐️ before you move away.
177+
We all need support and motivation. `Bloggios` is not an exception. Please give this project repositories a ⭐️ to
178+
encourage and show that you liked it. Don't forget to leave a star ⭐️ before you move away.
160179

161180
If you found the app helpful, consider supporting us with a coffee.
162181

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<relativePath/> <!-- lookup parent from repository -->
1010
</parent>
1111
<groupId>com.bloggios.email</groupId>
12-
<artifactId>bloggios-email-service</artifactId>
12+
<artifactId>bloggios-mail-service</artifactId>
1313
<version>1.0</version>
14-
<name>bloggios-email-service</name>
15-
<description>bloggios-email-service</description>
14+
<name>bloggios-mail-service</name>
15+
<description>bloggios-mail-service</description>
1616
<properties>
1717
<java.version>17</java.version>
1818
<spring-cloud.version>2021.0.3</spring-cloud.version>

0 commit comments

Comments
 (0)