Advertisement
Guest User

Untitled

a guest
May 14th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. 'use strict';
  2. const DPLOY = require("dploy");
  3. const git = require('git-last-commit');
  4. const MY_SLACK_WEBHOOK_URL = 'https://hooks.slack.com/services/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';
  5. const slack = require('slack-notify')(MY_SLACK_WEBHOOK_URL);
  6.  
  7. // Set your project name here
  8. const project_slug = 'kliker';
  9.  
  10. const settings = {
  11. scheme: 'sftp',
  12. host: '188.93.125.50',
  13. port: 22,
  14. user: 'root',
  15. pass: 'Zr5xXVNCwWqn',
  16. exclude: ['dploy.js', 'dploy-live.js', 'wp-config.php', 'node_modules/'], // So these files aren't deployed
  17. slots: 10,
  18. path: {
  19. local: '',
  20. remote: '/var/vvv/desgsr/' + project_slug
  21. }
  22. }
  23.  
  24. git.getLastCommit(function(err, commit) {
  25. new DPLOY(settings, function() {
  26. slack.send({
  27. channel: '#desgsr', // Slack channel name
  28. text: `New changes: "${commit.subject}" are on staging site: http://www.desgsr.com/${project_slug}`, // Staging url
  29. icon_url: 'http://www.degordian.com/static/img/logo-degordian_d@2x.png',
  30. username: 'Deployed by - '+commit.author.name,
  31. });
  32. });
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement