Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bare minimum encrypt-file spec and fix the command #715

Merged
merged 2 commits into from Mar 4, 2020

Conversation

@BanzaiMan
Copy link
Member

BanzaiMan commented Mar 4, 2020

FakeAPI is stubbed to satisfy a very small number of calls that
encrypt-file command requires.

FakeAPI is stubbed to satisfy a very small number of calls that
`encrypt-file` command requires.
@BanzaiMan BanzaiMan force-pushed the ha-encrypt-file-fix branch from bb3eddd to d718e1d Mar 4, 2020
To avoid ArgumentError
@BanzaiMan

This comment has been minimized.

Copy link
Member Author

BanzaiMan commented Mar 4, 2020

See #678.

@BanzaiMan BanzaiMan changed the title Bare minimal encrypt-file spec Add bare minimum encrypt-file spec and fix the command Mar 4, 2020
@BanzaiMan

This comment has been minimized.

Copy link
Member Author

BanzaiMan commented Mar 4, 2020

$ gem install travis
Fetching travis-1.8.11.gem
Successfully installed travis-1.8.11
1 gem installed
$ echo "bar" > food
$ travis encrypt-file food
encrypting food for travis-ci/travis.rb
storing result as food.enc
storing secure env variables for decryption
wrong number of arguments (given 1, expected 2)
for a full error report, run travis report --pro
$ travis report --pro
System
Ruby:                     Ruby 2.3.4-p301
Operating System:         Mac OS X 10.15.3
RubyGems:                 RubyGems 3.0.3

CLI
Version:                  1.8.11
Plugins:                  none
Auto-Completion:          yes
Last Version Check:       2020-03-04 15:06:09 -0500

Session
API Endpoint:             https://api.travis-ci.com/
Logged In:                as "BanzaiMan"
Verify SSL:               yes
Enterprise:               no

Endpoints
org:                      https://api.travis-ci.org/ (access token)
com:                      https://api.travis-ci.com/ (access token, current)
staging-com:              https://api-staging.travis-ci.com/ (access token)
staging-org:              https://api-staging.travis-ci.org/ (access token)

Last Exception
An error occurred running `travis encrypt-file --pro`:
    ArgumentError: wrong number of arguments (given 1, expected 2)
        from /Users/asari/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/travis-1.8.11/lib/travis/cli/encrypt_file.rb:79:in `env_name'
        from /Users/asari/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/travis-1.8.11/lib/travis/cli/encrypt_file.rb:70:in `decrypt_command'
        from /Users/asari/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/travis-1.8.11/lib/travis/cli/encrypt_file.rb:42:in `run'
        from /Users/asari/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/travis-1.8.11/lib/travis/cli/command.rb:198:in `execute'
        from /Users/asari/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/travis-1.8.11/lib/travis/cli.rb:64:in `run'
        from /Users/asari/.rbenv/versions/2.3.4/lib/ruby/gems/2.3.0/gems/travis-1.8.11/bin/travis:18:in `<top (required)>'
        from /Users/asari/.rbenv/versions/2.3.4/bin/travis:23:in `load'
        from /Users/asari/.rbenv/versions/2.3.4/bin/travis:23:in `<main>'


For issues with the command line tool, please visit https://github.com/travis-ci/travis.rb/issues.
For Travis CI in general, go to https://github.com/travis-ci/travis-ci/issues or email support@travis-ci.com.
$ pwd
/Users/asari/Development/src/travis-ci/travis.rb
$ gem build travis.gemspec
WARNING:  open-ended dependency on backports (>= 0) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  open-ended dependency on rspec-its (>= 0, development) is not recommended
  use a bounded requirement, such as '~> x.y'
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
  Successfully built RubyGem
  Name: travis
  Version: 1.8.11
  File: travis-1.8.11.gem
$ gem install ./travis-1.8.11.gem
Successfully installed travis-1.8.11
1 gem installed
$ travis encrypt-file food
encrypting food for travis-ci/travis.rb
storing result as food.enc
DANGER ZONE: Override existing food.enc? |no| yes
storing secure env variables for decryption

Please add the following to your build script (before_install stage in your .travis.yml, for instance):

    openssl aes-256-cbc -K $encrypted_39ccb32d95ed_key -iv $encrypted_39ccb32d95ed_iv -in food.enc -out food -d

Pro Tip: You can add it automatically by running with --add.

Make sure to add food.enc to the git repository.
Make sure not to add food to the git repository.
Commit all changes to your .travis.yml.
Copy link
Member

svenfuchs left a comment

👍

@BanzaiMan BanzaiMan merged commit d3eb298 into master Mar 4, 2020
2 checks passed
2 checks passed
Travis CI - Branch Build Passed
Details
Travis CI - Pull Request Build Passed
Details
@BanzaiMan BanzaiMan deleted the ha-encrypt-file-fix branch Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.