Travis-ci decryption of encrypted files

后端 未结 2 2005
伪装坚强ぢ
伪装坚强ぢ 2021-01-18 04:55

I encrypted my .env file, and I now have a .env.enc file. How does my team decrypt this? I got this response when I encrypted the file, and it is stored in my .

相关标签:
2条回答
  • 2021-01-18 05:33

    Check the output of travis encrypt-file !

    Especially the first line:

    encrypting <filename> for <repository name>
    [..]
    

    You need to be in the correct repo (and use --com if needed) to be sure that Travis will find the generated values it later needs.

    0 讨论(0)
  • 2021-01-18 05:56

    Your file is probably decrypted somewhere during the build on Travis. It might be easiest to add a deploy step to the build, so the .env file is uploaded to a place where you can download it yourself.

    For details on how to deploy files, check this link or this one specifically for github

    Here's a short sample of what I did ;)

    in .travis.yml

    before_install:
      // Somewhere your files are being decrypted 
      openssl aes-256-cbc -K $encrypted_cf94abc85bdc_key -iv $encrypted_cf94abc85bdc_iv -in .env.enc -out .env -d
    
    // Add a deploy step, which allows you which files to upload
    deploy:
      file: 
      - .env  /* add the file here, so it will be pushed to github */
      api_key: $apikey
      on:
        repo: <your github repo>
    
    0 讨论(0)
提交回复
热议问题