Travis-ci decryption of encrypted files

后端 未结 2 2008
伪装坚强ぢ
伪装坚强ぢ 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: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: 
    

提交回复
热议问题