Skip to content

Commit

Permalink
Main build (Jenkins)
Browse files Browse the repository at this point in the history
  • Loading branch information
VitalyTheAlpaca committed Feb 23, 2025
1 parent 4eff95b commit 5ac41b2
Show file tree
Hide file tree
Showing 51 changed files with 8,527 additions and 7,303 deletions.
62 changes: 60 additions & 2 deletions .github/workflows/oint_test_full_en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1451,9 +1451,51 @@ jobs:
key: logs-TCP
path: ./docs/en/results/TCP


Testing-GreenAPI:
runs-on: ubuntu-latest
needs: [Decode, Build]
steps:

- uses: actions/checkout@v2
- uses: otymko/[email protected]
with:
version: 1.9.1

- name: Получить тестовые данные из кэша
uses: actions/cache/restore@v3
with:
key: test-data
path: ./data.json

- name: Установить asserts и 1testrunner
run: |
opm install asserts
opm install 1testrunner
- name: Установить OInt
run: |
TEMP_DEB="$(mktemp)" &&
wget -O "$TEMP_DEB" 'https://api.athenaeum.digital/tc/job/Release/lastSuccessfulBuild/artifact/1.20.0/oint_1.20.0_all_en.deb' &&
sudo dpkg -i "$TEMP_DEB"
rm -f "$TEMP_DEB"
- name: Account
if: ${{ cancelled() }} == false
run: oscript /home/runner/.local/share/ovm/current/lib/1testrunner/src/main.os -run ./src/en/OInt/tests/Modules/internal/OPI_TestsCLI.os "CLI_GAPI_Account"

- name: Записать логи
if: ${{ cancelled() }} == false
uses: actions/cache/save@v3
with:
key: logs-GreenAPI
path: ./docs/en/results/GreenAPI

Encode:
runs-on: ubuntu-latest
needs: [Testing-Telegram,Testing-VK,Testing-Viber,Testing-Twitter,Testing-PostgreSQL,Testing-SQLite,Testing-YandexDisk,Testing-GoogleWorkspace,Testing-GoogleCalendar,Testing-GoogleDrive,Testing-GoogleSheets,Testing-Notion,Testing-Slack,Testing-Airtable,Testing-Dropbox,Testing-Bitrix24,Testing-VkTeams,Testing-Ozon,Testing-Neocities,Testing-CDEK,Testing-YandexMetrika,Testing-S3,Testing-TCP]
needs: [Testing-Telegram,Testing-VK,Testing-Viber,Testing-Twitter,Testing-PostgreSQL,Testing-SQLite,Testing-YandexDisk,Testing-GoogleWorkspace,Testing-GoogleCalendar,Testing-GoogleDrive,Testing-GoogleSheets,Testing-Notion,Testing-Slack,Testing-Airtable,Testing-Dropbox,Testing-Bitrix24,Testing-VkTeams,Testing-Ozon,Testing-Neocities,Testing-CDEK,Testing-YandexMetrika,Testing-S3,Testing-TCP,Testing-GreenAPI]
if: ${{ always() }}
permissions:
contents: write
Expand Down Expand Up @@ -1849,6 +1891,22 @@ jobs:
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/Bayselonarrend/OpenIntegrations/actions/caches?key=logs-TCP"
- name: Получить логи GreenAPI
uses: actions/cache/restore@v3
with:
key: logs-GreenAPI
path: ./docs/en/results/GreenAPI


- name: Очистка логов GreenAPI
run: |
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/Bayselonarrend/OpenIntegrations/actions/caches?key=logs-GreenAPI"
- name: Записать данные
uses: stefanzweifel/git-auto-commit-action@v5
Expand All @@ -1861,7 +1919,7 @@ jobs:

Clear-Cache:
runs-on: ubuntu-latest
needs: [Testing-Telegram, Testing-VK, Testing-Viber, Testing-Twitter, Testing-PostgreSQL, Testing-SQLite, Testing-YandexDisk, Testing-GoogleWorkspace, Testing-GoogleCalendar, Testing-GoogleDrive, Testing-GoogleSheets, Testing-Notion, Testing-Slack, Testing-Airtable, Testing-Dropbox, Testing-Bitrix24, Testing-VkTeams, Testing-Ozon, Testing-Neocities, Testing-CDEK, Testing-YandexMetrika, Testing-S3, Testing-TCP, Encode]
needs: [Testing-Telegram, Testing-VK, Testing-Viber, Testing-Twitter, Testing-PostgreSQL, Testing-SQLite, Testing-YandexDisk, Testing-GoogleWorkspace, Testing-GoogleCalendar, Testing-GoogleDrive, Testing-GoogleSheets, Testing-Notion, Testing-Slack, Testing-Airtable, Testing-Dropbox, Testing-Bitrix24, Testing-VkTeams, Testing-Ozon, Testing-Neocities, Testing-CDEK, Testing-YandexMetrika, Testing-S3, Testing-TCP, Testing-GreenAPI, Encode]
if: ${{ always() }}
steps:
- name: Очистка основного кэша
Expand Down
11 changes: 11 additions & 0 deletions ci/cli_ostesten
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,17 @@ pipeline {
}
}

