Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What is admin.deployCommand? #70

Closed
jaxonly opened this issue May 14, 2016 · 4 comments
Closed

What is admin.deployCommand? #70

jaxonly opened this issue May 14, 2016 · 4 comments

Comments

@jaxonly
Copy link

jaxonly commented May 14, 2016

What is admin.deployCommand?

@grinka
Copy link

grinka commented May 16, 2016

image

I have the problem with admin.deployCommand too.

@grinka
Copy link

grinka commented May 16, 2016

I've found the like with deployCommand here: https://github.com/jaredly/hexo-admin/blob/8312967c7f707418dbb6ae5116e03292862d9dc4/api.js

use('deploy', function(req, res, next) {
    if (req.method !== 'POST') return next()
    if (!hexo.config.admin || !hexo.config.admin.deployCommand) {
      return res.done({error: 'Config value "admin.deployCommand" not found'});
    }
    try {
      deploy(hexo.config.admin.deployCommand, req.body.message, function(err, result) {
        console.log('res', err, result);
        if (err) {
          return res.done({error: err.message || err})
        }
        res.done(result);
      });
    } catch (e) {
      console.log('EEE', e);
      res.done({error: e.message})
    }
  });

I tried to fill the admin section with different values of this parameter - nothing seems to work. Unfortunately.

@vladpurga
Copy link

vladpurga commented May 20, 2016

create deploy-script in project dir:
$ touch hexo-deploy.sh; chmod a+x hexo-deploy.sh

with such 2 lines for example or any custom code:

#!/usr/bin/env sh
hexo deploy

and edit _config.yml:

admin:
  deployCommand: './hexo-deploy.sh'

@pirtleshell
Copy link
Collaborator

This appears sufficiently answered thanks to @vladpurga. The deploy command is any command you'd like run on the terminal. Placing many commands in a bash script or batch file is a great way to do it.

Be aware that Windows does not use hashbangs (telling how to execute the file with the first line of a file, the #!/usr/bin/env sh in the example above). Thus, you'll need to play with what command will execute properly, perhaps by using a batch file or prefacing your hexo command with node.exe or some other Windows-recognized executable command.

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

No branches or pull requests

4 participants