dpl 1.8.18.travis.1472.4 → 1.8.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWQ3MjkyNDFkMzQ4NTIxMTUxNGIyNTZhMjdiYThmZThhMzg0OWI5YQ==
4
+ ZGI0N2MwNjMwYTMxZDBhYmEyMDg0OThlM2FlNjkzMWRhMGJiZmM2Ng==
5
5
  data.tar.gz: !binary |-
6
- ZjRmYmZlYzkwMDFlYzMzYjM3NGE5Zjg2NGY3NjVlNmZmOWIxZmY3NA==
6
+ ODBmY2YxMzE1ODYyYjJhZTI0MGRjOTkyZjdkZjZjZDFkZWFjOGNkYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTNhYjEwMzA4MTg4YTBiM2JmNjk1Y2IxNTg3YWI2OTAyZmZjYzdhNDk3MTAz
10
- NGRlOGU4Mjg1ZWY1YTY0MTk4MjQ4MWY4YjE0Y2RjNmQ3NGQzZjRhZmEyYjdj
11
- OWE0YjlmMDk0OGRlYWQwMzY0MGVmNjZjYWVlNjgwYzJiNzFlNWY=
9
+ Yjg1MTIyYTdiOTFlMzA1MjQwYTQyMTUwYTgzZjE3M2I4NjY1MDZhYzJhOTAy
10
+ MTlmMzk0MDcwNjg1NzFmYzg2MTI5M2JmNDI0Y2YwNzIwYTljZDRmNjE2ZjE5
11
+ Y2NlYjM2ZGYzNTE1NjcwMWIxY2FlZGFkZmJjOWIzZDg4NzcwOTU=
12
12
  data.tar.gz: !binary |-
13
- YjUxN2EyMWNmM2M0N2FmNmIyY2IxY2E1YTQ3ZDczMmZhZWE5NWY5Yzg2NmM0
14
- OTQ2MmI3NGE2ZWRjMjk2OWM3MzlkMzc0YTA3YWExZWFhY2Y4YjZmM2ZhODM2
15
- MDdlNTJiNzBmNDY2MDY2NDJkZjczNDNmMTQyMWFlMTRkYjI3NzU=
13
+ ZjA5M2IxMjMyYTM2YWE1OWFlZmI5NmEwZjFmZjY1YTc2MTA4YTY5ZWRmMDVk
14
+ YTAzOTM4ZTQ5MjUzMWIxOTdmMTJjMjRjMTcwNjJmOTIyZWE1OGM0MmI3MTUz
15
+ MDM0N2MwYjFhYzc1MGU2ZmNhZjBiZjgwMTk3ZjBkMzU1NmFhMjc=
data/.travis.yml CHANGED
@@ -2,18 +2,22 @@ language: ruby
2
2
  rvm:
3
3
  - 1.9.3
4
4
  - 2.0.0
5
- - 2.1.0
6
5
  - 2.1.5
7
- - "2.2"
6
+ - "2.2.5"
7
+ - "2.3.1"
8
8
 
9
9
  matrix:
10
10
  allow_failures:
11
- - rvm: "2.2"
11
+ - rvm: "2.2.5"
12
+ - rvm: "2.3.1"
12
13
 
13
14
  sudo: false
14
15
 
15
16
  cache: bundler
16
17
 
18
+ script:
19
+ - bundle exec rake && gem build dpl.gemspec && gem install dpl-*.gem && dpl --provider=script --script='echo foo'
20
+
17
21
  deploy:
18
22
  provider: rubygems
19
23
  api_key:
data/Gemfile CHANGED
@@ -1,6 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
3
 
4
+ gem 'term-ansicolor', '~> 1.3.2'
5
+
4
6
  platforms :mri_19 do
5
7
  gem 'slop', '~> 3.6.0'
6
8
  gem 'ohai', '~> 7.4.0'
@@ -21,6 +23,7 @@ group :openshift do
21
23
  end
22
24
 
23
25
  group :appfog do
26
+ gem 'json_pure'
24
27
  gem 'af'
25
28
  end
26
29
 
@@ -39,11 +42,12 @@ end
39
42
 
40
43
  group :lambda do
41
44
  gem 'aws-sdk', '>= 2.0.18.pre'
42
- gem 'rubyzip'
45
+ gem 'rubyzip', '~> 1.1'
43
46
  end
44
47
 
45
48
  group :cloud_files do
