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

Commit 17f58a8

Browse files
committed
Merge branch 'master' into websocket-update
2 parents 9bb647d + 9831bc0 commit 17f58a8

File tree

137 files changed

+11116
-12827
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

137 files changed

+11116
-12827
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: k8s_deploy
2+
description: Deploy to Kubernetes
3+
inputs:
4+
K8S_VERSION:
5+
description: Kubernetes version
6+
required: true
7+
K8S_NAMESPACE:
8+
description: Kubernetes namespace
9+
required: false
10+
default: 'deriv-com-api-staging'
11+
CA_CRT:
12+
description: Kubernetes CA certificate
13+
required: true
14+
KUBE_SERVER:
15+
description: Kubernetes server
16+
required: true
17+
SERVICEACCOUNT_TOKEN:
18+
description: Kubernetes service account token
19+
required: true
20+
DOCKERHUB_ORGANISATION:
21+
description: Dockerhub organisation
22+
required: true
23+
runs:
24+
using: composite
25+
steps:
26+
- name: Setup Environment variables
27+
run: |
28+
echo "NAMESPACE=${{ inputs.K8S_NAMESPACE }}" >> "$GITHUB_ENV"
29+
echo "KUBE_SERVER=${{ inputs.KUBE_SERVER }}" >> "$GITHUB_ENV"
30+
echo "SERVICEACCOUNT_TOKEN=${{ inputs.SERVICEACCOUNT_TOKEN }}" >> "$GITHUB_ENV"
31+
echo "DOCKERHUB_ORGANISATION=${{ inputs.DOCKERHUB_ORGANISATION }}" >> "$GITHUB_ENV"
32+
echo "CA_CRT=${{ inputs.CA_CRT }}" >> "$GITHUB_ENV"
33+
echo "APP_NAME=deriv-com-api" >> "$GITHUB_ENV"
34+
shell: bash
35+
- name: Deploying to k8s cluster for service ${{ inputs.K8S_NAMESPACE }} 🚀
36+
run: |
37+
git clone https://github.com/binary-com/devops-ci-scripts
38+
cd devops-ci-scripts/k8s-build_tools
39+
echo ${{ inputs.CA_CRT }} | base64 --decode > ca.crt
40+
export CA="ca.crt"
41+
./release.sh ${APP_NAME} ${{ inputs.K8S_VERSION }}
42+
shell: bash
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: docker_build_push
2+
description: Build and push Docker image to Docker Hub
3+
inputs:
4+
DOCKER_LATEST_IMAGE_TAG:
5+
description: Docker image tag
6+
required: false
7+
default: 'latest-staging'
8+
DOCKER_IMAGE_TAG:
9+
description: Docker image tag
10+
required: true
11+
DOCKERHUB_ORGANISATION:
12+
description: Docker Hub organisation
13+
required: true
14+
DOCKERHUB_USERNAME:
15+
description: Docker Hub username
16+
required: true
17+
DOCKERHUB_PASSWORD:
18+
description: Docker Hub password
19+
required: true
20+
runs:
21+
using: composite
22+
steps:
23+
- name: Building docker image 🐳
24+
run: |
25+
docker build -t ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_IMAGE_TAG }} -t ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }} .
26+
shell: bash
27+
- name: Verify nginx image
28+
run: |
29+
set -e
30+
docker run --rm ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }} nginx -t
31+
echo "docker image validated successfully"
32+
shell: bash
33+
- name: Pushing Image to docker hub 🐳
34+
run: |
35+
echo ${{ inputs.DOCKERHUB_PASSWORD }} | docker login -u ${{ inputs.DOCKERHUB_USERNAME }} --password-stdin
36+
docker push ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_IMAGE_TAG }}
37+
docker push ${{ inputs.DOCKERHUB_ORGANISATION }}/deriv-com-api:${{ inputs.DOCKER_LATEST_IMAGE_TAG }}
38+
shell: bash

.github/workflows/release_production.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ jobs:
3333
with:
3434
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3535
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
36+
- name: Publish to Docker
37+
uses: ./.github/actions/publish_to_docker
38+
with:
39+
DOCKER_LATEST_IMAGE_TAG: 'latest'
40+
DOCKER_IMAGE_TAG: ${{ github.ref_name }}
41+
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
42+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
43+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
44+
- name: Deploy to Kubernetes
45+
uses: ./.github/actions/deploy_to_kubernetes
46+
with:
47+
K8S_VERSION: ${{ github.ref_name }}
48+
K8S_NAMESPACE: 'deriv-com-api-production'
49+
CA_CRT: ${{ secrets.CA_CRT }}
50+
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
51+
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
52+
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
53+
3654
send_slack_notification:
3755
name: Send Slack Notification
3856
environment: Production

