Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

[help-needed] Button for deploy specific folder #25

Closed
vystepanenko opened this issue Feb 14, 2018 · 7 comments
Closed

[help-needed] Button for deploy specific folder #25

vystepanenko opened this issue Feb 14, 2018 · 7 comments

Comments

@vystepanenko
Copy link

vystepanenko commented Feb 14, 2018

Hello!
I want to create a button to deploy specific folder from anywhere in project. Is this possible?

I'll try to do the following

Example config

{
    "deploy.reloaded": {
        "packages": [
            {
                "name": "Public to test",
                
                "button": {
                    "text": "Deploy to 'test'",
                    "tooltip": "Click here to deploy to the target...",
                    "targets": [ "Test" ]
                }
            }
        ],
        "targets": [
            {
                "type": "sftp",
                "name": "Test",
                "description": "Test server",
                "dir": "/var/www/html/myProject",
                "mappings": {
                    "/public": "/public"
                }
            }          
        ]
       }
} 

But it deploy all my project to server instead one folder

Your environment

  • Operating system: Windows 10
  • Visual Studio Code version: 1.20.1
  • Extension version: 0.50.0
@mkloubert
Copy link
Owner

@vystepanenko

You have to specify glob patterns in files (and maybe exclude) properties of your package:

{
    "deploy.reloaded": {
        "packages": [
            {
                "name": "Public to test",

                "files": [
                    "js/*.js",
                    "css/*.css",
                    "**/*.html",
                ],

                "exclude": [
                    "**/*.map",
                ],
                
                "button": {
                    "text": "Deploy to 'test'",
                    "tooltip": "Click here to deploy to the target...",
                    "targets": [ "Test" ]
                }
            }
        ],

        "targets": [
            {
                "type": "sftp",
                "name": "Test",
                "description": "Test server",
                "dir": "/var/www/html/myProject"
            }          
        ]
    }
} 

Folder mappings only make sense if you want to map a local folder to another one:

{
    "deploy.reloaded": {
        // ...

        "targets": [
            {
                "type": "sftp",
                "name": "Test",
                "description": "Test server",
                "dir": "/var/www/html/myProject",

                "mappings": {
                    "/html/**": "/PUBLIC"
                }
            }          
        ]
    }
} 

Anything that is part of /html inside your workspace, will be deployed to /var/www/html/myProject/PUBLIC.

@vystepanenko
Copy link
Author

thnx. I specified glob patterns in files properties and its work.
But I have several targets and when I pres button it still asked me to what exactly target i want to deploy

@mkloubert
Copy link
Owner

@vystepanenko

Oh ... the feature with the defined target, as described in the wiki, is not implemented yet ... I will try to implement this in the next hours.

@mkloubert
Copy link
Owner

@vystepanenko

The feature is available since version 0.51.0.

As defined in your example config, the button should only deploy to Test target now.

@vystepanenko
Copy link
Author

thnx. it's really fast)

ps. maybe you know when it will be available in VSC?

@mkloubert
Copy link
Owner

@vystepanenko

The new version is published and available.

Select Extensions tab on the left side (CTRL + Shift + X) and search for vscode-deploy-reloaded and you should see an "upgrade button".

If this does not work, simply reinstall it.

@vystepanenko
Copy link
Author

Seems it was some issue with my VSC. All works after I restart it

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants