@@ -4,9 +4,10 @@ import { CommandType } from '../config';
44import { findFromEnvVariables } from '../deploy' ;
55import * as style from 'ansi-styles' ;
66import chalk from 'chalk' ;
7+ import * as envVars from '../env-variables' ;
78
89export function s3Deploy (
9- preferences : any , container : string , variables : string [ ]
10+ preferences : any , container : string , variables : envVars . EnvVariables
1011) : Observable < any > {
1112 return new Observable ( ( observer : Observer < any > ) => {
1213
@@ -75,7 +76,7 @@ export function s3Deploy(
7576 }
7677
7778 return Observable
78- . concat ( ...commands . map ( command => dockerExec ( container , command ) ) )
79+ . concat ( ...commands . map ( command => dockerExec ( container , command , variables ) ) )
7980 . toPromise ( ) ;
8081 } )
8182 . then ( result => {
@@ -90,7 +91,7 @@ export function s3Deploy(
9091 type : CommandType . deploy , command : `aws configure set aws_access_key_id ${ accessKeyId } `
9192 } ;
9293
93- return dockerExec ( container , command ) . toPromise ( ) ;
94+ return dockerExec ( container , command , variables ) . toPromise ( ) ;
9495 } )
9596 . then ( result => {
9697 if ( ! ( result && result . data === 0 ) ) {
@@ -104,7 +105,7 @@ export function s3Deploy(
104105 command : `aws configure set aws_secret_access_key ${ secretAccessKey } `
105106 } ;
106107
107- return dockerExec ( container , command ) . toPromise ( ) ;
108+ return dockerExec ( container , command , variables ) . toPromise ( ) ;
108109 } )
109110 . then ( result => {
110111 if ( ! ( result && result . data === 0 ) ) {
@@ -117,7 +118,7 @@ export function s3Deploy(
117118 type : CommandType . deploy , command : `aws configure set region ${ region } `
118119 } ;
119120
120- return dockerExec ( container , command ) . toPromise ( ) ;
121+ return dockerExec ( container , command , variables ) . toPromise ( ) ;
121122 } )
122123 . then ( result => {
123124 if ( ! ( result && result . data === 0 ) ) {
@@ -140,7 +141,7 @@ export function s3Deploy(
140141 }
141142
142143 return Observable
143- . concat ( ...application . map ( command => dockerExec ( container , command ) ) )
144+ . concat ( ...application . map ( command => dockerExec ( container , command , variables ) ) )
144145 . toPromise ( ) ;
145146 } )
146147 . then ( result => {
@@ -158,7 +159,7 @@ export function s3Deploy(
158159 + ` --s3-location s3://${ preferences . bucket } /${ zipName } .zip`
159160 } ;
160161
161- return dockerExec ( container , deploy ) . toPromise ( ) ;
162+ return dockerExec ( container , deploy , variables ) . toPromise ( ) ;
162163 } )
163164 . then ( result => {
164165 if ( ! ( result && result . data === 0 ) ) {
@@ -183,7 +184,7 @@ export function s3Deploy(
183184 } ) ;
184185}
185186
186- function appSpecExists ( container ) : Promise < any > {
187+ function appSpecExists ( container : string ) : Promise < any > {
187188 return new Promise ( ( resolve , reject ) => {
188189 let appSpec = false ;
189190 dockerExec ( container , { type : CommandType . deploy , command : 'ls' } )
@@ -199,7 +200,7 @@ function appSpecExists(container): Promise<any> {
199200 } ) ;
200201}
201202
202- function applicationExists ( container , application ) : Promise < any > {
203+ function applicationExists ( container : string , application : string ) : Promise < any > {
203204 return new Promise ( ( resolve , reject ) => {
204205 const getApplicationCommand = 'aws deploy list-applications' ;
205206 let appExists = false ;
0 commit comments