.github/workflows/release_staging.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,20 @@ jobs:
2626
with:
2727
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
2828
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
29+
- name: Publish to Docker
30+
uses: ./.github/actions/publish_to_docker
31+
with:
32+
DOCKER_LATEST_IMAGE_TAG: 'latest-staging'
33+
DOCKER_IMAGE_TAG: ${{ github.ref_name }}
34+
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}
35+
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
36+
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
37+
- name: Deploy to Kubernetes
38+
uses: ./.github/actions/deploy_to_kubernetes
39+
with:
40+
K8S_VERSION: ${{ github.ref_name }}
41+
K8S_NAMESPACE: 'deriv-com-api-staging'
42+
CA_CRT: ${{ secrets.CA_CRT }}
43+
SERVICEACCOUNT_TOKEN: ${{ secrets.SERVICEACCOUNT_TOKEN }}
44+
KUBE_SERVER: ${{ secrets.KUBE_SERVER }}
45+
DOCKERHUB_ORGANISATION: ${{ secrets.DOCKERHUB_ORGANISATION }}

_data/v3.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ groups:
4949
title: 'Copy Trading: Statistics'
5050
- name: crypto_config
5151
title: Cryptocurrency configurations
52+
- name: crypto_estimations
53+
title: Cryptocurrency Estimations
5254
- name: document_upload
5355
title: Document Upload
5456
- name: economic_calendar

config/v3/active_symbols/send.json

Lines changed: 59 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,62 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"title": "Active Symbols (request)",
4-
"description": "Retrieve a list of all currently active symbols (underlying markets upon which contracts are available for trading).",
5-
"type": "object",
6-
"auth_required": 0,
7-
"additionalProperties": false,
8-
"required": [
9-
"active_symbols"
10-
],
11-
"properties": {
12-
"active_symbols": {
13-
"description": "If you use `brief`, only a subset of fields will be returned.",
14-
"type": "string",
15-
"enum": [
16-
"brief",
17-
"full"
18-
]
19-
},
20-
"landing_company": {
21-
"description": "Deprecated - replaced by landing_company_short.",
22-
"type": "string",
23-
"enum": [
24-
"iom",
25-
"malta",
26-
"maltainvest",
27-
"svg",
28-
"virtual",
29-
"vanuatu",
30-
"champion",
31-
"champion-virtual"
32-
]
33-
},
34-
"landing_company_short": {
35-
"description": "[Optional] If you specify this field, only symbols available for trading by that landing company will be returned. If you are logged in, only symbols available for trading by your landing company will be returned regardless of what you specify in this field.",
36-
"type": "string",
37-
"enum": [
38-
"iom",
39-
"malta",
40-
"maltainvest",
41-
"svg",
42-
"virtual",
43-
"vanuatu",
44-
"champion",
45-
"champion-virtual"
46-
]
47-
},
48-
"product_type": {
49-
"description": "[Optional] If you specify this field, only symbols that can be traded through that product type will be returned.",
50-
"type": "string",
51-
"enum": [
52-
"basic"
53-
]
54-
},
55-
"passthrough": {
56-
"description": "[Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field. Maximum size is 3500 bytes.",
57-
"type": "object",
58-
"maxSize": 3500
59-
},
60-
"req_id": {
61-
"description": "[Optional] Used to map request to response.",
62-
"type": "integer"
63-
}
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "Active Symbols (request)",
4+
"description": "Retrieve a list of all currently active symbols (underlying markets upon which contracts are available for trading).",
5+
"type": "object",
6+
"auth_required": 0,
7+
"additionalProperties": false,
8+
"required": ["active_symbols"],
9+
"properties": {
10+
"active_symbols": {
11+
"description": "If you use `brief`, only a subset of fields will be returned.",
12+
"type": "string",
13+
"enum": ["brief", "full"]
14+
},
15+
"landing_company": {
16+
"description": "Deprecated - replaced by landing_company_short.",
17+
"type": "string",
18+
"enum": [
19+
"iom",
20+
"malta",
21+
"maltainvest",
22+
"svg",
23+
"virtual",
24+
"vanuatu",
25+
"champion",
26+
"champion-virtual"
27+
]
28+
},
29+
"landing_company_short": {
30+
"description": "[Optional] If you specify this field, only symbols available for trading by that landing company will be returned. If you are logged in, only symbols available for trading by your landing company will be returned regardless of what you specify in this field.",
31+
"type": "string",
32+
"enum": [
33+
"iom",
34+
"malta",
35+
"maltainvest",
36+
"svg",
37+
"virtual",
38+
"vanuatu",
39+
"champion",
40+
"champion-virtual"
41+
]
42+
},
43+
"product_type": {
44+
"description": "[Optional] If you specify this field, only symbols that can be traded through that product type will be returned.",
45+
"type": "string",
46+
"enum": ["basic"]
47+
},
48+
"loginid": {
49+
"description": "[Optional] The login id of the user. If left unspecified, it defaults to the initial authorized token's login id.",
50+
"type": "string",
51+
"pattern": "^[A-Za-z]+[0-9]+$"
52+
},
53+
"passthrough": {
54+
"description": "[Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field. Maximum size is 3500 bytes.",
55+
"type": "object"
56+
},
57+
"req_id": {
58+
"description": "[Optional] Used to map request to response.",
59+
"type": "integer"
6460
}
61+
}
6562
}

