VSCode tasks. Run services and upload addons

Hey guys,
This guide inspired me to use vscode tasks more.

you can find my vscode setup here :wink:

My old setup

I’m using the following task to create and upload addon zips to my server.
upload feature is not built into default create_package.py therefore I had to implement upload_addon.py

anyways, these tasks simply

  • run create_package.py
  • run upload_addon.py
{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Create addon",
            "type": "shell",
            "command": "python",
            "args": [
                "${cwd}/create_package.py",
            ],
            "problemMatcher": []
        },
        {
            "label": "Upload addon",
            "type": "shell",
            "command": "python",
            "args": [
                "E:/Ynput/ayon-helper-scripts/upload_addon.py",  // find upload_addon.py in https://gist.github.com/MustafaJafar/be7989dbee17b1bfb574612f978c77d1
                "--addon-dir",
                "${cwd}/package",
                "--addon-version",
                "${input:addon_version}"
            ],
            "problemMatcher": []
        }
    ],
    "inputs": [

        {
            "id": "addon_version",
            "description": "",
            "default": "ayon_third_party-1.1.2-dev.1",
            "type": "promptString"
        }
    ]
}

and, I’m using it on daily basis in every addon clone on my disk.
I’ve also tweaked it a little to use it in ayon core

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Create core addon",
            "type": "shell",
            "command": "python",
            "args": [
                "${cwd}/create_package.py",
            ],
            "problemMatcher": []
        },
        {
            "label": "Upload core addon",
            "type": "shell",
            "command": "python",
            "args": [
                "E:/Ynput/ayon-helper-scripts/upload_addon.py",  // find upload_addon.py in https://gist.github.com/MustafaJafar/be7989dbee17b1bfb574612f978c77d1
                "--addon-dir",
                "${cwd}/package",
                "--addon-version",
                "${input:core_addon}"
            ],
            "problemMatcher": []
        },
        {
            "label": "Create other addon",
            "type": "shell",
            "command": "python",
            "args": [
                "${cwd}/server_addon/create_ayon_addons.py",
                "--addon",
                "${input:addon}"
            ],
            "problemMatcher": []
        },
        {
            "label": "Upload other addon",
            "type": "shell",
            "command": "python",
            "args": [
                "E:/Ynput/ayon-helper-scripts/upload_addon.py",  // find upload_addon.py in https://gist.github.com/MustafaJafar/be7989dbee17b1bfb574612f978c77d1
                "--addon-dir",
                "${cwd}/server_addon/packages",
                "--addon-version",
                "${input:other_addon}"
            ],
            "problemMatcher": []
        }
    ],
    "inputs": [
        {
            "id": "core_addon",
            "description": "",
            "default": "core-0.3.3-dev.1",
            "type": "promptString"
        },
        {
            "id": "other_addon",
            "description": "",
            "default": "houdini-0.3.1",
            "type": "promptString"
        },
        {
            "id": "addon",
            "description": "",
            "default": "houdini",
            "type": "promptString"
        },
    ]
}
1 Like