46
49
  gem 'fog-google', '< 0.1.1', platforms: :mri_19
50
+ gem 'fog-profitbricks', '< 2.0', platforms: :mri_19
47
51
  gem 'fog'
48
52
  end
49
53
 
@@ -57,7 +61,7 @@ group :gcs do
57
61
  end
58
62
 
59
63
  group :elastic_beanstalk do
60
- gem 'rubyzip'
64
+ gem 'rubyzip', '~> 1.1'
61
65
  gem 'aws-sdk-v1'
62
66
  end
63
67
 
@@ -67,11 +71,13 @@ group :bitballoon do
67
71
  end
68
72
 
69
73
  group :puppet_forge do
74
+ gem 'json_pure'
70
75
  gem 'puppet'
71
76
  gem 'puppet-blacksmith'
72
77
  end
73
78
 
74
79
  group :packagecloud do
80
+ gem 'json_pure'
75
81
  gem 'packagecloud-ruby', '= 0.2.17'
76
82
  end
77
83
 
@@ -86,3 +92,7 @@ end
86
92
  group :deis do
87
93
  gem 'git'
88
94
  end
95
+
96
+ group :opsworks do
97
+ gem 'aws-sdk', '>= 2.0.18.pre'
98
+ end
data/README.md CHANGED
@@ -11,18 +11,20 @@ Dpl supports the following providers:
11
11
  * [AppFog](#appfog)
12
12
  * [Atlas by HashiCorp](#atlas)
13
13
  * [AWS CodeDeploy](#aws-codedeploy)
14
+ * [AWS Elastic Beanstalk](#elastic-beanstalk)
14
15
  * [AWS OpsWorks](#opsworks)
15
16
  * [Azure Web Apps](#azure-web-apps)
16
17
  * [Bintray](#bintray)
17
18
  * [BitBalloon](#bitballoon)
18
19
  * [Boxfuse](#boxfuse)
20
+ * [Catalyze](#catalyze)
19
21
  * [Chef Supermarket](#chef-supermarket)
20
22
  * [Cloud 66](#cloud-66)
21
23
  * [Cloud Foundry](#cloud-foundry)
22
24
  * [Deis](#deis)
23
25
  * [Divshot.io](#divshotio)
24
- * [Elastic Beanstalk](#elastic-beanstalk)
25
26
  * [Engine Yard](#engine-yard)
27
+ * [ExoScale](#exoscale)
26
28
  * [Firebase](#firebase)
27
29
  * [Github Releases](#github-releases)
28
30
  * [Google App Engine (experimental)](#google-app-engine)
@@ -50,7 +52,7 @@ Dpl supports the following providers:
50
52
 
51
53
  Dpl is published to rubygems.
52
54
 
53
- * Dpl requires ruby with a version greater than 1.8.7
55
+ * Dpl requires ruby with a version greater than 1.9.3
54
56
  * To install: `gem install dpl`
55
57
 
56
58
  ## Usage:
@@ -67,18 +69,18 @@ Running dpl in a terminal that saves history is insecure as your password/api ke
67
69
 
68
70
  #### Options:
69
71
  * **api-key**: Heroku API Key
70
- * **strategy[git/anvil]**: Deployment strategy for Dpl. Defaults to anvil.
72
+ * **strategy**: Deployment strategy for Dpl. Defaults to `api`. Other options are `git`, `git ssh`, and `git deploykey`.
71
73
  * **app**: Heroku app name. Defaults to the name of your git repo.
72
74
  * **username**: heroku username. Not necessary if api-key is used. Requires git strategy.
73
75
  * **password**: heroku password. Not necessary if api-key is used. Requires git strategy.
74
76
 
75
- #### Git vs Anvil Deploy:
76
- * Anvil will run the [buildpack](https://devcenter.heroku.com/articles/buildpacks) compilation step on the Travis CI VM, whereas the Git strategy will run it on a Heroku dyno, which provides the same environment the application will then run under and might be slightly faster.
77
+ #### API vs Git vs Anvil Deploy:
78
+ * API deploy will tar up the current directory (minus the git repo) and send it to Heroku.
79
+ * Git deploy will send the contents of the git repo only, so may not contain any local changes.
80
+ * Anvil deploys are no longer supported since Heroku shut down the Anvil service.
77
81
  * The Git strategy allows using *user* and *password* instead of *api-key*.
78
82
  * When using Git, Heroku might send you an email for every deploy, as it adds a temporary SSH key to your account.
79
83
 
80
- As a rule of thumb, you should switch to the Git strategy if you run into issues with Anvil or if you're using the [user-env-compile](https://devcenter.heroku.com/articles/labs-user-env-compile) plugin.
81
-
82
84
  #### Examples:
83
85
 
84
86
  dpl --provider=heroku --api-key=`heroku auth:token`
@@ -314,6 +316,7 @@ For authentication you can also use Travis CI secure environment variable:
314
316
  * **bucket**: S3 Bucket.
315
317
  * **region**: S3 Region. Defaults to us-east-1.
316
318
  * **upload-dir**: S3 directory to upload to. Defaults to root directory.
319
+ * **storage-class**: S3 storage class to upload as. Defaults to "STANDARD". Other values are "STANDARD_IA" or "REDUCED_REDUNDANCY". Details can be found [here](https://aws.amazon.com/s3/storage-classes/).
317
320
  * **local-dir**: Local directory to upload from. Can be set from a global perspective (~/travis/build) or relative perspective (build) Defaults to project root.
318
321
  * **detect-encoding**: Set HTTP header `Content-Encoding` for files compressed with `gzip` and `compress` utilities. Defaults to not set.
319
322
  * **cache_control**: Set HTTP header `Cache-Control` to suggest that the browser cache the file. Defaults to `no-cache`. Valid options are `no-cache`, `no-store`, `max-age=<seconds>`,`s-maxage=<seconds>` `no-transform`, `public`, `private`.
@@ -343,6 +346,30 @@ It is possible to set file-specific `Cache-Control` and `Expires` headers using
343
346
  dpl --provider=s3 --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --detect-encoding --cache_control=max-age=99999 --expires="2012-12-21 00:00:00 -0000"
344
347
  dpl --provider=s3 --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --region=us-west-2 --local-dir= BUILD --upload-dir=BUILDS
345
348
 
349
+ ### Elastic Beanstalk:
350
+
351
+ #### Options:
352
+
353
+ * **access-key-id**: AWS Access Key ID. Can be obtained from [here](https://console.aws.amazon.com/iam/home?#security_credential).
354
+ * **secret-access-key**: AWS Secret Key. Can be obtained from [here](https://console.aws.amazon.com/iam/home?#security_credential).
355
+ * **region**: AWS Region the Elastic Beanstalk app is running in. Defaults to 'us-east-1'. Please be aware that this must match the region of the elastic beanstalk app.
356
+ * **app**: Elastic Beanstalk application name.
357
+ * **env**: Elastic Beanstalk environment name which will be updated.
358
+ * **zip_file**: The zip file that you want to deploy. _**Note:**_ you also need to use the `skip_cleanup` or the zip file you are trying to upload will be removed during cleanup.
359
+ * **bucket_name**: Bucket name to upload app to.
360
+ * **bucket_path**: Location within Bucket to upload app to.
361
+ * **only_create_app_version**: only create the app version, don't actually deploy it.
362
+
363
+ #### Environment variables:
364
+
365
+ * **ELASTIC_BEANSTALK_ENV**: Elastic Beanstalk environment name which will be updated. Is only used if `env` option is omitted.
366
+ * **ELASTIC_BEANSTALK_LABEL**: Label name of the new version.
367
+ * **ELASTIC_BEANSTALK_DESCRIPTION**: Description of the new version. Defaults to the last commit message.
368
+
369
+ #### Examples:
370
+
371
+ dpl --provider=elasticbeanstalk --access-key-id=<access-key-id> --secret-access-key="<secret-access-key>" --app="example-app-name" --env="example-app-environment" --region="us-west-2"
372
+
346
373
  ### OpsWorks:
347
374
 
348
375
  #### Options:
@@ -350,9 +377,11 @@ It is possible to set file-specific `Cache-Control` and `Expires` headers using
350
377
  * **access-key-id**: AWS Access Key ID. Can be obtained from [here](https://console.aws.amazon.com/iam/home?#security_credential).
351
378
  * **secret-access-key**: AWS Secret Key. Can be obtained from [here](https://console.aws.amazon.com/iam/home?#security_credential).
352
379
  * **app-id**: The app ID.
380
+ * **instance-ids**: An instance id. (Use this option multiple times to specify multiple instance ids. Default: [])
381
+ * **layer-ids**: A layer id. (Use this option multiple times to specify multiple layer ids. Default: [])
353
382
  * **migrate**: Migrate the database. (Default: false)
354
383
  * **wait-until-deployed**: Wait until the app is deployed and return the deployment status. (Default: false)
355
- * **custom_json**: Override custom_json options. If using this, default configuration will be overriden. See the code [here](https://github.com/travis-ci/dpl/blob/master/lib/dpl/provider/ops_works.rb#L34). More about `custom_json` [here](http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json.html).
384
+ * **custom_json**: Override custom_json options. If using this, default configuration will be overriden. See the code [here](https://github.com/travis-ci/dpl/blob/master/lib/dpl/provider/ops_works.rb#L43). More about `custom_json` [here](http://docs.aws.amazon.com/opsworks/latest/userguide/workingcookbook-json.html).
356
385
 
357
386
  #### Environment variables:
358
387
 
@@ -362,6 +391,7 @@ It is possible to set file-specific `Cache-Control` and `Expires` headers using
362
391
  #### Examples:
363
392
 
364
393
  dpl --provider=opsworks --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --app-id=<app-id> --migrate --wait-until-deployed
394
+ dpl --provider=opsworks --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --app-id=<app-id> --layer-ids=<layer-id>
365
395
 
366
396
  ### Anynines:
367
397
 
@@ -557,30 +587,6 @@ For accounts using two factor authentication, you have to use an oauth token as
557
587
  dpl --provider=gcs --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --detect-encoding --cache_control=max-age=99999
558
588
  dpl --provider=gcs --access-key-id=<access-key-id> --secret-access-key=<secret-access-key> --bucket=<bucket> --local-dir=BUILD --upload-dir=BUILDS
559
589
 
560
- ### Elastic Beanstalk:
561
-
562
- #### Options:
563
-
564
- * **access-key-id**: AWS Access Key ID. Can be obtained from [here](https://console.aws.amazon.com/iam/home?#security_credential).
565
- * **secret-access-key**: AWS Secret Key. Can be obtained from [here](https://console.aws.amazon.com/iam/home?#security_credential).
566
- * **region**: AWS Region the Elastic Beanstalk app is running in. Defaults to 'us-east-1'. Please be aware that this must match the region of the elastic beanstalk app.
567
- * **app**: Elastic Beanstalk application name.
568
- * **env**: Elastic Beanstalk environment name which will be updated.
569
- * **zip_file**: The zip file that you want to deploy. _**Note:**_ you also need to use the `skip_cleanup` or the zip file you are trying to upload will be removed during cleanup.
570
- * **bucket_name**: Bucket name to upload app to.
571
- * **bucket_path**: Location within Bucket to upload app to.
572
- * **only_create_app_version**: only create the app version, don't actually deploy it.
573
-
574
- #### Environment variables:
575
-
576
- * **ELASTIC_BEANSTALK_ENV**: Elastic Beanstalk environment name which will be updated. Is only used if `env` option is omitted.
577
- * **ELASTIC_BEANSTALK_LABEL**: Label name of the new version.
578
- * **ELASTIC_BEANSTALK_DESCRIPTION**: Description of the new version. Defaults to the last commit message.
579
-
580
- #### Examples:
581
-
582
- dpl --provider=elasticbeanstalk --access-key-id=<access-key-id> --secret-access-key="<secret-access-key>" --app="example-app-name" --env="example-app-environment" --region="us-west-2"
583
-
584
590
  ### BitBalloon:
585
591
 
586
592
  #### Options:
@@ -622,6 +628,37 @@ For accounts using two factor authentication, you have to use an oauth token as
622
628
  dpl --provider=packagecloud --username=packageuser --token=t0k3n --repository=myrepo --dist=ubuntu/precise
623
629
  dpl --provider=packagecloud --username=packageuser --token=t0k3n --repository=myrepo --local-dir="${TRAVIS_BUILD_DIR}/pkgs" --dist=ubuntu/precise
624
630
 
631
+ ### Catalyze:
632
+
633
+ #### Options:
634
+
635
+ * **target**: Required. The git remote repository to deploy to.
636
+ * **path**: Optional. If using the skip_cleanup option to deploy from current file state, you can optionally specify the pathspec for the files to deploy. If not specified then all files are deployed.
637
+
638
+ #### Examples:
639
+
640
+ dpl --provider=catalyze --target=ssh://git@git.catalyzeapps.com:2222/app1234.git
641
+ dpl --provider=catalyze --target=ssh://git@git.catalyzeapps.com:2222/app1234.git --skip_cleanup=true
642
+ dpl --provider=catalyze --target=ssh://git@git.catalyzeapps.com:2222/app1234.git --skip_cleanup=true --path=build
643
+
644
+
645
+ #### Setup:
646
+
647
+ 1. Get the deployment target for Catalyze:
648
+ a. Make sure your catalyze environment is [associated](https://resources.catalyze.io/paas/paas-cli-reference/#associate).
649
+ b. Get the git remote by running ```git remote -v``` from within the associated repo.
650
+ 2. Setup a deployment key to Catalyze for Travis CI:
651
+ a. Install the travis-ci cli.
652
+ b. Get the public SSH key for your travis project and save it to a file by running ```travis pubkey > travis.pub```
653
+ c. Add the key as a deploy key using the catalyze cli within the associated repo. For example: ```catalyze deploy-keys add travisci ./travis.pub code-1```
654
+ 3. Setup Catalyze as a known host for Travis CI:
655
+ a. List your known hosts by running ```cat ~/.ssh/known_hosts```
656
+ b. Find and copy the line from known_hosts that includes the git remote found in step #1. It'll look something like "[git.catalyzeapps.com]:2222 ecdsa-sha2-nistp256 BBBB12abZmKlLXNo..."
657
+ c. Update your `before_deploy` step in `.travis.yml` to update the `known_hosts` file:
658
+ ```
659
+ before_deploy: echo "[git.catalyzeapps.com]:2222 ecdsa-sha2-nistp256 BBBB12abZmKlLXNo..." >> ~/.ssh/known_hosts
660
+ ```
661
+
625
662
  ### Chef Supermarket:
626
663
 
627
664
  #### Options:
@@ -638,6 +675,9 @@ For accounts using two factor authentication, you have to use an oauth token as
638
675
 
639
676
  #### Options:
640
677
 
678
+ * **access_key_id**: AWS Access Key ID. Can be obtained from [here](https://console.aws.amazon.com/iam/home?#security_credential).
679
+ * **secret_access_key**: AWS Secret Key. Can be obtained from [here](https://console.aws.amazon.com/iam/home?#security_credential).
680
+ * **region**: AWS Region the Lambda function is running in. Defaults to 'us-east-1'.
641
681
  * **function_name**: Required. The name of the Lambda being created / updated.
642
682
  * **role**: Required. The ARN of the IAM role to assign to this Lambda function.
643
683
  * **handler_name**: Required. The function that Lambda calls to begin execution. For NodeJS, it is exported function for the module.
@@ -741,6 +781,18 @@ and your testers can start testing your app.
741
781
 
742
782
  dpl --provider=codedeploy --access-key-id=<aws access key> --secret_access_key=<aws secret access key> --application=<application name> --deployment_group=<deployment group> --revision_type=<s3/github> --commit_id=<commit ID> --repository=<repo name> --region=<AWS availability zone> --wait-until-deployed=<true>
743
783
 
784
+ ### ExoScale:
785
+
786
+ #### Options:
787
+
788
+ * **email**: ExoScale email or Organization ID.
789
+ * **password**: ExoScale password.
790
+ * **deployment**: ExoScale Deployment. Follows the format "APP_NAME/DEP_NAME".
791
+
792
+ #### Examples:
793
+
794
+ dpl --provider=exoscale --email=<email> --password<password> --deployment=`APP_NAME/DEP_NAME`
795
+
744
796
  ### Scalingo:
745
797
 
746
798
  #### Options:
@@ -818,7 +870,7 @@ In order to use this provider, please make sure you have the [App Engine Admin A
818
870
  #### Examples:
819
871
 
820
872
  dpl --provider=firebase --token=<token> --project=<project>
821
-
873
+
822
874
 
823
875
 
824
876
  ### Surge.sh
@@ -826,9 +878,9 @@ In order to use this provider, please make sure you have the [App Engine Admin A
826
878
  #### Options:
827
879
 
828
880
  * **project** Path to project folder relative to repo root. Defaults to repo root if not set.
829
- * **domain** Domain to publish to. Can be omitted if domain is set in the `CNAME` file in the project folder.
881
+ * **domain** Domain to publish to. Can be omitted if domain is set in the `CNAME` file in the project folder.
882
+
830
883
 
831
-
832
884
  #### Environment variables:
833
885
 
834
886
  * **SURGE_LOGIN**: Set it to the email address you use with Surge
@@ -836,4 +888,4 @@ In order to use this provider, please make sure you have the [App Engine Admin A
836
888
 
837
889
  #### Example:
838
890
  dpl --provider=surge --project=<project-path> --domain=<domain-name>
839
-
891
+
data/dpl.gemspec CHANGED
@@ -20,9 +20,9 @@ Gem::Specification.new do |s|
20
20
  s.add_development_dependency 'rspec-its'
21
21
  s.add_development_dependency 'rake'
22
22
  s.add_development_dependency 'json', '1.8.1'
23
+ s.add_development_dependency 'tins', '~> 1.6.0', '>= 1.6.0'
23
24
  s.add_development_dependency 'coveralls'
24
25
 
25
-
26
26
  # prereleases from Travis CI
27
27
  if ENV['CI']
28
28
  digits = s.version.to_s.split '.'
@@ -1,6 +1,7 @@
1
1
  module DPL
2
2
  class Provider
3
3
  class Appfog < Provider
4
+ requires 'json_pure', :version => '< 2.0', :load => 'json/pure'
4
5
  requires 'af', :load => 'vmc'
5
6
 
6
7
  def check_auth
@@ -16,14 +16,15 @@ module DPL
16
16
  chmod +x $HOME/bin/gimme
17
17
  fi
18
18
 
19
- export GOPATH="$HOME/gopath:$GOPATH"
20
- eval "$(gimme 1.4.2)" &>/dev/null
19
+ if [ -z $GOPATH ]; then
20
+ export GOPATH="$HOME/gopath"
21
+ else
22
+ export GOPATH="$HOME/gopath:$GOPATH"
23
+ fi
24
+ eval "$(gimme 1.6)" &> /dev/null
21
25
 
22
26
  go get #{ATLAS_UPLOAD_CLI_GO_REMOTE}
23
- pushd $HOME/gopath/src/#{ATLAS_UPLOAD_CLI_GO_REMOTE} &>/dev/null
24
- make &>/dev/null
25
- cp bin/atlas-upload $HOME/bin/atlas-upload
26
- popd &>/dev/null
27
+ cp $HOME/gopath/bin/atlas-upload-cli $HOME/bin/atlas-upload
27
28
  fi
28
29
  EOF
29
30
 
@@ -59,7 +60,9 @@ module DPL
59
60
  private
60
61
 
61
62
  def install_atlas_upload
62
- context.shell ATLAS_UPLOAD_INSTALL_SCRIPT
63
+ without_git_http_user_agent do
64
+ context.shell ATLAS_UPLOAD_INSTALL_SCRIPT
65
+ end
63
66
  end
64
67
 
65
68
  def assert_app_present!
@@ -93,6 +96,13 @@ module DPL
93
96
  def atlas_app
94
97
  @atlas_app ||= options.fetch(:app).to_s
95
98
  end
99
+
100
+ def without_git_http_user_agent(&block)
101
+ git_http_user_agent = ENV.delete("GIT_HTTP_USER_AGENT")
102
+ yield
103
+ ENV["GIT_HTTP_USER_AGENT"] = git_http_user_agent
104
+ end
105
+
96
106
  end
97
107
  end
98
108
  end
@@ -38,9 +38,9 @@ module DPL
38
38
  end
39
39
 
40
40
  if !!options[:verbose]
41
- context.shell "git push --force --quiet #{git_target} HEAD:master"
41
+ context.shell "git push --force --quiet #{git_target} HEAD:refs/heads/master"
42
42
  else
43
- context.shell "git push --force --quiet #{git_target} HEAD:master > /dev/null 2>&1"
43
+ context.shell "git push --force --quiet #{git_target} HEAD:refs/heads/master > /dev/null 2>&1"
44
44
  end
45
45
  end
46
46
  end
@@ -0,0 +1,49 @@
1
+ module DPL
2
+ class Provider
3
+ class Catalyze < Provider
4
+ def config
5
+ {
6
+ # the git repository to deploy to
7
+ "target" => options[:target] || context.env['CATALYZE_TARGET'],
8
+ # the pathspec for files to add to git for deployment e.g. your build directory. defaults to all files.
9
+ "path" => options[:path] || context.env['CATALYZE_PATH'] || '.'
10
+ }
11
+ end
12
+
13
+ def needs_key?
14
+ false
15
+ end
16
+
17
+ def check_app
18
+ end
19
+
20
+ def check_auth
21
+ error "Missing Catalyze target" unless config['target']
22
+ end
23
+
24
+ def push_app
25
+ log "Deploying to Catalyze '#{config['target']}'"
26
+
27
+ if options[:skip_cleanup]
28
+ # create commit message
29
+ build_num = context.env["TRAVIS_BUILD_NUMBER"]
30
+ commit = context.env["TRAVIS_COMMIT"]
31
+ repo_slug = context.env["TRAVIS_REPO_SLUG"]
32
+ branch = context.env["TRAVIS_BRANCH"]
33
+ if build_num && commit && repo_slug && branch
34
+ commit_message = "Build ##{build_num} (#{commit}) of #{repo_slug}@#{branch}"
35
+ else
36
+ commit_message = "Local build"
37
+ end
38
+
39
+ log "Using build files for deployment"
40
+ context.shell "git checkout HEAD"
41
+ context.shell "git add #{config["path"]} --all --force"
42
+ context.shell "git commit -m \"#{commit_message}\" --quiet"
43
+ end
44
+
45
+ context.shell "git push --force #{config['target']} HEAD:master"
46
+ end
47
+ end
48
+ end
49
+ end
@@ -6,6 +6,8 @@ module DPL
6
6
  # https://github.com/opscode/chef/blob/11.16.4/lib/chef/knife/cookbook_site_share.rb
7
7
 
8
8
  # Compatibility with ruby 1.9
9
+ requires 'rack', version: '< 2.0'
10
+ requires 'mime-types', version: '~> 1.16'
9
11
  requires 'chef', version: '< 12.0'
10
12
  requires 'chef', load: 'chef/config'
11
13
  requires 'chef', load: 'chef/cookbook_loader'
@@ -5,8 +5,7 @@ module DPL
5
5
  class CloudFiles < Provider
6
6
  requires 'net-ssh', load: 'net/ssh', version: '~> 2.9.2' # Anything higher requires Ruby 2.x
7
7
  requires 'mime-types', load: 'mime/types', version: '~> 2.6.2' # Anything higher requires Ruby 2.x
8
- requires 'fog-google', load: 'fog/google', version: '< 0.1.1' # Anything higher requires Ruby 2.x
9
- requires 'fog', version: '< 1.35.0' # Anything higher requires fog-google 0.1.1 and up, which, in turn, requires Ruby 2.x
8
+ requires 'fog-rackspace', load: 'fog/rackspace'
10
9
  experimental 'Rackspace Cloud Files'
11
10
 
12
11
  def needs_key?
@@ -9,7 +9,7 @@ module DPL
9
9
  def check_auth
10
10
  initial_go_tools_install
11
11
  context.shell "./cf api #{option(:api)} #{'--skip-ssl-validation' if options[:skip_ssl_validation]}"
12
- context.shell "./cf login --u #{option(:username)} --p #{option(:password)} --o #{option(:organization)} --s #{option(:space)}"
12
+ context.shell "./cf login -u #{option(:username)} -p #{option(:password)} -o #{option(:organization)} -s #{option(:space)}"
13
13
  end
14
14
 
15
15
  def check_app
@@ -81,7 +81,7 @@ module DPL
81
81
  end
82
82
 
83
83
  def push_app
84
- unless context.shell "git push #{verbose_flag} deis HEAD:refs/heads/master -f 2>&1 | tr -dc '[:alnum:][:space:][:punct:]' | sed -E 's/remote: (\\[1G)+//' | sed 's/\\[K$//'"
84
+ unless context.shell "bash -c 'git push #{verbose_flag} deis HEAD:refs/heads/master -f 2>&1 | tr -dc \"[:alnum:][:space:][:punct:]\" | sed -E \"s/remote: (\\[1G)+//\" | sed \"s/\\[K$//\"; exit ${PIPESTATUS[0]}'"
85
85
  error 'Deploying application failed.'
86
86
  end
87
87
  end
@@ -0,0 +1,100 @@
1
+ require 'json'
2
+ require 'net/http'
3
+ require 'net/https'
4
+
5
+ module DPL
6
+ class Provider
7
+ class ExoScale < Provider
8
+ attr_accessor :app_name
9
+ attr_accessor :dep_name
10
+
11
+ def initialize(context, options)
12
+ super
13
+ option(:email) && option(:password) && option(:deployment)
14
+ @app_name, @dep_name = options[:deployment].split('/')
15
+
16
+ @http = Net::HTTP.new('api.app.exo.io', 443)
17
+ @http.use_ssl = true
18
+
19
+ @tokenHttp = Net::HTTP.new('portal.exoscale.ch', 443)
20
+ @tokenHttp.use_ssl = true
21
+ end
22
+
23
+ def check_auth
24
+ headers_with_token
25
+ end
26
+
27
+ def check_app
28
+ response = api_call('GET', "/app/#{ app_name }/deployment/#{ dep_name }")
29
+ error('application check failed') if response.code != '200'
30
+ @repository = JSON.parse(response.body)["branch"]
31
+ end
32
+
33
+ def setup_key(file)
34
+ data = { 'key' => File.read(file).chomp }
35
+ response = api_call('POST', "/user/#{ user['username'] }/key", JSON.dump(data))
36
+ error('adding key failed') if response.code != '200'
37
+ key = JSON.parse response.body
38
+ @ssh_key_id = key['key_id']
39
+ end
40
+
41
+ def remove_key
42
+ response = api_call('DELETE', "/user/#{ user['username']}/key/#{ @ssh_key_id }")
43
+ error('key removal failed') if response.code != '204'
44
+ end
45
+
46
+ def push_app
47
+ branch = (dep_name == 'default') ? 'master' : dep_name
48
+ context.shell "git push #{ @repository } HEAD:#{ branch } -f"
49
+ deploy_app
50
+ end
51
+
52
+ private
53
+
54
+ def get_token
55
+ request = Net::HTTP::Post.new '/api/apps/token'
56
+ request.basic_auth options[:email], options[:password]
57
+ response = @tokenHttp.request(request)
58
+ error('authorization failed') if response.code != '200'
59
+ return JSON.parse response.body
60
+ end
61
+
62
+ def headers_with_token(options = {})
63
+ @token = get_token if options[:new_token] || @token.nil?
64
+ return {
65
+ 'Authorization' => %Q|cc_auth_token="#{ @token['token'] }"|,
66
+ 'Content-Type' => 'application/json'
67
+ }
68
+ end
69
+
70
+ def get_headers
71
+ headers = headers_with_token
72
+ response = api_call('GET', '/user/', nil, headers)
73
+ return headers if response.code == '200'
74
+
75
+ return headers_with_token :new_token => true
76
+ end
77
+
78
+ def api_call(method, path, data = nil, headers = nil)
79
+ return @http.send_request(method, path, data, headers || get_headers)
80
+ end
81
+
82
+ def deploy_app
83
+ data = {'version' => -1}
84
+ response = api_call('PUT', "/app/#{ app_name }/deployment/#{ dep_name }", JSON.dump(data))
85
+ error('deployment failed - the deployment is already deploying') if response.code != '200'
86
+ end
87
+
88
+ def user
89
+ if @user.nil?
90
+ response = api_call('GET', '/user/')
91
+ error('can not find the user') if response.code != '200'
92
+ users = JSON.parse response.body
93
+ @user = users[0]
94
+ end
95
+ return @user
96
+ end
97
+
98
+ end
99
+ end
100
+ end
@@ -1,7 +1,7 @@
1
1
  module DPL
2
2
  class Provider
3
3
  class Firebase < Provider
4
- npm_g 'firebase-tools@^2.1', 'firebase'
4
+ npm_g 'firebase-tools@^3.0', 'firebase'
5
5
 
6
6
  def check_auth
7
7
  raise Error, "must supply token option or FIREBASE_TOKEN environment variable" if !options[:token] && !context.env['FIREBASE_TOKEN']
@@ -17,7 +17,7 @@ module DPL
17
17
 
18
18
  def push_app
19
19
  command = "firebase deploy --non-interactive"
20
- command << " -f #{options[:project]}" if options[:project]
20
+ command << " --project #{options[:project]}" if options[:project]
21
21
  command << " --token '#{options[:token]}'" if options[:token]
22
22
  context.shell command
23
23
  end
@@ -2,6 +2,7 @@ module DPL
2
2
  class Provider
3
3
  class Openshift < Provider
4
4
  requires 'httpclient', version: '~> 2.4.0'
5
+ requires 'net-ssh', load: 'net/ssh', version: '~> 2.9.2' # Anything higher requires Ruby 2.x
5
6
  requires 'rhc'
6
7
 
7
8
  def initialize(context, options)