Skip to content

Commit

Permalink
Redirect marketplace (#1193)
Browse files Browse the repository at this point in the history
* max

* lint fix

* remove marketplace

* remove marketplace files

* firebase redirect

* serl

* revert contributors

* create docs with new marketplace

* fix ut
  • Loading branch information
MosheEichler authored Oct 2, 2022
1 parent 8cc058f commit 7f6c904
Show file tree
Hide file tree
Showing 14 changed files with 316 additions and 2,412 deletions.
5 changes: 0 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ jobs:
command: |
nvm use
npm run reference-docs
- run:
name: NPM Build marketplace docs
command: |
nvm use
npm run marketplace-docs
- run:
name: NPM Build
no_output_timeout: 80m
Expand Down
21 changes: 0 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,6 @@ Additional env vars that affect the generation of the docs:
```bash
SKIP_DEPRECATED=true MAX_FILES=10 CONTENT_REPO_DIR=~/dev/demisto/content npm run reference-docs
```


## Generating Marketplace Docs
Marketplace docs are generated from the content google cloud bucket. If you are working on general site docs which are not related to marketplace, you don't need to run this step to preview the marketplace tab.

To generate the docs we use [pipenv](https://github.com/pypa/pipenv). Make sure to install pipenv by running: `pip3 install pipenv`.

When working locally you can generate the reference docs by running:
```
npm run marketplace-docs
```
This task will download the packs information from the google cloud bucket and generate the packs docs for the marketplace tab. The generated docs are ignored by `.gitignore` and shouldn't be checked in as they are generated during the build.

Additional env vars that affect the generation of the docs:
* `MAX_PACKS`: max packs to generate in the marketplace tab. Set this for faster generation when developing. Note also in CI builds on branches this is automatically set to speed up the preview site if there are only modifications related to docs. For example:

```export MAX_PACKS=10 && npm run marketplace-docs```

```
NOTE : When running locally, in order to see links from the entities in the marketplace to their corresponding README in the reference section, you will need to run the reference-docs script before running the marketplace-docs script.
```

### Generation Code
Code used for generating content reference docs is written in Python and resides in the `content-repo` folder. To set up a development environment we use [pipenv](https://github.com/pypa/pipenv). Make sure to install pipenv by running: `pip3 install pipenv`. Setup a proper Python env by running:
Expand Down
2 changes: 1 addition & 1 deletion content-repo/gendocs.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def timestamped_print(*args, **kwargs):
print = timestamped_print

BASE_URL = "https://xsoar.pan.dev/docs/"
MARKETPLACE_URL = "https://xsoar.pan.dev/marketplace/"
MARKETPLACE_URL = "https://cortex.marketplace.pan.dev/marketplace/"
DOCS_LINKS_JSON = {}

INTEGRATION_YML_MATCH = [
Expand Down
50 changes: 25 additions & 25 deletions content-repo/gendocs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,23 +118,23 @@ def test_findfiles():
@pytest.mark.parametrize(
'integration_yml_path_and_expected_content_info', [
(
'deprecated-integration',
{
'deprecated': True,
'description': 'Deprecated. Use the Generic Export Indicators Service integration instead. '
'Use the Export Indicators Service integration to provide an endpoint '
'with a list of indicators as a service for the system indicators.',
'fromversion': '6.0.0'
},
':::caution Deprecated\nUse the Generic Export Indicators Service integration instead.\n:::\n\n'
'deprecated-integration',
{
'deprecated': True,
'description': 'Deprecated. Use the Generic Export Indicators Service integration instead. '
'Use the Export Indicators Service integration to provide an endpoint '
'with a list of indicators as a service for the system indicators.',
'fromversion': '6.0.0'
},
':::caution Deprecated\nUse the Generic Export Indicators Service integration instead.\n:::\n\n'
),
(
'6-0-0-integration',
{
'fromversion': '6.0.0',
'description': 'Manage Alibaba Cloud Elastic Compute Instances'
},
':::info Supported versions\nSupported Cortex XSOAR versions: 6.0.0 and later.\n:::\n\n'
'6-0-0-integration',
{
'fromversion': '6.0.0',
'description': 'Manage Alibaba Cloud Elastic Compute Instances'
},
':::info Supported versions\nSupported Cortex XSOAR versions: 6.0.0 and later.\n:::\n\n'
)
],
indirect=True
Expand Down Expand Up @@ -440,19 +440,19 @@ def test_get_extracted_deprecated_note():

@pytest.mark.parametrize("test_input, expected, metadata_name", [
('Packs/TestPack/Integrations/TestIntegration/README.md',
'#### This Integration is part of the **[TestPack](https://xsoar.pan.dev/marketplace/details/TestPack)** Pack.\n\n',
'#### This Integration is part of the **[TestPack](https://cortex.marketplace.pan.dev/marketplace/details/TestPack)** Pack.\n\n',
'TestPack'),
('tmp_path/Packs/TestPack/Playbooks/TestIntegration/README.md',
'#### This Playbook is part of the **[TestPack](https://xsoar.pan.dev/marketplace/details/TestPack)** Pack.\n\n',
'#### This Playbook is part of the **[TestPack](https://cortex.marketplace.pan.dev/marketplace/details/TestPack)** Pack.\n\n',
'TestPack'),
('content/Packs/TestPack/Scripts/TestIntegration/README.md',
'#### This Script is part of the **[TestPack](https://xsoar.pan.dev/marketplace/details/TestPack)** Pack.\n\n',
'#### This Script is part of the **[TestPack](https://cortex.marketplace.pan.dev/marketplace/details/TestPack)** Pack.\n\n',
'TestPack'),
('Packs/Test-Pack/Scripts/TestIntegration/README.md',
'#### This Script is part of the **[Test - Pack](https://xsoar.pan.dev/marketplace/details/TestPack)** Pack.\n\n',
'#### This Script is part of the **[Test - Pack](https://cortex.marketplace.pan.dev/marketplace/details/TestPack)** Pack.\n\n',
'Test - Pack'),
('Packs/Test_Pack/Scripts/TestIntegration/README.md',
'#### This Script is part of the **[Test Pack](https://xsoar.pan.dev/marketplace/details/Test_Pack)** Pack.\n\n',
'#### This Script is part of the **[Test Pack](https://cortex.marketplace.pan.dev/marketplace/details/Test_Pack)** Pack.\n\n',
'Test Pack')
])
def test_get_pack_link(test_input, expected, metadata_name, mocker):
Expand All @@ -476,19 +476,19 @@ def error_raising_func(pack_dir, xsoar_marketplace):

@pytest.mark.parametrize("test_input, expected", [
('Packs/TestPack/Integrations/TestIntegration/README.md',
'#### This Integration is part of the **[TestPack](https://xsoar.pan.dev/marketplace/details/TestPack)** Pack.\n\n'
'#### This Integration is part of the **[TestPack](https://cortex.marketplace.pan.dev/marketplace/details/TestPack)** Pack.\n\n'
),
('tmp_path/Packs/TestPack/Playbooks/TestIntegration/README.md',
'#### This Playbook is part of the **[TestPack](https://xsoar.pan.dev/marketplace/details/TestPack)** Pack.\n\n'
'#### This Playbook is part of the **[TestPack](https://cortex.marketplace.pan.dev/marketplace/details/TestPack)** Pack.\n\n'
),
('content/Packs/TestPack/Scripts/TestIntegration/README.md',
'#### This Script is part of the **[TestPack](https://xsoar.pan.dev/marketplace/details/TestPack)** Pack.\n\n'
'#### This Script is part of the **[TestPack](https://cortex.marketplace.pan.dev/marketplace/details/TestPack)** Pack.\n\n'
),
('Packs/Test-Pack/Scripts/TestIntegration/README.md',
'#### This Script is part of the **[Test - Pack](https://xsoar.pan.dev/marketplace/details/TestPack)** Pack.\n\n'
'#### This Script is part of the **[Test - Pack](https://cortex.marketplace.pan.dev/marketplace/details/TestPack)** Pack.\n\n'
),
('Packs/Test_Pack/Scripts/TestIntegration/README.md',
'#### This Script is part of the **[Test Pack](https://xsoar.pan.dev/marketplace/details/Test_Pack)** Pack.\n\n'
'#### This Script is part of the **[Test Pack](https://cortex.marketplace.pan.dev/marketplace/details/Test_Pack)** Pack.\n\n'
)
])
def test_get_pack_link_no_metadata(mocker, test_input, expected):
Expand Down
5 changes: 3 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ module.exports = {
activeBaseRegex: "docs/reference/(index|api|integrations|playbooks|releases|scripts)"
},
{
to: "/marketplace",
to: "https://cortex.marketplace.pan.dev/marketplace",
label: "Marketplace",
position: "left"
position: "left",
target: '_self'
},
{
label: "Products",
Expand Down
Loading

0 comments on commit 7f6c904

Please sign in to comment.