Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit 7feca07

Browse files
author
Aaron
authored
Merge pull request #2681 from binary-com/dev
dev to beta
2 parents 5be794c + 4d9fbe0 commit 7feca07

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

.circleci/config.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,17 +94,14 @@ commands:
9494
- run:
9595
name: Building docker image for << parameters.target >>
9696
command: |
97-
build_tag="${CIRCLE_SHA1}"
98-
[ "<< parameters.target >>" == "beta" ] && build_tag="beta-${CIRCLE_SHA1}"
99-
docker build -t ${DOCKHUB_ORGANISATION}/binary-static-bot:${build_tag} -t ${DOCKHUB_ORGANISATION}/binary-static-bot:latest .
97+
build_latest="latest"
98+
[ "<< parameters.target >>" == "beta" ] && build_latest="beta-latest"
99+
docker build -t ${DOCKHUB_ORGANISATION}/binary-static-bot:${CIRCLE_TAG} -t ${DOCKHUB_ORGANISATION}/binary-static-bot:${build_latest} .
100100
- run:
101101
name: Pushing Image to docker hub
102102
command: |
103-
build_tag="${CIRCLE_SHA1}"
104-
[ "<< parameters.target >>" == "beta" ] && build_tag="beta-${CIRCLE_SHA1}"
105103
echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
106-
docker push ${DOCKHUB_ORGANISATION}/binary-static-bot:${build_tag}
107-
docker push ${DOCKHUB_ORGANISATION}/binary-static-bot:latest
104+
docker push ${DOCKHUB_ORGANISATION}/binary-static-bot
108105
k8s_deploy:
109106
description: "Deploy to k8s cluster"
110107
parameters:
@@ -126,11 +123,10 @@ commands:
126123
CA_CRT="${!CA_CRT_REF}"
127124
KUBE_SERVER="${!KUBE_SERVER_REF}"
128125
SERVICEACCOUNT_TOKEN="${!SERVICEACCOUNT_TOKEN_REF}"
129-
build_tag="${CIRCLE_SHA1}"
130126
deployment_target="bot-binary-com"
131-
[ "<< parameters.target >>" == "beta" ] && build_tag="beta-${CIRCLE_SHA1}" && deployment_target="bot-beta-binary-com"
127+
[ "<< parameters.target >>" == "beta" ] && deployment_target="bot-beta-binary-com"
132128
echo $CA_CRT | base64 --decode > ca.crt
133-
kubectl --server=${KUBE_SERVER} --certificate-authority=ca.crt --token=$SERVICEACCOUNT_TOKEN set image deployment/${deployment_target} ${deployment_target}=${DOCKHUB_ORGANISATION}/binary-static-bot:${build_tag}
129+
kubectl --server=${KUBE_SERVER} --certificate-authority=ca.crt --token=$SERVICEACCOUNT_TOKEN set image deployment/${deployment_target} ${deployment_target}=${DOCKHUB_ORGANISATION}/binary-static-bot:${CIRCLE_TAG}
134130
fi
135131
done
136132

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121
},
2222
"scripts": {
2323
"start": "gulp watch",
24-
"test": "eslint src/ && jest -w 1",
24+
"test": "eslint src/",
2525
"release": "d() { test -z $1 && echo 'Please specify branch.' && exit 1; (git show-branch $1) || exit 1; git stash; git checkout $1; npm i; rm -rf branch/$1; mkdir -p branch/$1 ; gulp build-min; cp -r www/ branch/$1; gulp release-branch --branch $1;}; d",
2626
"release-production": "d() { git stash; git checkout master; npm i;gulp build-min;gulp release-master;}; d",
27-
"build": "webpack --config webpack.config.cli.js"
27+
"build": "webpack --config webpack.config.cli.js",
28+
"build-min": "gulp build-min"
2829
},
2930
"husky": {
3031
"hooks": {

src/botPage/bot/TradeEngine/Purchase.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { recoverFromError, doUntilDone } from '../tools';
33
import { contractStatus, info, notify } from '../broadcast';
44
import { purchaseSuccessful } from './state/actions';
55
import { BEFORE_PURCHASE } from './state/constants';
6+
import GTM from '../../../common/gtm';
67

78
let delayIndex = 0;
89

@@ -17,6 +18,7 @@ export default Engine =>
1718
const { currency, proposal } = this.selectProposal(contractType);
1819
const onSuccess = r => {
1920
const { buy } = r;
21+
GTM.pushDataLayer({ event: 'bot_purchase', buy_price: proposal.ask_price });
2022

2123
contractStatus({
2224
id : 'contract.purchase_recieved',

src/botPage/view/blockly/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import { getLanguage } from '../../../common/lang';
2626
import { observer as globalObserver } from '../../../common/utils/observer';
2727
import { showDialog } from '../../bot/tools';
2828
import GTM from '../../../common/gtm';
29-
import { parseQueryString } from '../../../common/utils/tools';
29+
import { parseQueryString, isProduction } from '../../../common/utils/tools';
3030
import { TrackJSError } from '../logger';
3131
import config from '../../common/const';
3232

@@ -56,7 +56,7 @@ const disposeBlocksWithLoaders = () => {
5656

5757
const marketsWereRemoved = xml => {
5858
if (!Array.from(xml.children).every(block => !removeUnavailableMarkets(block))) {
59-
if (window.trackJs) {
59+
if (window.trackJs && isProduction()) {
6060
trackJs.track('Invalid financial market');
6161
}
6262
showDialog({

src/botPage/view/logger.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { observer as globalObserver } from '../../common/utils/observer';
22
import { getToken } from '../../common/utils/storageManager';
3+
import { isProduction } from '../../common/utils/tools';
34

45
const log = (type, ...args) => {
56
if (type === 'warn') {
@@ -66,7 +67,7 @@ const notifyError = error => {
6667

6768
notify({ className: 'error', message, position: 'right' });
6869

69-
if (trackJs) {
70+
if (trackJs && isProduction()) {
7071
trackJs.console.log(error);
7172
trackJs.track(code || error.name);
7273
}

src/common/integrations/GoogleDrive.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* global google,gapi */
22
import { getLanguage } from '../lang';
33
import { observer as globalObserver } from '../utils/observer';
4-
import { translate } from '../utils/tools';
4+
import { translate, isProduction } from '../utils/tools';
55
import config from '../../botPage/common/const';
66
import { load } from '../../botPage/view/blockly';
77
import { TrackJSError } from '../../botPage/view/logger';
@@ -42,7 +42,7 @@ class GoogleDrive {
4242
.removeClass('invisible');
4343
},
4444
error => {
45-
if (window.trackJs) {
45+
if (window.trackJs && isProduction()) {
4646
trackJs.track(
4747
`${translate(
4848
'There was an error initialising Google Drive'
@@ -53,7 +53,7 @@ class GoogleDrive {
5353
);
5454
},
5555
onerror: error => {
56-
if (window.trackJs) {
56+
if (window.trackJs && isProduction()) {
5757
trackJs.track(
5858
`${translate('There was an error loading Google Drive libraries')} - Error: ${JSON.stringify(
5959
error

0 commit comments

Comments
 (0)