Skip to content

Commit 61b9e12

Browse files
authored
Merge pull request #1 from vairamuthuR/master
config(EJ2-10016): github update
2 parents 83f1262 + c220c17 commit 61b9e12

File tree

1,345 files changed

+641620
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,345 files changed

+641620
-0
lines changed

.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"env"
4+
]
5+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist/
2+
node_modules/
3+
src/router.config.ts
4+
src/common/samplelist.ts

Jenkinsfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!groovy
2+
3+
node('EJ2Samples') {
4+
try {
5+
deleteDir()
6+
7+
stage('Import') {
8+
git url: 'https://gitlab.syncfusion.com/essential-studio/ej2-groovy-scripts.git', branch: 'master', credentialsId: env.JENKINS_CREDENTIAL_ID
9+
shared = load 'src/shared.groovy'
10+
}
11+
12+
stage('Checkout') {
13+
checkout scm
14+
shared.getProjectDetails()
15+
shared.gitlabCommitStatus('running')
16+
}
17+
18+
stage('Install') {
19+
shared.install()
20+
}
21+
22+
stage('Build') {
23+
sh 'gulp build'
24+
}
25+
26+
stage('Publish') {
27+
shared.publish()
28+
}
29+
30+
shared.gitlabCommitStatus('success')
31+
32+
deleteDir()
33+
}
34+
catch(Exception e) {
35+
shared.throwError(e)
36+
deleteDir()
37+
}
38+
}

build/cdn.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
var config = {
4+
accessKeyId: process.env.AWS_ACCESS_KEY,
5+
secretAccessKey: process.env.AWS_SECRET_KEY,
6+
};
7+
var s3 = require('gulp-s3-upload')(config);
8+
var gulp = global.gulp = global.gulp || require('gulp');
9+
10+
var publish = function(dirName, ispublic, prefixName, done) {
11+
prefixName = prefixName.endsWith('/') ? prefixName : prefixName + '/';
12+
dirName = dirName.endsWith('/') ? dirName : dirName + '/';
13+
gulp.src(dirName + '**', { buffer: false })
14+
.pipe(s3({
15+
Bucket: ispublic ? process.env.AWS_PUBLIC_BUCKET : process.env.AWS_STAGING_BUCKET,
16+
ACL: 'public-read',
17+
uploadNewFilesOnly: false,
18+
ContentEncoding: 'gzip',
19+
keyTransform: function(relative_filename) {
20+
var new_name = prefixName + relative_filename;
21+
return new_name;
22+
}
23+
}, {
24+
maxRetries: 5,
25+
maxRedirects: 100,
26+
retryDelayOptions: {
27+
base: 1000
28+
}
29+
}))
30+
.on('end', function() {
31+
console.log('Published in CDN');
32+
done();
33+
})
34+
.on('error', function(e) {
35+
console.error('unable to sync: ', e.stack);
36+
done(e);
37+
});
38+
};
39+
exports.publish = publish;

