Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
4117d41
add script
chylli-deriv Aug 15, 2023
56b2bf9
refactor
chylli-deriv Aug 15, 2023
240c0cc
update schema
chylli-deriv Aug 15, 2023
3adc58e
fix test
chylli-deriv Aug 24, 2023
db68ec8
update changelog
chylli-deriv Aug 24, 2023
6166645
rename default ws server
chylli-deriv Aug 24, 2023
05e6609
update ChangeLog
chylli-deriv Aug 24, 2023
5776d26
increase version
chylli-deriv Aug 24, 2023
971d1f0
try update
chylli-deriv Aug 27, 2023
22517db
try update
chylli-deriv Aug 27, 2023
5dcae6b
fix command
chylli-deriv Aug 27, 2023
e540498
checkout
chylli-deriv Aug 27, 2023
5359679
install modules
chylli-deriv Aug 27, 2023
a46ba28
install cpanm
chylli-deriv Aug 27, 2023
1310399
test status
chylli-deriv Aug 27, 2023
ce51d66
add name
chylli-deriv Aug 27, 2023
e29a3b4
try push
chylli-deriv Aug 27, 2023
880ab7a
no check git
chylli-deriv Aug 27, 2023
ec18969
config git
chylli-deriv Aug 27, 2023
9eb1fc2
push to origin
chylli-deriv Aug 27, 2023
3c75233
update schema automatically
Aug 27, 2023
4974401
filter
chylli-deriv Aug 27, 2023
ac5a2f6
filter
chylli-deriv Aug 27, 2023
5204581
try add NEXTVER
chylli-deriv Aug 28, 2023
4161f46
revert update schema to test NEXTVER
chylli-deriv Aug 28, 2023
71ab237
update schema automatically
Aug 28, 2023
3f9b979
run status before commit
chylli-deriv Aug 28, 2023
9f8741b
revert again for test
chylli-deriv Aug 28, 2023
8524b43
test
chylli-deriv Aug 28, 2023
1476914
update schema automatically
Aug 28, 2023
c1ef040
Revert "update schema automatically"
chylli-deriv Aug 28, 2023
f8df187
fix typo
chylli-deriv Aug 28, 2023
979c896
update schema automatically
Aug 28, 2023
e179eee
add more lines
chylli-deriv Aug 28, 2023
841ae63
Revert "update schema automatically"
chylli-deriv Aug 28, 2023
ffb1d34
update schema automatically
Aug 28, 2023
a03d7ca
to check cron run
chylli-deriv Aug 28, 2023
4542ef8
try upload
chylli-deriv Aug 28, 2023
62c8712
fix error
chylli-deriv Aug 28, 2023
ce2b4b1
try release
chylli-deriv Aug 28, 2023
d59c376
try fix
chylli-deriv Aug 28, 2023
364ac6d
from bottom
chylli-deriv Aug 28, 2023
1f29d88
add requirement
chylli-deriv Aug 28, 2023
29888ad
require test
chylli-deriv Aug 28, 2023
4d86b83
schedule
chylli-deriv Aug 28, 2023
ae45d22
try run every minutes
chylli-deriv Aug 28, 2023
bc17a23
run it every day
chylli-deriv Aug 28, 2023
6353bbc
cascade
chylli-deriv Aug 28, 2023
70fda5d
fix error
chylli-deriv Aug 28, 2023
b5ac2a9
try set git
chylli-deriv Aug 28, 2023
4b34279
push back
chylli-deriv Aug 29, 2023
9577591
release $NEXT_VER
Aug 29, 2023
c4b058e
try no nextver
chylli-deriv Aug 29, 2023
fb04cf9
Revert "release $NEXT_VER"
chylli-deriv Aug 29, 2023
ebf259e
Revert "update schema automatically"
chylli-deriv Aug 29, 2023
b9b65f2
update schema automatically
Aug 29, 2023
77d9ed5
enable cron [ci skip]
chylli-deriv Aug 29, 2023
5262d7a
revert update automatically [ci skip]
chylli-deriv Aug 29, 2023
1384395
update schema automatically
Aug 29, 2023
a726956
Revert "update schema automatically"
chylli-deriv Aug 29, 2023
0ee27ee
try run every 5 minutes [ci skip]
chylli-deriv Aug 29, 2023
5b58522
update schema automatically
Aug 29, 2023
24eed7b
try again [ci skip]
chylli-deriv Aug 29, 2023
9342567
[ci skip] Revert "update schema automatically"
chylli-deriv Aug 29, 2023
8b867be
update schema automatically
Aug 29, 2023
d5f9c73
refactor
chylli-deriv Aug 29, 2023
7ef1ea8
change to pypi
chylli-deriv Aug 29, 2023
af8ff10
Update .circleci/config.yml
chylli-deriv Aug 29, 2023
c545003
try ssh key
chylli-deriv Aug 29, 2023
65ac763
no cron , for test
chylli-deriv Aug 29, 2023
77d78ad
Revert "update schema automatically"
chylli-deriv Aug 29, 2023
22c59d0
show remote -v
chylli-deriv Aug 29, 2023
c81b8a3
push
chylli-deriv Aug 29, 2023
b031030
add back filter
chylli-deriv Aug 29, 2023
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
76 changes: 72 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- checkout # check out source code to working directory
- run: sudo chown -R circleci:circleci /usr/local/bin
- restore_cache:
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
# Read about caching dependencies: https://circleci.com/docs/2.0/caching/
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
- run:
command: |
Expand All @@ -45,8 +45,8 @@ jobs:
- restore_cache:
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
- run:
command: |
make setup
command: |
make setup
- save_cache:
key: deps9-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
paths:
Expand All @@ -56,6 +56,55 @@ jobs:
git config --local user.email "sysadmin@binary.com"
git config --local user.name "gh-pages deploy bot"
make gh-pages
update_schema:
<<: *default
steps:
- add_ssh_keys:
fingerprints:
- "c8:f7:fc:a0:0d:2c:43:93:e3:c7:b6:cf:16:93:98:e1"
- checkout
- run:
name: config git
command: |
git config --global user.email "nobody@deriv.com"
git config --global user.name "Nobody"
- run:
name: update schema
command: |
git clone https://github.com/binary-com/deriv-developers-portal.git /tmp/deriv-developers-portal
curl -L https://cpanmin.us | perl - --sudo App::cpanminus
sudo cpanm -n Dir::Self File::Basename JSON::MaybeXS Log::Any Path::Tiny Template Syntax::Keyword::Try

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to have a cpanfile for installing these dependencies ? Or is the dependencies too little to have a separate file for it ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a python project. I'm installing dependencies for that script scripts/regen-py.pl . I don't think its necessary to maintain a cpanfile.

