Skip to content

Commit af1ca2d

Browse files
authored
Merge pull request #45 from open-template-hub/develop
Release/mail server template
2 parents 221166e + 1114f9e commit af1ca2d

File tree

6 files changed

+46
-4
lines changed

6 files changed

+46
-4
lines changed

.github/workflows/on-version-update.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }}
4242
ref: develop
4343

44-
- name: Hard Reset Master
44+
- name: Hard Reset Develop from Master
4545
run: |
4646
git fetch origin master:master
4747
git reset --hard master
@@ -53,4 +53,4 @@ jobs:
5353
branch: workflow/version-update
5454
delete-branch: true
5555
base: develop
56-
title: 'Version Update PR'
56+
title: 'workflow: Version Update PR'
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: PR Open To Demos Workflows
2+
3+
on:
4+
pull_request:
5+
types: [ opened ]
6+
branches:
7+
- demo/*
8+
9+
jobs:
10+
reset-demo-from-develop:
11+
name: "Reset Demo From Develop"
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Repo
15+
uses: actions/checkout@v2
16+
with:
17+
token: ${{ secrets.MASTER_BRANCH_ACCESS_TOKEN }}
18+
ref: ${{ github.event.pull_request.base.ref }}
19+
- name: Hard Reset Demo From Develop
20+
run: |
21+
git fetch origin develop:develop
22+
git reset --hard develop
23+
git push -f

NPM-README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Available server types are:
2121
* [Auth Server](https://github.com/open-template-hub/auth-server-nodejs-template)
2222
* [File Storage Server](https://github.com/open-template-hub/file-storage-server-template)
2323
* [Analytics Server](https://github.com/open-template-hub/analytics-server-template)
24+
* [Mail Server](https://github.com/open-template-hub/mail-server-template)
2425

2526
## About the NPM Package
2627

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Available server types are:
2727
* [Auth Server](https://github.com/open-template-hub/auth-server-nodejs-template)
2828
* [File Storage Server](https://github.com/open-template-hub/file-storage-server-template)
2929
* [Analytics Server](https://github.com/open-template-hub/analytics-server-template)
30+
* [Mail Server](https://github.com/open-template-hub/mail-server-template)
3031

3132
## About the NPM Package
3233

src/constant.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export const TemplateType = {
44
BasicInfoServer: '3',
55
FileStorageServer: '4',
66
AnalyticsServer: '5',
7+
MailServer: '6',
78
};
89

910
export const TEMPLATE_HUB_URL = 'https://github.com/open-template-hub';
@@ -16,6 +17,7 @@ export const ProjectName = {
1617
BasicInfoServer: 'basic-info-server-template',
1718
FileStorageServer: 'file-storage-server-template',
1819
AnalyticsServer: 'analytics-server-template',
20+
MailServer: 'mail-server-template',
1921
};
2022

2123
export const PackageName = {
@@ -24,4 +26,5 @@ export const PackageName = {
2426
BasicInfoServer: 'basic-info-server-template',
2527
FileStorageServer: 'file-storage-server-template',
2628
AnalyticsServer: 'analytics-server-template',
29+
MailServer: 'mail-server-template',
2730
};

src/index.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ const QUESTIONS = [
2525
' 3) Basic Info Server \n' +
2626
' 4) File Storage Server \n' +
2727
' 5) Analytics Server \n' +
28+
' 6) MİL Server \n' +
2829
' Please enter a server type you want to generate: ',
2930
when: () => !yargs.argv[ 'template' ],
3031
validate: ( input: string ) => {
31-
if ( /^[1 | 2 | 3 | 4 | 5]$/.test( input ) ) return true;
32+
if ( /^[1 | 2 | 3 | 4 | 5 | 6]$/.test( input ) ) return true;
3233
else
33-
return 'Please enter correct server type. Server type can be 1, 2, 3, 4 and 5.';
34+
return 'Please enter correct server type. Server type can be 1, 2, 3, 4, 5 and 6.';
3435
},
3536
},
3637
{
@@ -133,6 +134,10 @@ const updateProjectName = (
133134
repoConfig.projectName = ProjectName.AnalyticsServer;
134135
repoConfig.packageName = PackageName.AnalyticsServer;
135136
break;
137+
case TemplateType.MailServer:
138+
repoConfig.projectName = ProjectName.MailServer;
139+
repoConfig.packageName = PackageName.MailServer;
140+
break;
136141
}
137142

138143
let oldPath = path.join( targetPath, repoConfig.projectName );
@@ -215,6 +220,15 @@ const cloneTemplate = ( targetPath: string, templateType: string ) => {
215220
'/' +
216221
ProjectName.AnalyticsServer;
217222
break;
223+
case TemplateType.MailServer:
224+
cmd =
225+
clone +
226+
BRANCH_NAME +
227+
' ' +
228+
TEMPLATE_HUB_URL +
229+
'/' +
230+
ProjectName.MailServer;
231+
break;
218232
}
219233
console.log( 'command: ', cmd );
220234
const result = shell.exec( cmd );

0 commit comments

Comments
 (0)