...
 
Commits (5)
......@@ -81,6 +81,8 @@ e2e:chrome:
build:review:
stage: build
before_script:
- sed -ri "s|\"VERSION\"|\"$CI_COMMIT_SHA\"|" src/environments/environment.prod.ts
script:
- npm ci && npm install -g gulp-cli
- npm run postinstall
......@@ -97,6 +99,8 @@ build:review:
build:production:en:
stage: build
before_script:
- sed -ri "s|\"VERSION\"|\"$CI_COMMIT_SHA\"|" src/environments/environment.prod.ts
script:
- npm ci && npm install -g gulp-cli
- npm run postinstall
......@@ -113,6 +117,8 @@ build:production:en:
build:production:i18n:
stage: build
before_script:
- sed -ri "s|\"VERSION\"|\"$CI_COMMIT_SHA\"|" src/environments/environment.prod.ts
script:
- npm ci && npm install -g gulp-cli
- npm run postinstall
......@@ -127,6 +133,17 @@ build:production:i18n:
- master
- test/gitlab-ci
.sentry_prepare: &sentry_prepare
stage: prepare
image: getsentry/sentry-cli
script:
- echo "Create a new release $CI_COMMIT_SHA"
- sentry-cli releases new $CI_COMMIT_SHA
- sentry-cli releases set-commits --auto $CI_COMMIT_SHA
- sentry-cli releases files $CI_COMMIT_SHA upload-sourcemaps $CI_PROJECT_DIR/dist/en -x .js -x .map --validate --verbose --rewrite --strip-common-prefix
- sentry-cli releases finalize $CI_COMMIT_SHA
- echo "Finalized release for $CI_COMMIT_SHA"
prepare:review:
stage: prepare
image: minds/ci:latest
......@@ -141,6 +158,15 @@ prepare:review:
- master
- test/gitlab-ci
prepare:review:sentry:
<<: *sentry_prepare
except:
refs:
- master
- test/gitlab-ci
dependencies:
- build:review
prepare:production:
stage: prepare
image: minds/ci:latest
......@@ -156,6 +182,16 @@ prepare:production:
- build:production:en
- build:production:i18n
prepare:production:sentry:
<<: *sentry_prepare
only:
refs:
- master
- test/gitlab-ci
dependencies:
- build:production:en
- build:production:i18n
review:start:
stage: review
image: minds/helm-eks:latest
......@@ -172,6 +208,8 @@ review:start:
--wait \
$CI_BUILD_REF_SLUG \
./helm-charts/minds"
# Update sentry
- sentry-cli releases deploys $CI_COMMIT_SHA new -e review-$CI_COMMIT_REF_SLUG
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$CI_BUILD_REF_SLUG.$KUBE_INGRESS_BASE_DOMAIN
......@@ -214,6 +252,8 @@ staging:fpm:
- docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
- aws ecs update-service --service=$ECS_APP_STAGING_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
## Update sentry
- sentry-cli releases deploys $CI_COMMIT_SHA new -e $IMAGE_LABEL
only:
refs:
- master
......@@ -240,6 +280,8 @@ deploy:canary:
- docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
- aws ecs update-service --service=$ECS_APP_CANARY_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
## Update sentry
- sentry-cli releases deploys $CI_COMMIT_SHA new -e $IMAGE_LABEL
only:
refs:
- master
......@@ -266,6 +308,8 @@ deploy:production:
- docker push $ECR_REPOSITORY_URL:$IMAGE_LABEL
## Deploy the new container in rolling restart
- aws ecs update-service --service=$ECS_APP_PRODUCTION_SERVICE --force-new-deployment --region us-east-1 --cluster=$ECS_CLUSTER
## Update sentry
- sentry-cli releases deploys $CI_COMMIT_SHA new -e $IMAGE_LABEL
only:
refs:
- master
......@@ -278,3 +322,4 @@ deploy:production:
url: https://www.minds.com
when: delayed
start_in: 2 hours # reduce? can always be deployed manually earlier too
......@@ -36,7 +36,11 @@
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"sourceMap": {
"hidden": true,
"scripts": true,
"styles": true
},
"extractCss": true,
"namedChunks": false,
"aot": true,
......
#!/bin/sh
export NODE_OPTIONS="--max-old-space-size=3584"
ng build --prod --vendor-chunk --output-path="$1/en/" --deploy-url="$2/en/" --build-optimizer=false --source-map=false
ng build --prod --vendor-chunk --output-path="$1/en/" --deploy-url="$2/en/" --build-optimizer=false
{
"projectId": "qrjqcv",
"requestTimeout": 3600000,
"responseTimeout": 3600000,
"pageLoadTimeout": 3600000
"projectId": "qrjqcv"
}
import 'cypress-file-upload';
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
......@@ -48,21 +50,13 @@ Cypress.Commands.add('preserveCookies', () => {
});
Cypress.Commands.add('uploadFile', (selector, fileName, type = '') => {
cy.get(selector).then((subject) => {
cy.fixture(fileName, 'base64').then((content) => {
const el = subject[0];
const blob = b64toBlob(content, type);
cy.window().then((win) => {
const testFile = new win.File([blob], fileName, { type });
const dataTransfer = new DataTransfer();
dataTransfer.items.add(testFile);
el.files = dataTransfer.files;
return cy.wrap(subject).trigger('change', {force: true});
});
});
cy.fixture(fileName).then((content) => {
console.log("Content", fileName);
cy.get(selector).upload({
fileContent: content,
fileName: fileName,
mimeType: type });
});
// cy.get(selector).trigger('change', { force: true });
});
Cypress.Commands.add('post', (message) => {
......
This diff is collapsed.
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { CUSTOM_ELEMENTS_SCHEMA, NgModule, Injectable, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { CaptchaModule } from './modules/captcha/captcha.module';
import { environment } from '../environments/environment';
import { Minds } from './app.component';
......@@ -59,6 +60,23 @@ import { CanaryModule } from './modules/canary/canary.module';
import { HttpClientModule } from "@angular/common/http";
import { AnalyticsModule } from "./modules/analytics/analytics.module";
import * as Sentry from "@sentry/browser";
Sentry.init({
dsn: "https://3f786f8407e042db9053434a3ab527a2@sentry.io/1538008", // TODO: do not hardcard
release: environment.version,
environment: (<any>window.Minds).environment || 'development',
});
@Injectable()
export class SentryErrorHandler implements ErrorHandler {
constructor() {}
handleError(error) {
// const eventId = Sentry.captureException(error.originalError || error);
// Sentry.showReportDialog({ eventId });
}
}
@NgModule({
bootstrap: [
Minds
......@@ -122,6 +140,7 @@ import { AnalyticsModule } from "./modules/analytics/analytics.module";
ChannelsModule,
],
providers: [
{ provide: ErrorHandler, useClass: SentryErrorHandler },
MindsAppRoutingProviders,
MINDS_PROVIDERS,
MINDS_PLUGIN_PROVIDERS,
......
......@@ -153,7 +153,7 @@ export class EntitiesService {
if (!this.entities.has(urn)) {
this.entities.set(urn, new BehaviorSubject(null));
}
this.entities.get(urn).error("Not found");
console.warn(`Entity ${urn} not found`);
}
static _(client: Client, blockListService: BlockListService) {
......
......@@ -191,9 +191,6 @@ export class Activity implements OnInit {
@Input() set boostToggle(toggle: boolean) {
//if(toggle)
// this.showBoost();
if(this.activity.custom_type === 'video') {
this.player.pause();
}
return;
}
......
......@@ -2,6 +2,7 @@
* Sessions
*/
import { EventEmitter } from '@angular/core';
import * as Sentry from "@sentry/browser";
export class Session {
......@@ -56,8 +57,13 @@ export class Session {
});
}
if (window.Minds.user)
if (window.Minds.user) {
// Attach user_guid to debug logs
Sentry.setUser({
id: window.Minds.user.guid,
});
return window.Minds.user;
}
return false;
}
......
export const environment = {
production: true
production: true,
version: "VERSION",
};
......@@ -4,5 +4,6 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = {
production: false
production: false,
version: "VERSION",
};
......@@ -129,7 +129,8 @@
"blockchain" => (object) Minds\Core\Di\Di::_()->get('Blockchain\Manager')->getPublicSettings(),
"sale" => Minds\Core\Config::_()->get('blockchain')['sale'],
"last_tos_update" => Minds\Core\Config::_()->get('last_tos_update') ?: time(),
"tags" => Minds\Core\Config::_()->get('tags') ?: []
"tags" => Minds\Core\Config::_()->get('tags') ?: [],
"environment" => getenv('MINDS_ENV') ?: 'development',
];
if(Minds\Core\Session::isLoggedIn()){
......