stage('Testing-GreenAPI') {
steps {


catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'1testrunner -run "./src/en/OInt/tests/Modules/internal/OPI_TestsCLI.os" "CLI_GAPI_Account"'
}

}
}

}
post{
always{
Expand Down
16 changes: 16 additions & 0 deletions ci/clitesten
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,22 @@ def test_greenapi(){
powershell encoding: 'UTF-8', script:'./oint.exe greenapi SetInstanceSettings --settings "test" --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi GetInstanceStatus --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi RebootInstance --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi LogoutInstance --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi GetQR --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi GetInstanceSettingsStructure --empty "test" --debug --test '
}
Expand Down
16 changes: 16 additions & 0 deletions ci/clitestru
Original file line number Diff line number Diff line change
Expand Up @@ -1445,6 +1445,22 @@ def test_greenapi(){
powershell encoding: 'UTF-8', script:'./oint.exe greenapi УстановитьНастройкиИнстанса --settings "test" --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi ПолучитьСостояниеИнстанса --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi ПерезапуститьИнстанс --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi РазлогинитьИнстанс --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi ПолучитьQR --access "test" --debug --test '
}

catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'./oint.exe greenapi ПолучитьСтруктуруНастроекИнстанса --empty "test" --debug --test '
}
Expand Down
11 changes: 11 additions & 0 deletions ci/ostesten
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,17 @@ pipeline {
}
}

stage('Testing-GreenAPI') {
steps {


catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
powershell encoding: 'UTF-8', script:'1testrunner -run "./src/en/OInt/tests/Modules/internal/OPI_Tests.os" "GAPI_Account"'
}

}
}

}
post{
always{
Expand Down
6 changes: 6 additions & 0 deletions docs/en/data/GreenAPI/GetInstanceStatus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ApiUrl": "https://7105.api.greenapi.com",
"MediaUrl": "https://7105.media.greenapi.com",
"IdInstance": "71051...",
"ApiTokenInstance": "425010d90e114aa6b78f0969e..."
}
6 changes: 6 additions & 0 deletions docs/en/data/GreenAPI/GetQR.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ApiUrl": "https://7105.api.greenapi.com",
"MediaUrl": "https://7105.media.greenapi.com",
"IdInstance": "71051...",
"ApiTokenInstance": "425010d90e114aa6b78f0969e..."
}
6 changes: 6 additions & 0 deletions docs/en/data/GreenAPI/LogoutInstance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ApiUrl": "https://7105.api.greenapi.com",
"MediaUrl": "https://7105.media.greenapi.com",
"IdInstance": "71051...",
"ApiTokenInstance": "425010d90e114aa6b78f0969e..."
}
6 changes: 6 additions & 0 deletions docs/en/data/GreenAPI/RebootInstance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ApiUrl": "https://7105.api.greenapi.com",
"MediaUrl": "https://7105.media.greenapi.com",
"IdInstance": "71051...",
"ApiTokenInstance": "425010d90e114aa6b78f0969e..."
}
7 changes: 7 additions & 0 deletions docs/en/examples/GreenAPI/GetInstanceStatus.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
 ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";

AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.GetInstanceStatus(AccessParameters);
7 changes: 7 additions & 0 deletions docs/en/examples/GreenAPI/GetQR.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
 ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";

AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.GetQR(AccessParameters);
7 changes: 7 additions & 0 deletions docs/en/examples/GreenAPI/LogoutInstance.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
 ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";

AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.LogoutInstance(AccessParameters);
7 changes: 7 additions & 0 deletions docs/en/examples/GreenAPI/RebootInstance.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
 ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";

AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.RebootInstance(AccessParameters);
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 4
sidebar_position: 8
---

import Tabs from '@theme/Tabs';
Expand Down
44 changes: 44 additions & 0 deletions docs/en/md/Green_API/Account/Get-instance-status.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
sidebar_position: 4
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Get instance status
Gets instance status



`Function GetInstanceStatus(Val AccessParameters) Export`

| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | ✔ | Access parameters. See FormAccessParameters |


Returns: Map Of KeyAndValue - serialized JSON response from Green API

<br/>

:::tip
Method at API documentation: [GetStateInstance](https://green-api.com/docs/api/account/GetStateInstance/)
:::
<br/>



```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.GetInstanceStatus(AccessParameters);
```





44 changes: 44 additions & 0 deletions docs/en/md/Green_API/Account/Get-qr.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
sidebar_position: 7
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Get QR
Receives authorization QR code



`Function GetQR(Val AccessParameters) Export`

| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |


Returns: BinaryData, Map Of KeyAndValue - QR code or error information

<br/>

:::tip
Method at API documentation: [QR](https://green-api.com/docs/api/account/QR/)
:::
<br/>



```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.GetQR(AccessParameters);
```





44 changes: 44 additions & 0 deletions docs/en/md/Green_API/Account/Logout-instance.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
sidebar_position: 6
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Logout instance
Unlogging the instance



`Function LogoutInstance(Val AccessParameters) Export`

| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| AccessParameters | --access | Structure Of KeyAndValue | &#x2714; | Access parameters. See FormAccessParameters |


Returns: Map Of KeyAndValue - serialized JSON response from Green API

<br/>

:::tip
Method at API documentation: [Logout](https://green-api.com/docs/api/account/Logout/)
:::
<br/>



```bsl title="1C:Enterprise/OneScript code example"
ApiUrl = "https://7105.api.greenapi.com";
MediaUrl = "https://7105.media.greenapi.com";
IdInstance = "71051...";
ApiTokenInstance = "425010d90e114aa6b78f0969e...";
AccessParameters = OPI_GreenAPI.FormAccessParameters(ApiUrl, MediaUrl, IdInstance, ApiTokenInstance);
Result = OPI_GreenAPI.LogoutInstance(AccessParameters);
```





Loading

0 comments on commit 5ac41b2

Please sign in to comment.