diff --git a/Jenkinsfile b/Jenkinsfile index 320f9ae..9a5a622 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,27 +1,31 @@ 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') } - } - - 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' - // } + sh "git checkout ${env.BRANCH_NAME}" + sh "git checkout -- ." - 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' + 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' } - -} \ No newline at end of file +} + +private boolean lastCommitIsBumpCommit() { + lastCommit = sh([script: 'git log -1', returnStdout: true]) + if (lastCommit.contains("Author: jenkins")) { + return true + } else { + return false + } +} diff --git a/angular.json b/angular.json index 7bbfa77..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", @@ -17,7 +19,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { - "outputPath": "/var/www/fashion-logica", + "outputPath": "/var/www/html/lk.crm4retail.ru/fashion-logica", "baseHref": "/", "index": "src/index.html", "main": "src/main.ts", diff --git a/src/app/app.module.ts b/src/app/app.module.ts index b1e15c8..0f44a05 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,7 +48,8 @@ import { MessagingService } from './services/messaging.service'; OrderInfoComponent, FooterButtonsComponent, UserDataComponent, - RefSystemComponent + RefSystemComponent, + NotFoundComponent ], imports: [ BrowserModule, @@ -56,7 +58,8 @@ import { MessagingService } from './services/messaging.service'; { path: '**', component: MainComponent - } + }, + // { path: '**', component: NotFoundComponent } ]), InputMaskModule, ProgressSpinnerModule, 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..65401b6 --- /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..94e3953 --- /dev/null +++ b/src/app/pages/not-found/not-found.component.ts @@ -0,0 +1,20 @@ +import { Component, OnInit } from '@angular/core'; +import { Router } from '@angular/router'; + +@Component({ + selector: 'app-not-found', + templateUrl: './not-found.component.html', + styleUrls: ['./not-found.component.scss'] +}) +export class NotFoundComponent implements OnInit { + + constructor(private router: Router) { } + + ngOnInit(): void { + } + + routeHome() { + this.router.navigate(['/']); + } + +} 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/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 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" }