@@ -233,14 +233,17 @@ func (d *KoolDeploy) createReleaseFile() (filename string, err error) {
233233 allFiles = append (allFiles , filepath .Join (d .env .Get ("PWD" ), "docker-compose.yml" ))
234234 }
235235
236+ // we need to include the .env files as well
237+ allFiles = append (allFiles , d .cloudConfig .GetEnvFiles ()... )
238+
236239 d .shell .Println ("Compressing files:" )
237240 for _ , file := range allFiles {
238241 d .shell .Println (" -" , file )
239242 }
240243
241244 tarball .SourceDir (d .env .Get ("PWD" ))
242245
243- filename , err = tarball .CompressFiles (d . handleDeployEnv ( allFiles ) )
246+ filename , err = tarball .CompressFiles (allFiles )
244247
245248 if err == nil {
246249 d .shell .Println ("Files compression done." )
@@ -249,32 +252,6 @@ func (d *KoolDeploy) createReleaseFile() (filename string, err error) {
249252 return
250253}
251254
252- // handleDeployEnv tackles a special case on kool.deploy.env file.
253- // This file can or cannot be versioned (good practice not to, since
254- // it may include sensitive data). In the case of it being ignored
255- // from GIT, we still are required to send it - it is required for
256- // the Deploy API.
257- func (d * KoolDeploy ) handleDeployEnv (files []string ) []string {
258- path := filepath .Join (d .env .Get ("PWD" ), koolDeployEnv )
259- if _ , envErr := os .Stat (path ); os .IsNotExist (envErr ) {
260- return files
261- }
262-
263- var isAlreadyIncluded bool = false
264- for _ , file := range files {
265- if file == koolDeployEnv {
266- isAlreadyIncluded = true
267- break
268- }
269- }
270-
271- if ! isAlreadyIncluded {
272- files = append (files , koolDeployEnv )
273- }
274-
275- return files
276- }
277-
278255func (d * KoolDeploy ) loadAndValidateConfig () (err error ) {
279256 if d .cloudConfig , err = cloud .ParseCloudConfig (d .env .Get ("PWD" ), setup .KoolDeployFile ); err != nil {
280257 return
0 commit comments