Skip to content

Commit

Permalink
deploy privatebin with slash command
Browse files Browse the repository at this point in the history
  • Loading branch information
yoandl committed Dec 15, 2023
1 parent 1347315 commit 14e1c47
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions run/deploy-configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ module.exports = [
'master',
),
},
{
slashCommand: {
command: '/deploy-privatebin',
description: 'Déploie privatebin',
usage_hint: '/deploy-privatebin',
},
slackReturnText: 'Commande de déploiement de PrivateBin en production bien reçue.',
deployFunction: fromBranch('privatebin-deploy', ['pix-privatebin-production'], 'master'),
},
{
slashCommand: {
command: '/deploy-pix-apim',
Expand Down
7 changes: 7 additions & 0 deletions test/acceptance/run/manifest_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,13 @@ describe('Acceptance | Run | Manifest', function () {
url: `http://${hostname}/slack/commands/deploy-metabase`,
usage_hint: '/deploy-metabase',
},
{
command: '/deploy-privatebin',
description: 'Déploie privatebin',
should_escape: false,
url: `http://${hostname}/slack/commands/deploy-privatebin`,
usage_hint: '/deploy-privatebin',
},
{
command: '/deploy-pix-apim',
description: 'Pour déployer les applications Pix APIM depuis la branche main',
Expand Down
13 changes: 13 additions & 0 deletions test/acceptance/run/slashcommand_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ describe('Acceptance | Run | SlashCommand', function () {
expect(res.result.text).to.equal('Commande de déploiement de Metabase en production bien reçue.');
});
});
describe('POST /slack/commands/deploy-privatebin', function () {
it('responds with 200', async function () {
const body = {};
const res = await server.inject({
method: 'POST',
url: '/slack/commands/deploy-privatebin',
headers: createSlackWebhookSignatureHeaders(JSON.stringify(body)),
payload: body,
});
expect(res.statusCode).to.equal(200);
expect(res.result.text).to.equal('Commande de déploiement de PrivateBin en production bien reçue.');
});
});

describe('POST /slack/commands/deploy-pix-apim', function () {
it('responds with 200', async function () {
Expand Down

0 comments on commit 14e1c47

Please sign in to comment.