config/v3/api_token/send.json

Lines changed: 52 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,55 @@
11
{
2-
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"title": "API Token (request)",
4-
"description": "This call manages API tokens",
5-
"type": "object",
6-
"auth_required": 1,
7-
"auth_scopes": [
8-
"admin"
9-
],
10-
"additionalProperties": false,
11-
"required": [
12-
"api_token"
13-
],
14-
"properties": {
15-
"api_token": {
16-
"description": "Must be `1`",
17-
"type": "integer",
18-
"enum": [
19-
1
20-
]
21-
},
22-
"delete_token": {
23-
"description": "[Optional] The token to remove.",
24-
"type": "string",
25-
"pattern": "^\\w+$"
26-
},
27-
"new_token": {
28-
"description": "[Optional] The name of the created token.",
29-
"type": "string",
30-
"pattern": "^[A-Za-z0-9\\s_]+$"
31-
},
32-
"new_token_scopes": {
33-
"description": "[Optional] List of permission scopes to provide with the token.",
34-
"type": "array",
35-
"items": {
36-
"description": "Required when create new token",
37-
"type": "string",
38-
"enum": [
39-
"read",
40-
"trade",
41-
"trading_information",
42-
"payments",
43-
"admin"
44-
]
45-
},
46-
"uniqueItems": true
47-
},
48-
"valid_for_current_ip_only": {
49-
"description": "[Optional] If you set this parameter during token creation, then the token created will only work for the IP address that was used to create the token",
50-
"type": "integer",
51-
"enum": [
52-
0,
53-
1
54-
]
55-
},
56-
"passthrough": {
57-
"description": "[Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field. Maximum size is 3500 bytes.",
58-
"type": "object",
59-
"maxSize": 3500
60-
},
61-
"req_id": {
62-
"description": "[Optional] Used to map request to response.",
63-
"type": "integer"
64-
}
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "API Token (request)",
4+
"description": "This call manages API tokens",
5+
"type": "object",
6+
"auth_required": 1,
7+
"auth_scopes": ["admin"],
8+
"additionalProperties": false,
9+
"required": ["api_token"],
10+
"properties": {
11+
"api_token": {
12+
"description": "Must be `1`",
13+
"type": "integer",
14+
"enum": [1]
15+
},
16+
"delete_token": {
17+
"description": "[Optional] The token to remove.",
18+
"type": "string",
19+
"pattern": "^\\w+$"
20+
},
21+
"new_token": {
22+
"description": "[Optional] The name of the created token.",
23+
"type": "string",
24+
"pattern": "^[A-Za-z0-9\\s_]+$"
25+
},
26+
"new_token_scopes": {
27+
"description": "[Optional] List of permission scopes to provide with the token.",
28+
"type": "array",
29+
"items": {
30+
"description": "Required when create new token",
31+
"type": "string",
32+
"enum": ["read", "trade", "trading_information", "payments", "admin"]
33+
},
34+
"uniqueItems": true
35+
},
36+
"valid_for_current_ip_only": {
37+
"description": "[Optional] If you set this parameter during token creation, then the token created will only work for the IP address that was used to create the token",
38+
"type": "integer",
39+
"enum": [0, 1]
40+
},
41+
"loginid": {
42+
"description": "[Optional] The login id of the user. If left unspecified, it defaults to the initial authorized token's login id.",
43+
"type": "string",
44+
"pattern": "^[A-Za-z]+[0-9]+$"
45+
},
46+
"passthrough": {
47+
"description": "[Optional] Used to pass data through the websocket, which may be retrieved via the `echo_req` output field. Maximum size is 3500 bytes.",
48+
"type": "object"
49+
},
50+
"req_id": {
51+
"description": "[Optional] Used to map request to response.",
52+
"type": "integer"
6553
}
54+
}
6655
}

0 commit comments

Comments
 (0)