From 8b6af5fa2150292888be66509b0ce939ba267469 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:25:16 +0400 Subject: [PATCH 01/14] build commit --- Jenkinsfile | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 320f9ae..2caa9ea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,27 +1,21 @@ env.HL_BUILD_MODE = "jenkins" -node('Rubidium'){ +node('Lithium'){ stage('get new version to repo') { - dir('/opt/usersite-build'){ - checkout([$class: 'GitSCM', branches: [[name: '*/fashion-logica']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'jenkins_all', url: 'https://git.hlcompany.ru/git/usersite.git']]]) + checkout scm + if (lastCommitIsBumpCommit()) { + currentBuild.result = 'ABORTED' + error('Последний коммит - результат сборки jenkins') } + bat "git checkout ${env.BRANCH_NAME}" + bat "git checkout -- ." + bat "git pull" + bat "git submodule update --init --recursive" + bat "git submodule update --remote --merge" } - - stage('build project') { - // sh label: '', script: 'systemctl stop lkcrm4retail' - // dir('/opt/SynthVisionBox/node'){ - // sh label: '', script: 'npm install --only=prod' - // sh label: '', script: 'node db_updater.js' - // } - - dir('/opt/usersite-build'){ - // sh label: '', script: 'npm i' - // sh label: '', script: 'npm run build' - sh label: '', script: 'ng build' - } - - // sh label: '', script: 'systemctl start lkcrm4retail' + stage("build and publish"){ + sh label: '', script: 'npm i' + sh label: '', script: 'npm run build' } - } \ No newline at end of file From 7a490e4599922dd1dc35f045217797d7001d669c Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:25:53 +0400 Subject: [PATCH 02/14] build commit --- angular.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular.json b/angular.json index 7bbfa77..7ccc886 100644 --- a/angular.json +++ b/angular.json @@ -17,7 +17,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "/var/www/fashion-logica", + "outputPath": "/var/www/html/lk.crm4retail.ru", "baseHref": "/", "index": "src/index.html", "main": "src/main.ts", From 06e0b8efe1679a80131a6157464f325d884f3fb1 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:27:33 +0400 Subject: [PATCH 03/14] rebuild commit --- Jenkinsfile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2caa9ea..cb6d1c2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,4 +18,17 @@ node('Lithium'){ sh label: '', script: 'npm i' sh label: '', script: 'npm run build' } -} \ No newline at end of file +} +def cmd(command) { + // при запуске Jenkins не в режиме UTF-8 нужно написать chcp 1251 вместо chcp 65001 + if (isUnix()) { sh "${command}" } else { bat "chcp 65001\n${command}"} +} + +private boolean lastCommitIsBumpCommit() { + lastCommit = bat([script: 'git log -1', returnStdout: true]) + if (lastCommit.contains("Author: jenkins")) { + return true + } else { + return false + } +} From ba71eee97ff627e00f78d32aa0565175cf35e491 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:28:29 +0400 Subject: [PATCH 04/14] rebuild commit --- Jenkinsfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index cb6d1c2..021bafe 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,11 +8,11 @@ node('Lithium'){ currentBuild.result = 'ABORTED' error('Последний коммит - результат сборки jenkins') } - bat "git checkout ${env.BRANCH_NAME}" - bat "git checkout -- ." - bat "git pull" - bat "git submodule update --init --recursive" - bat "git submodule update --remote --merge" + cmd "git checkout ${env.BRANCH_NAME}" + cmd "git checkout -- ." + cmd "git pull" + cmd "git submodule update --init --recursive" + cmd "git submodule update --remote --merge" } stage("build and publish"){ sh label: '', script: 'npm i' From 615f7086004032d97848c32c3c2009538abcb56e Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:29:32 +0400 Subject: [PATCH 05/14] rebuild commit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 021bafe..0fc020c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ def cmd(command) { } private boolean lastCommitIsBumpCommit() { - lastCommit = bat([script: 'git log -1', returnStdout: true]) + lastCommit = cmd([script: 'git log -1', returnStdout: true]) if (lastCommit.contains("Author: jenkins")) { return true } else { From 5b9be577e76634ebe9572462755bfd2ab6347b81 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:34:31 +0400 Subject: [PATCH 06/14] rebuild commit --- Jenkinsfile | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0fc020c..6c72135 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -8,24 +8,20 @@ node('Lithium'){ currentBuild.result = 'ABORTED' error('Последний коммит - результат сборки jenkins') } - cmd "git checkout ${env.BRANCH_NAME}" - cmd "git checkout -- ." - cmd "git pull" - cmd "git submodule update --init --recursive" - cmd "git submodule update --remote --merge" + sh "git checkout ${env.BRANCH_NAME}" + sh "git checkout -- ." + sh "git pull" + sh "git submodule update --init --recursive" + sh "git submodule update --remote --merge" } stage("build and publish"){ sh label: '', script: 'npm i' sh label: '', script: 'npm run build' } } -def cmd(command) { - // при запуске Jenkins не в режиме UTF-8 нужно написать chcp 1251 вместо chcp 65001 - if (isUnix()) { sh "${command}" } else { bat "chcp 65001\n${command}"} -} private boolean lastCommitIsBumpCommit() { - lastCommit = cmd([script: 'git log -1', returnStdout: true]) + lastCommit = sh([script: 'git log -1', returnStdout: true]) if (lastCommit.contains("Author: jenkins")) { return true } else { From 988a05e94d9ce561c556775d065e130ddcf4cb9f Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:35:27 +0400 Subject: [PATCH 07/14] rebuild commit --- Jenkinsfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 6c72135..9ad1162 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,9 +10,10 @@ node('Lithium'){ } sh "git checkout ${env.BRANCH_NAME}" sh "git checkout -- ." - sh "git pull" - sh "git submodule update --init --recursive" - sh "git submodule update --remote --merge" + + //sh "git pull" + //sh "git submodule update --init --recursive" + //sh "git submodule update --remote --merge" } stage("build and publish"){ sh label: '', script: 'npm i' From ff0f8d6fad02e7c73af5edae0409dbddddcbad84 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:54:07 +0400 Subject: [PATCH 08/14] rebuild --- angular.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/angular.json b/angular.json index 7ccc886..5e88681 100644 --- a/angular.json +++ b/angular.json @@ -17,7 +17,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "/var/www/html/lk.crm4retail.ru", + "outputPath": "/var/www/html/lk.crm4retail.ru/fashion-logica", "baseHref": "/", "index": "src/index.html", "main": "src/main.ts", From 34080a0ee0542581fba765e8898505b0f0a5bac1 Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 14:58:06 +0400 Subject: [PATCH 09/14] build commit --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9ad1162..9a5a622 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -11,7 +11,7 @@ node('Lithium'){ sh "git checkout ${env.BRANCH_NAME}" sh "git checkout -- ." - //sh "git pull" + sh "git pull" //sh "git submodule update --init --recursive" //sh "git submodule update --remote --merge" } From 9b64746c2ec94efe4ec91f9b86c4bd1016a27b7f Mon Sep 17 00:00:00 2001 From: pumpurumer Date: Wed, 28 Sep 2022 15:07:39 +0400 Subject: [PATCH 10/14] test commit --- angular.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/angular.json b/angular.json index 5e88681..ea8448c 100644 --- a/angular.json +++ b/angular.json @@ -1,4 +1,5 @@ { + "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "newProjectRoot": "projects", @@ -10,6 +11,7 @@ "style": "scss" } }, + "root": "", "sourceRoot": "src", "prefix": "app", From bb455b2c458e5232aac09023d884456fa72df746 Mon Sep 17 00:00:00 2001 From: Kataev Denis Date: Thu, 29 Sep 2022 10:09:15 +0400 Subject: [PATCH 11/14] =?UTF-8?q?dev=20#12401=20=D0=A1=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=86=D0=B0=20404=20=D0=B8=20=D0=BF=D1=80=D0=B0?= =?UTF-8?q?=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 9 ++++-- .../ref-system/ref-system.component.ts | 2 +- .../pages/not-found/not-found.component.html | 8 ++++++ .../pages/not-found/not-found.component.scss | 28 +++++++++++++++++++ .../not-found/not-found.component.spec.ts | 23 +++++++++++++++ .../pages/not-found/not-found.component.ts | 15 ++++++++++ src/index.html | 2 +- 7 files changed, 82 insertions(+), 5 deletions(-) create mode 100644 src/app/pages/not-found/not-found.component.html create mode 100644 src/app/pages/not-found/not-found.component.scss create mode 100644 src/app/pages/not-found/not-found.component.spec.ts create mode 100644 src/app/pages/not-found/not-found.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index b1e15c8..9a1f050 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -32,6 +32,7 @@ import { QRCodeModule } from 'angularx-qrcode'; import { ShareButtonsModule } from 'ngx-sharebuttons/buttons'; import { ShareIconsModule } from 'ngx-sharebuttons/icons'; import { MessagingService } from './services/messaging.service'; +import { NotFoundComponent } from './pages/not-found/not-found.component'; @NgModule({ declarations: [ @@ -47,16 +48,18 @@ import { MessagingService } from './services/messaging.service'; OrderInfoComponent, FooterButtonsComponent, UserDataComponent, - RefSystemComponent + RefSystemComponent, + NotFoundComponent ], imports: [ BrowserModule, AppRoutingModule, RouterModule.forRoot([ { - path: '**', + path: '', component: MainComponent - } + }, + { path: '**', component: NotFoundComponent } ]), InputMaskModule, ProgressSpinnerModule, diff --git a/src/app/pages/account/ref-system/ref-system.component.ts b/src/app/pages/account/ref-system/ref-system.component.ts index 9ac9d31..dd7d489 100644 --- a/src/app/pages/account/ref-system/ref-system.component.ts +++ b/src/app/pages/account/ref-system/ref-system.component.ts @@ -35,7 +35,7 @@ export class RefSystemComponent implements OnInit { if (navigator.share) { navigator.share({ title: document.title, - text: "Fashion Logica", + text: "Fashionlogica", url: this.refUrl }) .then(() => console.log('Successful share')) diff --git a/src/app/pages/not-found/not-found.component.html b/src/app/pages/not-found/not-found.component.html new file mode 100644 index 0000000..5ea0511 --- /dev/null +++ b/src/app/pages/not-found/not-found.component.html @@ -0,0 +1,8 @@ +
+ +
+

404

+

Упс, что-то пошло не так!

+ +
+
diff --git a/src/app/pages/not-found/not-found.component.scss b/src/app/pages/not-found/not-found.component.scss new file mode 100644 index 0000000..0f45331 --- /dev/null +++ b/src/app/pages/not-found/not-found.component.scss @@ -0,0 +1,28 @@ +:host { + .not-found-page { + &__container { + text-align: center; + margin-top: 32px; + h1 { + font-size: 108px; + font-weight: 600; + color: #09467f; + } + p { + margin: 16px 0; + font-size: 14px; + } + button { + background-color: #09467f; + color: #fff; + border-radius: 8px; + display: flex; + justify-content: center; + align-items: center; + padding: 12px; + margin: 0 auto; + border: 0; + } + } + } +} diff --git a/src/app/pages/not-found/not-found.component.spec.ts b/src/app/pages/not-found/not-found.component.spec.ts new file mode 100644 index 0000000..4ab46fe --- /dev/null +++ b/src/app/pages/not-found/not-found.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { NotFoundComponent } from './not-found.component'; + +describe('NotFoundComponent', () => { + let component: NotFoundComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ NotFoundComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(NotFoundComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/pages/not-found/not-found.component.ts b/src/app/pages/not-found/not-found.component.ts new file mode 100644 index 0000000..7cb4124 --- /dev/null +++ b/src/app/pages/not-found/not-found.component.ts @@ -0,0 +1,15 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'app-not-found', + templateUrl: './not-found.component.html', + styleUrls: ['./not-found.component.scss'] +}) +export class NotFoundComponent implements OnInit { + + constructor() { } + + ngOnInit(): void { + } + +} diff --git a/src/index.html b/src/index.html index 1c60836..c890b74 100644 --- a/src/index.html +++ b/src/index.html @@ -2,7 +2,7 @@ - Fashion logica + Fashionlogica From 86eaca953ea78bedfc3be73a38f83d7876ea4e09 Mon Sep 17 00:00:00 2001 From: Kataev Denis Date: Thu, 29 Sep 2022 10:15:21 +0400 Subject: [PATCH 12/14] =?UTF-8?q?dev=20#12401=20=D0=A1=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=86=D0=B0=20404=20=D0=B4=D0=BE=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/pages/not-found/not-found.component.html | 2 +- src/app/pages/not-found/not-found.component.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/pages/not-found/not-found.component.html b/src/app/pages/not-found/not-found.component.html index 5ea0511..65401b6 100644 --- a/src/app/pages/not-found/not-found.component.html +++ b/src/app/pages/not-found/not-found.component.html @@ -3,6 +3,6 @@

404

Упс, что-то пошло не так!

- +
diff --git a/src/app/pages/not-found/not-found.component.ts b/src/app/pages/not-found/not-found.component.ts index 7cb4124..94e3953 100644 --- a/src/app/pages/not-found/not-found.component.ts +++ b/src/app/pages/not-found/not-found.component.ts @@ -1,4 +1,5 @@ import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; @Component({ selector: 'app-not-found', @@ -7,9 +8,13 @@ import { Component, OnInit } from '@angular/core'; }) export class NotFoundComponent implements OnInit { - constructor() { } + constructor(private router: Router) { } ngOnInit(): void { } + routeHome() { + this.router.navigate(['/']); + } + } From 914b1ec5edcfc6183434e15d1ac54720cc6f43f2 Mon Sep 17 00:00:00 2001 From: Kataev Denis Date: Thu, 29 Sep 2022 10:32:06 +0400 Subject: [PATCH 13/14] =?UTF-8?q?dev=20#12401=20=D0=B2=D0=B5=D1=80=D0=BD?= =?UTF-8?q?=D1=83=D0=BB=20=D0=BA=D0=B0=D0=BA=20=D0=B1=D1=8B=D0=BB=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/app.module.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9a1f050..0f44a05 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -56,10 +56,10 @@ import { NotFoundComponent } from './pages/not-found/not-found.component'; AppRoutingModule, RouterModule.forRoot([ { - path: '', + path: '**', component: MainComponent }, - { path: '**', component: NotFoundComponent } + // { path: '**', component: NotFoundComponent } ]), InputMaskModule, ProgressSpinnerModule, From 134ee3f59d6060e104b115a3b650d0463cbec018 Mon Sep 17 00:00:00 2001 From: Kataev Denis Date: Thu, 29 Sep 2022 18:41:33 +0400 Subject: [PATCH 14/14] =?UTF-8?q?dev=20#12425=20=D0=9F=D0=BE=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=8F=D0=BB=20=D1=83=D1=87=D0=B5=D1=82=D0=BD=D1=8B=D0=B5?= =?UTF-8?q?=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/environments/environment.prod.ts | 13 +++++++------ src/environments/environment.ts | 13 +++++++------ src/firebase-messaging-sw.js | 13 +++++++------ src/manifest.webmanifest | 2 +- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 559e3dc..ccfb9dc 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -9,12 +9,13 @@ export const environment = { systemId: 'g6zyv8tj53w28ov7cl', defaultUrl: 'https://fashionlogica.lk.crm4retail.ru', firebase: { - apiKey: "AIzaSyCujHg9GtN8Uxi-JcCN8zggvXlfNQRKc04", - authDomain: "push-notification-test2-56dac.firebaseapp.com", - projectId: "push-notification-test2-56dac", - storageBucket: "push-notification-test2-56dac.appspot.com", - messagingSenderId: "1004369687552", - appId: "1:1004369687552:web:a6cc20625e05520a37d4e5" + apiKey: "AIzaSyCnKvln5itnrBj62POCPHxshAN_Vmd0zds", + authDomain: "fashionlogicanotification.firebaseapp.com", + projectId: "fashionlogicanotification", + storageBucket: "fashionlogicanotification.appspot.com", + messagingSenderId: "99855572145", + appId: "1:99855572145:web:7548c189d61b3bcc92d690", + measurementId: "G-RQF97ZK7R1" }, version: packageJson.version, } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 25af6dd..7802e04 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -9,12 +9,13 @@ export const environment = { systemId: 'g6zyv8tj53w28ov7cl', defaultUrl: 'http://192.168.0.179:4200', firebase: { - apiKey: "AIzaSyCujHg9GtN8Uxi-JcCN8zggvXlfNQRKc04", - authDomain: "push-notification-test2-56dac.firebaseapp.com", - projectId: "push-notification-test2-56dac", - storageBucket: "push-notification-test2-56dac.appspot.com", - messagingSenderId: "1004369687552", - appId: "1:1004369687552:web:a6cc20625e05520a37d4e5" + apiKey: 'AIzaSyCnKvln5itnrBj62POCPHxshAN_Vmd0zds', + authDomain: 'fashionlogicanotification.firebaseapp.com', + projectId: 'fashionlogicanotification', + storageBucket: 'fashionlogicanotification.appspot.com', + messagingSenderId: '99855572145', + appId: '1:99855572145:web:7548c189d61b3bcc92d690', + measurementId: 'G-RQF97ZK7R1', }, version: packageJson.version, }; diff --git a/src/firebase-messaging-sw.js b/src/firebase-messaging-sw.js index 9427ec6..29cfaf4 100644 --- a/src/firebase-messaging-sw.js +++ b/src/firebase-messaging-sw.js @@ -2,12 +2,13 @@ importScripts('https://www.gstatic.com/firebasejs/7.4.1/firebase-app.js'); importScripts('https://www.gstatic.com/firebasejs/7.4.1/firebase-messaging.js'); firebase.initializeApp({ - apiKey: "AIzaSyCujHg9GtN8Uxi-JcCN8zggvXlfNQRKc04", - authDomain: "push-notification-test2-56dac.firebaseapp.com", - projectId: "push-notification-test2-56dac", - storageBucket: "push-notification-test2-56dac.appspot.com", - messagingSenderId: "1004369687552", - appId: "1:1004369687552:web:a6cc20625e05520a37d4e5" + apiKey: "AIzaSyCnKvln5itnrBj62POCPHxshAN_Vmd0zds", + authDomain: "fashionlogicanotification.firebaseapp.com", + projectId: "fashionlogicanotification", + storageBucket: "fashionlogicanotification.appspot.com", + messagingSenderId: "99855572145", + appId: "1:99855572145:web:7548c189d61b3bcc92d690", + measurementId: "G-RQF97ZK7R1" }); const messaging = firebase.messaging(); \ No newline at end of file diff --git a/src/manifest.webmanifest b/src/manifest.webmanifest index 0e23e2f..651c69c 100644 --- a/src/manifest.webmanifest +++ b/src/manifest.webmanifest @@ -56,5 +56,5 @@ "purpose": "maskable any" } ], - "gcm_sender_id": "1004369687552" + "gcm_sender_id": "99855572145" }