BINARYCOM_API_SCHEMA_PATH=/tmp/deriv-developers-portal/config/v3 perl scripts/regen-py.pl
if [[ $(git diff --shortstat) == ' 2 files changed, 2 insertions(+), 2 deletions(-)' ]]
then
echo 'Schema no change'
exit 0
fi
echo "Schama updated"
pip3 install bump
NEXT_VER=$(bump)
sed -i '/# Changelog/{s/$/\n\n## NEXTVER\n\nSync API/}' CHANGELOG.md
sed -i "s/NEXTVER/$NEXT_VER/g" CHANGELOG.md
git add .
git commit -m 'update schema automatically'
git push origin HEAD:master
release:
<<: *default
steps:
- checkout
- run:
name: setup pypi
command: |
echo "[pypi]" >> ~/.pypirc
echo "username=__token__" >> ~/.pypirc
echo "password=$PYPI_TOKEN" >> ~/.pypirc
- run:
name: release
command: |
python3 -m pip install --upgrade twine
make build
python3 -m twine upload --repository pypi dist/*
echo "deployed to pypi"
workflows:
build:
jobs:
Expand All @@ -78,7 +127,26 @@ workflows:
- "3.10.4"
- "3.10.10"
- docs-build-deploy:
requires:
- release
filters:
branches:
only:
- master
- release:
requires:
- test
filters:
branches:
only:
- master
update_schema_flow:
jobs:
- update_schema

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the update_schema is run daily. Are we configuring the trigger via the UI ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we needn't trigger via UI, this cron configuration will trigger it
Please let me know if I misunderstand you or you have a deeper think.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously since the trigger was missing i assumed you intended to add the trigger via the project settings rather than specifying the trigger in the yaml itself since as per the docs setting the trigger via the project settings seems to be the preferred approach. https://circleci.com/docs/migrate-scheduled-workflows-to-scheduled-pipelines/

triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
- master
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ venv/
dist
.coverage
build
tags
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
# Changelog

## 0.1.5

Change default ws server

## 0.1.4

Sync API

## 0.1.3

Fix a typo, which cause ws connection no response

## 0.1.2

Added middleware support

## 0.1.1

### Fixed:
Fixed a PyPI constraint where the package can only be installed on python ==3.9.6

Fixed a PyPI constraint where the package can only be installed on python ==3.9.6

## 0.1.0

Initial version.

2 changes: 1 addition & 1 deletion deriv_api/deriv_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class DerivAPI(DerivAPICalls):
storage: None

def __init__(self, **options: str) -> None:
endpoint = options.get('endpoint', 'frontend.binaryws.com')
endpoint = options.get('endpoint', 'ws.derivws.com')
lang = options.get('lang', 'EN')
brand = options.get('brand', '')
cache = options.get('cache', InMemory())
Expand Down
Loading