Skip to content

Commit 3b19f95

Browse files
sdjkeen
authored andcommitted
add support for didDeployMessage (inspired by redis plugin)
1 parent 35a2e8f commit 3b19f95

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,22 @@ If you are using DigitalOcean spaces you need to set this setting to `false`.
170170

171171
*Default:* `true`
172172

173+
### didDeployMessage
174+
175+
A message that will be displayed after the index file has been successfully uploaded to S3. By default this message will only display if the revision for `revisionData.revisionKey` of the deployment context has been activated.
176+
177+
*Default:*
178+
179+
```javascript
180+
if (context.revisionData.revisionKey && !context.revisionData.activatedRevisionKey) {
181+
return "Deployed but did not activate revision " + context.revisionData.revisionKey + ". "
182+
+ "To activate, run: "
183+
+ "ember deploy:activate " + context.revisionData.revisionKey + " --environment=" + context.deployEnvironment + "\n";
184+
}
185+
```
186+
187+
188+
173189
### How do I activate a revision?
174190

175191
A user can activate a revision by either:

index.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ module.exports = {
3434
brotliCompressedFiles: function(context) {
3535
return context.brotliCompressedFiles || [];
3636
},
37+
didDeployMessage: function(context){
38+
var revisionKey = context.revisionData && context.revisionData.revisionKey;
39+
var activatedRevisionKey = context.revisionData && context.revisionData.activatedRevisionKey;
40+
if (revisionKey && !activatedRevisionKey) {
41+
return "Deployed but did not activate revision " + revisionKey + ". "
42+
+ "To activate, run: "
43+
+ "ember deploy:activate " + context.deployTarget + " --revision=" + revisionKey + "\n";
44+
}
45+
},
3746
allowOverwrite: false
3847
},
3948

@@ -103,7 +112,20 @@ module.exports = {
103112
this.log('preparing to activate `' + revisionKey + '`', { verbose: true });
104113

105114
var s3 = new this.S3({ plugin: this });
106-
return s3.activate(options);
115+
return s3.activate(options).then(function() {
116+
return {
117+
revisionData: {
118+
activatedRevisionKey: revisionKey
119+
}
120+
}
121+
});
122+
},
123+
124+
didDeploy: function(/* context */){
125+
var didDeployMessage = this.readConfig('didDeployMessage');
126+
if (didDeployMessage) {
127+
this.log(didDeployMessage);
128+
}
107129
},
108130

109131
fetchRevisions: function(context) {

0 commit comments

Comments
 (0)