build/samples.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
'use strict';
2+
3+
var gulp = global.gulp = global.gulp || require('gulp');
4+
var config = { publishSamples: ["./**/*", "!./node_modules/**", "!./node_modules/", "!./samples-repo/**", "!./samples-repo/", "!./spec/**", "!./spec/", "!./test-report/**", "!./test-report/", "!Jenkinsfile", "!./production/**", "!./production/", "!./.gitignore", "!./!(system.config).{js,json}", "!./gulpfile.js", "!./tempFile", "!./**/*.{d.ts,md,markdown,txt,xml,scss,cmd,docx,tar,gz,zip,tgz,log}"] };
5+
var gzip = require('gulp-gzip');
6+
var shelljs = require('shelljs');
7+
var cdn = require('./cdn.js');
8+
var fs = require('fs');
9+
10+
/**
11+
* publish sample browser
12+
*/
13+
14+
function getReleaseVersion(version) {
15+
version = version.split('.');
16+
version.splice(2, 1);
17+
return version.join('.');
18+
}
19+
20+
gulp.task('publish-samples', function(done) {
21+
var isMaster = process.env.BRANCH_NAME === 'master';
22+
var isHotFix = /^((release\/|hotfix\/))/g.test(process.env.BRANCH_NAME);
23+
var hotfixVersion = getReleaseVersion(process.env.BRANCH_NAME.split(/hotfix\/|release\//)[1].replace(/(_SP1|_SP2)/g,''));
24+
var demoPath = isMaster ? './production/vue/demos' : './development/vue/demos';
25+
demoPath = isHotFix ? './hotfix/' + hotfixVersion + '/vue/demos' : demoPath;
26+
shelljs.mkdir('-p', demoPath);
27+
config.publishSamples.push('!' + demoPath + '/**', '!' + demoPath);
28+
var prefixName = demoPath.split('./')[1];
29+
var content = '<h1> 404 - Not Found </h1>';
30+
fs.writeFileSync('./error.html', content);
31+
if (fs.existsSync('./index.html') && !isHotFix) {
32+
var filecontent = fs.readFileSync('./index.html', 'utf8');
33+
var embedLink = 'https://syncfusion.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e-T' +
34+
'/tu9duo/b/c/7ebd7d8b8f8cafb14c7b0966803e5701/_/download/batch/' +
35+
'com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/' +
36+
'com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?locale=en-US&collectorId=b1db4791';
37+
var embedScript = '<script type="text/javascript" src="' + embedLink + '"></script>\n';
38+
filecontent = filecontent.replace('</head>', embedScript + '</head>');
39+
fs.writeFileSync('./index.html', filecontent);
40+
}
41+
if (fs.existsSync('./index.html') && isHotFix) {
42+
var indexcontent = fs.readFileSync('./index.html', 'utf8');
43+
var googleAnalytics = fs.readFileSync(__dirname + '/../utils/google-analytics', 'utf8');
44+
indexcontent = indexcontent.replace('</body>', googleAnalytics + '\n</body>');
45+
fs.writeFileSync('./index.html', indexcontent);
46+
}
47+
gulp.src(config.publishSamples)
48+
.pipe(gzip({ append: false }))
49+
.pipe(gulp.dest(demoPath))
50+
.on('end', function() {
51+
cdn.publish(demoPath, false, prefixName, done);
52+
})
53+
.on('error', function(e) {
54+
done(e);
55+
});
56+
});

config.json

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
{
2+
"tslint": [
3+
"./src/**/*.ts",
4+
"!./src/**/*.d.ts",
5+
"!./src/common/sampleList.ts",
6+
"!./src/maps/MapData/*.ts",
7+
"!./src/common/locale-string.ts",
8+
"./spec/**/*.ts"
9+
],
10+
"htmllint": [
11+
"./src/**/*.html"
12+
],
13+
"json": [
14+
"./**/*.json"
15+
],
16+
"styles": [
17+
"./styles/**/*.scss"
18+
],
19+
"sasslint": [
20+
"./styles/**/*.scss"
21+
],
22+
"samplejson": [
23+
"./src/**/sample.json"
24+
],
25+
"watchTs": [
26+
"./src/**/*.ts",
27+
"./spec/**/*.ts"
28+
],
29+
"ts": [
30+
"./src/**/*.ts",
31+
"./spec/**/*.ts"
32+
],
33+
"dedupe": [
34+
"./src/**/*.ts"
35+
],
36+
"styleDependency": [
37+
"ej2"
38+
],
39+
"github": [
40+
"./src/**/*.{html,ts,json}",
41+
"./styles{,/**}",
42+
"./src/**/images{,/**}",
43+
"./src/common/lib{,/**}",
44+
"./src/common/cldr-data{,/**}",
45+
"./src/showcase{,/**}",
46+
"!./src/showcase/**/!(webpack.config)*.{js,json}",
47+
"!./styles/**/!(index)*.css",
48+
"./spec/**/*.ts",
49+
"./*.html",
50+
"./favicon.ico",
51+
"karma.conf.js",
52+
"package.json",
53+
"test-main.js",
54+
"tsconfig.json",
55+
"webpack.config.js",
56+
"!./googlec03dd4bc003151bc.html",
57+
"license"
58+
],
59+
"cssComponent": [
60+
"card"
61+
],
62+
"customNames": [
63+
"heatmap",
64+
"datasource",
65+
"tooltip",
66+
"drilldown",
67+
"smithchart",
68+
"sparkline",
69+
"econmics",
70+
"treemap",
71+
"gauge",
72+
"ajax",
73+
"api",
74+
"custom",
75+
"code",
76+
"blog",
77+
"embedly",
78+
"inline",
79+
"toolbar",
80+
"popup",
81+
"swipeable",
82+
"image",
83+
"checkbox",
84+
"json",
85+
"bpmn",
86+
"fishbone",
87+
"venn",
88+
"newsData",
89+
"virtualization",
90+
"html",
91+
"listview",
92+
"maskedtextbox",
93+
"numerictextbox",
94+
"treeview"
95+
]
96+
}

favicon.ico

6.42 KB
Binary file not shown.

0 commit comments

Comments
 (0)