Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Merge master into dev #1366

Open
wants to merge 57 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8416cf8
Preparing V2.5.1 (#1345)
morteza-binary Mar 3, 2020
bfeaa01
V2.5.1
morteza-binary Mar 3, 2020
eac4638
Upgraded gulp version
morteza-binary Apr 7, 2020
dedb9e2
add CI config
Mahboobeh-binary May 21, 2020
2abdb22
Merge pull request #1349 from Mahboobeh-binary/patch-1
ashkanx May 21, 2020
df514da
add CI key
Mahboobeh-binary May 22, 2020
f063b85
Merge pull request #1350 from Mahboobeh-binary/patch-3
Mahboobeh-binary May 22, 2020
0f5bbf4
add CI user key
Mahboobeh-binary May 22, 2020
6994bd0
add CI key
Mahboobeh-binary Jun 1, 2020
51a8f8d
Merge pull request #1352 from Mahboobeh-binary/patch-6
Jun 1, 2020
e51eec1
add git config
Mahboobeh-binary Jun 1, 2020
7dd7ab4
Merge pull request #1353 from Mahboobeh-binary/patch-7
Jun 1, 2020
9ee943c
skip ci on static branches
Mahboobeh-binary Jun 1, 2020
2621953
Merge pull request #1354 from Mahboobeh-binary/patch-8
Jun 1, 2020
16ac7ed
user same node image for all jobs
Mahboobeh-binary Jun 1, 2020
3be1189
redo it later
Mahboobeh-binary Jun 1, 2020
fef7aeb
Merge pull request #1355 from Mahboobeh-binary/patch-9
Jun 1, 2020
18ad41f
use CIRCLE_TAG when build docker image
Mahboobeh-binary Jun 2, 2020
32b7d96
Merge pull request #1356 from Mahboobeh-binary/patch-11
Jun 2, 2020
04ca8d1
Create Dockerfile
Mahboobeh-binary Jun 2, 2020
b98aee3
Merge pull request #1357 from Mahboobeh-binary/patch-12
Jun 2, 2020
4b278ec
Create default.conf
Mahboobeh-binary Jun 2, 2020
78560e7
Create .dockerignore
Mahboobeh-binary Jun 2, 2020
cdb486e
Create .dockerignore
Mahboobeh-binary Jun 2, 2020
a8237a2
Merge pull request #1358 from Mahboobeh-binary/patch-13
Jun 2, 2020
cd62d0f
Revert "Create default.conf"
Jun 2, 2020
e874b7f
Create default.conf
Mahboobeh-binary Jun 2, 2020
036f8c4
Merge pull request #1359 from binary-com/revert-1358-patch-13
Jun 2, 2020
b72dbcc
Merge pull request #1360 from Mahboobeh-binary/patch-14
Jun 2, 2020
f6e5f81
add production tag to release_production
Mahboobeh-binary Jun 2, 2020
0cf7c8e
Merge pull request #1361 from Mahboobeh-binary/patch-15
Jun 2, 2020
426393c
fix tick trade image name
Mahboobeh-binary Jun 3, 2020
6a4bf26
Merge pull request #1362 from Mahboobeh-binary/patch-16
Jun 3, 2020
b8f9d73
fix typo
Mahboobeh-binary Jun 3, 2020
4343b34
Merge pull request #1363 from Mahboobeh-binary/patch-17
Jun 3, 2020
30a913b
Deploy apk
Jun 3, 2020
1eb6382
undo dockerfile
Jun 3, 2020
7ea2a9c
bug fix
Jun 3, 2020
55ba7aa
fix cp command issue
Jun 3, 2020
4b1f6c3
fix path issue
Jun 3, 2020
3111fd1
Clean up
Jun 3, 2020
4de4af7
Merge pull request #1364 from Mahboobeh-binary/download
Jun 3, 2020
29e74c7
Deployed new version of APK - Tue, 11 Aug 2020 04:24:30 GMT
morteza-binary Aug 11, 2020
19201fc
Deployed new version of APK - Wed, 12 Aug 2020 02:23:45 GMT
morteza-binary Aug 12, 2020
d35273c
Deployed new version of APK - Wed, 12 Aug 2020 03:17:11 GMT
morteza-binary Aug 12, 2020
3062d13
V2.5.5
morteza-binary Sep 30, 2020
ceed733
Added enpoint page
morteza-binary Apr 30, 2021
5f3ae6c
Blocked Australian users
morteza-binary Apr 30, 2021
3ec3c20
Bump up version to 2.6.0
morteza-binary Apr 30, 2021
ab70900
A minor fix
morteza-binary May 3, 2021
2f50322
A minor fix
morteza-binary May 3, 2021
7a6e0aa
Deployed new version of APK - Tue, 04 May 2021 04:51:00 GMT
morteza-binary May 4, 2021
abd3a48
V 2.6.1
morteza-binary Jul 9, 2021
d4667ef
Deployed new version of APK - Fri, 09 Jul 2021 09:52:36 GMT
morteza-binary Jul 9, 2021
e4b1e7c
Remove old release and use Blue/Green as default (#1367)
afshin-deriv Jul 27, 2021
6982ff3
Deployed new version of APK - Thu, 21 Oct 2021 06:25:11 GMT
morteza-binary Oct 21, 2021
292674c
Merge branch 'master' of github.com:binary-com/mobile
morteza-binary Oct 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
179 changes: 179 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
version: 2.1
orbs:
k8s: circleci/kubernetes@0.7.0
commands:
git_checkout_from_cache:
description: "Git checkout and save cache"
steps:
- restore_cache:
name: Git restore cache
keys:
- source-v1-{{ .Branch }}-{{ .Revision }}
- source-v1-{{ .Branch }}-
- source-v1-
- run:
name: Fetch git tags
command: |
mkdir -p ~/.ssh
echo 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== ' >> ~/.ssh/known_hosts
# Fetch tags if git cache is present
if [ -e /home/circleci/project/.git ]
then
git fetch origin --tags
fi
- checkout
- run:
name: Compress git objects
command: git gc
- save_cache:
name: Git save cache
key: source-v1-{{ .Branch }}-{{ .Revision }}
paths:
- ".git"
npm_install:
description: "Install npm modules"
steps:
- restore_cache:
name: Restore npm cache
keys:
- npm-v1-{{ checksum "package.json" }}
- npm-v1-
- run:
name: Install npm modules
command: npm install && ./node_modules/.bin/bower install
- save_cache:
name: Save NPM cache
key: npm-v1-{{ checksum "package.json" }}
paths:
- "node_modules"
build:
description: "Build"
steps:
- run:
name: "gulp build"
command: npx gulp build
- run:
name: "upload apk to www folder"
command: cp -r download www/
deploy:
description: "Deploy to static branches"
parameters:
target_branch:
type: string
steps:
- checkout
- attach_workspace:
at: www
- run:
name: Tag build
command: echo "<< parameters.target_branch >> $(date)" > www/version
- run:
name: Install and configure dependencies
command: |
sudo npm install -g gh-pages@2.0.1
git config user.email "ci-build@binary.com"
git config user.name "ci-build"
- add_ssh_keys:
fingerprints:
- "01:67:4a:6d:26:9c:70:c4:1a:60:91:88:d9:dd:f0:83"
- run:
name: Deploy docs to gh-pages branch
command: gh-pages -d www --branch << parameters.target_branch >> --message '[skip ci]'
docker_build_push:
description: "Build and Push image to docker hub"
steps:
- setup_remote_docker
- run:
name: Building docker image for production
command: |
docker build -t ${DOCKHUB_ORGANISATION}/binary-static-ticktrade:${CIRCLE_TAG} -t ${DOCKHUB_ORGANISATION}/binary-static-ticktrade:latest .
- run:
name: Pushing Image to docker hub
command: |
echo $DOCKERHUB_PASSWORD | docker login -u $DOCKERHUB_USERNAME --password-stdin
docker push ${DOCKHUB_ORGANISATION}/binary-static-ticktrade
k8s_deploy:
description: "Deploy to k8s cluster"
parameters:
k8s_namespace:
type: string
default: "ticktrade-binary-com-production"
k8s_service:
type: string
default: "binary-static-ticktrade"
steps:
- k8s/install-kubectl
- run:
name: Deploying to k8s cluster for service ticktrade-binary-com
command: |
TAG=${CIRCLE_TAG:-$CIRCLE_SHA1}
export NAMESPACE=<< parameters.k8s_namespace >>
git clone https://github.com/binary-com/devops-ci-scripts
cd devops-ci-scripts/k8s-build_tools
echo $CA_CRT | base64 --decode > ca.crt
./release.sh << parameters.k8s_service >> ${TAG}

jobs:
test:
docker:
- image: circleci/node:8.10.0-stretch
steps:
- git_checkout_from_cache
- npm_install
- build
release_beta:
docker:
- image: circleci/node:8.10.0-stretch
steps:
- git_checkout_from_cache
- npm_install
- build
- deploy:
target_branch: "staging"

release_production:
docker:
- image: circleci/node:8.10.0-stretch
steps:
- git_checkout_from_cache
- npm_install
- build
- deploy:
target_branch: "production"

release_aws_production:
docker:
- image: circleci/node:8.10.0-stretch
steps:
- git_checkout_from_cache
- npm_install
- build
- docker_build_push
- k8s_deploy

workflows:
test:
jobs:
- test:
filters:
branches:
ignore: /^master$/
release:
jobs:
- release_beta:
filters:
branches:
only: /^master$/
- release_production:
filters:
branches:
ignore: /.*/
tags:
only: /^production.*/
- release_aws_production:
filters:
branches:
ignore: /.*/
tags:
only: /^production.*/
context: binary-frontend-artifact-upload
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
Dockerfile
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

FROM nginx:alpine
COPY ./www /usr/share/nginx/html
COPY ./default.conf /etc/nginx/conf.d/default.conf
3 changes: 2 additions & 1 deletion config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="205000" id="com.binary.ticktrade" version="2.5.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<widget android-versionCode="206020" id="com.binary.ticktrade" version="2.6.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>Tick Trade</name>
<description>
Enjoy fast-paced binary options trading with the Binary.com Tick Trade App. Trade Forex and more in seconds with our mobile application.
Expand Down Expand Up @@ -29,6 +29,7 @@
<hook src="scripts/after_prepare/es5-compatible.js" type="after_prepare" />
<platform name="android">
<hook src="scripts/after_prepare/011_add_cert_fingerprint.js" type="after_prepare" />
<preference name="AndroidLaunchMode" value="singleInstance" />
<preference name="CodePushDeploymentKey" value="RsETRgKn7ZenvRAozwUYOcUwXEi6V1eFOQxYg" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
<icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
Expand Down
22 changes: 22 additions & 0 deletions default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
server {
listen 80;
server_name localhost;

add_header Cache-Control "public, max-age=7200, s-maxage=600, must-revalidate";
charset UTF-8;

error_page 404 /404.html;

location @custom_error_503 {
return 503;
}

location ~ /\.git {
return 404;
}

location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
}
Binary file added download/ticktrade-app.apk
Binary file not shown.
66 changes: 49 additions & 17 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,39 +121,38 @@ gulp.task('deploy-apk', (done) => {
const remoteUrl = getRemoteUrl(remote);

// remove last tmp directory if it exists
sh.rm('-rf', 'tmp');
// sh.rm('-rf', 'tmp');

// make a tmp directory
sh.mkdir('tmp');
// sh.mkdir('tmp');
if(sh.error()){
console.log(gutil.colors.red(`Error: ${ sh.error()}`));
process.exit(1);
}

sh.cd('tmp');
console.log('Fetching gh-pages ...');
sh.config.silent = false;
sh.exec(`git clone ${ remoteUrl } -b gh-pages ./`);
sh.config.silent = true;
// sh.cd('tmp');
// console.log('Fetching gh-pages ...');
// sh.config.silent = false;
// sh.exec(`git clone ${ remoteUrl } -b gh-pages ./`);
// sh.config.silent = true;

console.log('Copying latest verison of APK ...');
sh.rm('-rf', 'download');
sh.mkdir('download');
sh.cp('../platforms/android/app/build/outputs/apk/release/ticktrade-app.apk','download/ticktrade-app.apk');
sh.cp('./platforms/android/app/build/outputs/apk/release/ticktrade-app.apk','download/ticktrade-app.apk');

console.log('Pushing changes to gh-pages ...');
console.log('Pushing changes to origin ...');
sh.config.silent = false;
sh.exec('git config user.name "Morteza Tavanarad"');
sh.exec('git config user.email "morteza@binary.com"');
sh.exec('git add .');
sh.exec(`git commit -m "Deployed new version of APK - ${new Date().toUTCString()}"`);
sh.exec('git push origin gh-pages:gh-pages');
sh.exec('git push origin master:master');
sh.config.silent = true;

console.log('Cleaning workspace ...');
// remove tmp directory to clean workspace
sh.cd('../');
sh.rm('-rf', 'tmp');
// sh.rm('-rf', 'tmp');
return done();
});
gulp.task('code-push', (done) => {
Expand Down Expand Up @@ -188,13 +187,14 @@ gulp.task('code-push', (done) => {

console.log(` ${ gutil.colors.blue('Preparing files ...')}`);
sh.sed('-i', '.otherwise("/")', '.otherwise("/update")', 'www/js/configs/states.config.js');
sh.exec('ionic cordova prepare');

console.log(` ${ gutil.colors.blue('Run code-push ...')}`);
sh.exec(`code-push release-cordova ${ app } ${ platform } --deploymentName ${ deployment }${targetVersion } --mandatory`);

console.log(` ${ gutil.colors.blue('Rolling back dump changes ...')}`);
sh.sed('-i', '.otherwise("/update")', '.otherwise("/")', 'www/js/configs/states.config.js');
sh.exec('ionic prepare');
sh.exec('ionic cordova prepare');

done();
});
Expand Down Expand Up @@ -271,10 +271,10 @@ gulp.task('release-qa', () => {

const gitResult = sh.exec('echo | git branch | grep "*"');

if (gitResult && gitResult.output && gitResult.output.indexOf('qa_version') < 0) {
console.log("You're not in qa_version branch");
process.exit(-1);
}
// if (gitResult && gitResult.output && gitResult.output.indexOf('qa_version') < 0) {
// console.log("You're not in qa_version branch");
// process.exit(-1);
// }

const qaMachine = getArgvBySwitchName('--qa_machine');

Expand All @@ -292,6 +292,38 @@ gulp.task('release-qa', () => {
}


});

gulp.task('run-qa', () => {

/**
* Usage gulp release-qa --qa_machine qaurl1,qaurl2,...
*
*/

const gitResult = sh.exec('echo | git branch | grep "*"');

// if (gitResult && gitResult.output && gitResult.output.indexOf('qa_version') < 0) {
// console.log("You're not in qa_version branch");
// process.exit(-1);
// }

const qaMachine = getArgvBySwitchName('--qa_machine');

if (qaMachine) {
sh.exec(`ionic cordova run android -- --qa_machine=${ qaMachine}`);
}

const qaMachineFile = getArgvBySwitchName('--qa_machine_file');

if (qaMachineFile) {
const qaMachineList = require(qaMachineFile);
if (qaMachineList && qaMachineList.length) {
sh.exec(`ionic cordova run android -- --qa_machine=${ qaMachineList.join(',')}`);
}
}


});


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"cordova-plugin-whitelist": "^1.3.3",
"cordova-plugin-zip": "^3.1.0",
"express": "^4.13.3",
"gulp": "^3.5.6",
"gulp": "^3.9.1",
"gulp-concat": "^2.2.0",
"gulp-minify-css": "^0.3.0",
"gulp-rename": "^1.2.0",
Expand Down
23 changes: 12 additions & 11 deletions scripts/after_prepare/011_add_cert_fingerprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module.exports = function (context) {
const platformPath = path.join(rootDir, 'platforms');

const qaMachines = context.opts.options.qa_machine ? context.opts.options.qa_machine.split(',') : [];
console.log(qaMachines);

run();

Expand All @@ -18,20 +19,20 @@ module.exports = function (context) {

const currentBranch = shell.exec("echo | git branch | grep '*'");

if(currentBranch && currentBranch.stdout && currentBranch.stdout.indexOf('qa_version') > -1) {
const qaFP = [];
// if(currentBranch && currentBranch.stdout && currentBranch.stdout.indexOf('qa_version') > -1) {
const qaFP = [];

qaMachines.forEach((m) => {
const cert = {
url: m,
fp : retriveFP(m),
};
qaMachines.forEach((m) => {
const cert = {
url: m,
fp : retriveFP(m),
};

cert.fp ? qaFP.push(cert) : null;
});
cert.fp ? qaFP.push(cert) : null;
});

writeFP(qaFP, 'qaMachinesCertFP');
}
writeFP(qaFP, 'qaMachinesCertFP');
// }
}

function retriveFP(url, variableName) {
Expand Down
Loading