@@ -72,7 +72,7 @@ function getUrl(content) {
72
72
return urls . map ( url => normalizeUrl ( url . trim ( ) . replace ( / \. + $ / , '' ) ) ) [ 0 ] ;
73
73
}
74
74
75
- const baseArgs = [ '--token' , nowToken ] ;
75
+ const baseArgs = [ '--token' , nowToken , '--name' , 'coderplex-app' ] ;
76
76
77
77
const nowArgs = [ '--no-clipboard' ] ;
78
78
@@ -103,7 +103,7 @@ function notifyInDiscord(err, res) {
103
103
. post ( discordHook , {
104
104
username : `${ repoSlug . replace ( '/' , '-' ) } -BOT` ,
105
105
content : `Deploymet failed check travis logs here https://travis-ci.org/coderplex/coderplex/builds/${ process
106
- . env . TRAVIS_BUILD_ID } `,
106
+ . env . TRAVIS_BUILD_ID } #L538 `,
107
107
} )
108
108
. then ( ( ) => {
109
109
console . log ( `Error posted to discord` ) ;
@@ -128,30 +128,34 @@ function buildComment(context, url, aliasUrl) {
128
128
}
129
129
130
130
function deploy ( context , sha ) {
131
- // Send error status to github PR
132
- ghRepo . status (
133
- sha ,
134
- {
135
- context,
136
- state : 'pending' ,
137
- description : `Δ Now ${ context } deployment pending` ,
138
- } ,
139
- console . log . bind ( console ) ,
140
- ) ;
131
+ if ( context === 'staging' ) {
132
+ // Send error status to github PR
133
+ ghRepo . status (
134
+ sha ,
135
+ {
136
+ context,
137
+ state : 'pending' ,
138
+ description : `Δ Now ${ context } deployment pending` ,
139
+ } ,
140
+ console . log . bind ( console ) ,
141
+ ) ;
142
+ }
141
143
// Initiate deployment process
142
144
runNow ( [ ...baseArgs , ...nowArgs ] , ( code , res ) => {
143
145
// Remember, process code: 0 means success else failure in unix/linux
144
146
if ( code ) {
145
- // Send error status to github PR
146
- ghRepo . status (
147
- sha ,
148
- {
149
- context,
150
- state : 'error' ,
151
- description : `Δ Now ${ context } deployment failed` ,
152
- } ,
153
- console . log . bind ( console ) ,
154
- ) ;
147
+ if ( context === 'staging' ) {
148
+ // Send error status to github PR
149
+ ghRepo . status (
150
+ sha ,
151
+ {
152
+ context,
153
+ state : 'error' ,
154
+ description : `Δ Now ${ context } deployment failed` ,
155
+ } ,
156
+ console . log . bind ( console ) ,
157
+ ) ;
158
+ }
155
159
// Notify in discord
156
160
notifyInDiscord ( true ) ;
157
161
return console . log ( `now process exited with code ${ code } ` ) ;
@@ -173,7 +177,7 @@ function deploy(context, sha) {
173
177
console . log . bind ( console ) ,
174
178
) ;
175
179
// Check and create comment on github PR abot deployment results
176
- if ( argv . comment ) {
180
+ if ( argv . comment && context === 'staging' ) {
177
181
ghIssue . createComment (
178
182
{
179
183
body : buildComment ( context , deployedUrl ) ,
0 commit comments