Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict';
- const DPLOY = require("dploy");
- const git = require('git-last-commit');
- const MY_SLACK_WEBHOOK_URL = 'https://hooks.slack.com/services/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';
- const slack = require('slack-notify')(MY_SLACK_WEBHOOK_URL);
- // Set your project name here
- const project_slug = 'kliker';
- const settings = {
- scheme: 'sftp',
- host: '188.93.125.50',
- port: 22,
- user: 'root',
- pass: 'Zr5xXVNCwWqn',
- exclude: ['dploy.js', 'dploy-live.js', 'wp-config.php', 'node_modules/'], // So these files aren't deployed
- slots: 10,
- path: {
- local: '',
- remote: '/var/vvv/desgsr/' + project_slug
- }
- }
- git.getLastCommit(function(err, commit) {
- new DPLOY(settings, function() {
- slack.send({
- channel: '#desgsr', // Slack channel name
- text: `New changes: "${commit.subject}" are on staging site: http://www.desgsr.com/${project_slug}`, // Staging url
- icon_url: 'http://www.degordian.com/static/img/logo-degordian_d@2x.png',
- username: 'Deployed by - '+commit.author.name,
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement