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

cannot encrypt a variable when we use the non interactive function #738

Closed
p3x-robot opened this issue Apr 17, 2020 · 12 comments · Fixed by #741
Closed

cannot encrypt a variable when we use the non interactive function #738

p3x-robot opened this issue Apr 17, 2020 · 12 comments · Fixed by #741

Comments

@p3x-robot
Copy link

p3x-robot commented Apr 17, 2020

patrikx3@workstation:~/Projects/patrikx3/redis-ui-workspace/redis-ui$ travis encrypt 'GH_TOKEN=12345' -r patrikx3/redis-u--add --pro -i


Overwrite the config file /home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui/.travis.yml with the content below?

This reformats the existing file.
os: osx
osx_image: xcode8
language: node_js
cache:
  npm: false
node_js:
- node
before_script:
- npm install -g grunt-cli npm
- export CSC_IDENTITY_AUTO_DISCOVERY=false
- npm run publish-osx
env:
  global:
  - secure: J79NeoXU/k9mr48U7ZG2JpivEZiZEc2ipdz8Am+g8wlKnBzoE6jj2Al7eysKwTLr+zizmo+xYRMKJMYd6F9wQ57WzHo4T1Xw7b+nPnRVxlzS/sm6NlbZ3GNRLQ9QivVpQicu/IRBB5eN+FEJ9G5Evr2lz2Ze2An3f7TYYpK4MitsTMl8eElj24CKryqp+n/MDQ0IoH5Pce/HuVgL+v7N6XmLPiuOJQbbHPUaktzo5gU+LPkQim5BdTcM3VRzLw/m2TYNuuRNUzgMcRw0pEZcqoZ/FtUtBUES7tDEpwUMsrQ/YfzvmmPVNE82Dc+iaYID93hS+GG6+Y4SZikXdBjMubAbfAC8obqVUgbIR0p1FlaNj4yZfs44Lr69S0r85zvOlzvS6hvbKz+pLsbPanduOx6vtK2cCEJfeJG4iXKRhUYdKiPJkRE61S+7uRHV8ysBDZszQlU/c/HzmH27CykrhJEOcqRHCkfMCbF1T+OiHnDK1X0iqzo3urTIWjzgNIexWETQs9ls68D9HaSz2biG0qYStR0q1qA0lZSvq6fWHc1YTm8kg6Q98/TjXYChsDUT/xLe/31hSO8AmjwQ8ESsfvot6yl5w+qgM8tFeAGA1faWHOCtLhbbIFVagXQ/3iuihjxHgy+ALvB9fysUpMRingzE3o3z84RxYJjP3fug0r0=
  - secure: yJ+nNWW70UrnWnSzyQhn184mDXUuGoFl9SfdaN+EMdYu6xzPUTpLJDspE5YdHaH2sSebi2CTLDiEysTPVqxOqI+Tqudbl3IgdcqippCPVMPKkzReLfQ2PYHvTifSA82Bykv4HfquAWPLqFqOClvwDC0+13xF1dPfg2gn7EsOfoOFaJ8RGMm0yqSiMKQZL/lnQ264SZfFYRmTCSgEwE+e2Udcgg7Ln9N5wJMMxiup+KCEPNV3C2QmXxqs8UAYDWVqSHUO8GpQ5xQQhNCk/SRjeJoxmonA+bQnRQE7ANXUQpnJP9/xKQBnAITACK7wzu/LMnWPNXBzl0l+Hoyuu3p1Hrjgp8whzkLSSPmc0nFpJLw4GovJshJnIxYmxsYCATCOB/Npk0uaelYTniTT3NhKiOUAk/hYUnCV52rEjqL2zfm1uniXjs+AFeOsWHRAWsNZJ1yjG41T2Vi23/QewyErjJS1g6OOAEGs5hHoFU4T7DaLhkbNSuqEVY01o0TMfnXYrcYf1h8FTfG4OR4LkzYvgNv5Y6Vy0MI+123/UxxVjC+mqyA3lAl724hKbv6BPEml1I8WYi7OIN8HxQu47FOwuDnKQqZ/TwdkPXeh6eidPm8aGJfRvkCRFHSXy8zzjoFgg7GBi0hl+V7MIDGvcTIARc8pTG3MvdPYtfNqV10YKug=
(y/N)

As y ou can see, it asks for Y/N, when this is automated. How can i force it to always be yes?

@p3x-robot
Copy link
Author

p3x-robot commented Apr 17, 2020

When i use the --no-interactive flag as:

travis encrypt 'GH_TOKEN=1234' -r patrikx3/redis-ui --add --pro --no-interactive

it actually removes the variable... and show as this:

os: osx
osx_image: xcode8
language: node_js
cache:
    npm: false
node_js:
    - node
before_script:
    - 'npm install -g grunt-cli npm'
    - 'export CSC_IDENTITY_AUTO_DISCOVERY=false'
    - 'npm run publish-osx'

@p3x-robot
Copy link
Author

how can i automate encrypting the travis variable without interaction?

@BanzaiMan
Copy link
Contributor

Did this work for you? patrikx3/redis-ui@1dbd363

or did you do something different?

@p3x-robot
Copy link
Author

i can encrypt if i do it with manual, but i have 40 projects and i have to update the git hub token and i have an autmatic encrypt process, but since the last time, it is asking for y/n. so i asks for permission, i ask for a flag that auto allow to ask this permission

@BanzaiMan
Copy link
Contributor

I see the issue. I'll work on a fix shortly.

@BanzaiMan
Copy link
Contributor

BTW, the proper invocation should be

travis encrypt 'GH_TOKEN=12345' -r patrikx3/redis-ui --add --pro --no-interactive

(which doesn't work as of 1.9.0)

@p3x-robot
Copy link
Author

still not working:

patrikx3@workstation:~/Projects/patrikx3/p3x/tools$ sudo gem install travis && travis encrypt 'GH_TOKEN=test' -r patrikx3/tools --add --pro --no-interactive && cat .travis.yml 
Successfully installed travis-1.9.0
Parsing documentation for travis-1.9.0
Done installing documentation for travis after 0 seconds
1 gem installed
language: node_js
cache:
    npm: false
node_js:
    - 'lts/*'
before_script:
    - 'npm install -g grunt-cli npm'
patrikx3@workstation:~/Projects/patrikx3/p3x/tools$ 

As you can see. It is not including the GH_TOKEN

On the other hand, if it allows to ask for permissions, it works (no --no-interactive):

patrikx3@workstation:~/Projects/patrikx3/p3x/tools$ sudo gem install travis && travis encrypt 'GH_TOKEN=test' -r patrikx3/tools --add --pro && cat .travis.yml 
Successfully installed travis-1.9.0
Parsing documentation for travis-1.9.0
Done installing documentation for travis after 0 seconds
1 gem installed


Overwrite the config file /home/patrikx3/Projects/patrikx3/p3x/tools/.travis.yml with the content below?

This reformats the existing file.

---
language: node_js
cache:
  npm: false
node_js:
- lts/*
before_script:
- npm install -g grunt-cli npm
env:
  global:
    secure: UwDM3bveI00exkkPcVz0I5sVvY6NmGJpMmzdiY/tBj8EdGb5+/VFcuhBaney9VlO4TFO2JV5ACkXmcAql0f2fjS3TcNGoH0woY91o0CSUrdx1P/YnLQLVwwq5k1ziX0JKIajPwlHa2v5RJ4u/DJP5fyJL6nnQpCNhIUL/5rHWSY33JNc9fFGaIBlH4Aghumd63kMHvrn/VxT9lDI2tsyrWruNFg57RoCKwpDSGUF1Z8WOVr389XLCggLgRaAtDkU525JmU+jMXo0Zc5+zIMaJQcU3AnjepxVTP23sijPxIu0oKG4a3WiWPaoQBT4N3IjnYSjiqFW6fgBuru2nCuIEGUJu/PKhSjXzNOs8yNg65va7EvXH5s7O/xJMfsn4MzMa57d19yz6D1aYR6xFcL7k5HEbLlaMNv/gu9ud100IM7UuPWiXpDQtggQOoocuBH/Dho+RykTmBlI8LP+8InVihWHHeFlLsTIxt08e5YezWHQSdXTcF0bSRvIo9andWQ1R+syKe9tykddjf+Bfam8dy6KAR8kggsfC+pzDjGXx9qQE9mSW0kY+UBITg4R+4L+8LYSPh86DiZ8cuSqLlbtGjNRTURv6zRzwhd8G8oS3Sg2kkTL3YuXM05FlQMjL69VymnzROAlCr90RrTsDjzQh63KRiZlslqIusz5EHRxIjY=


(y/N)
y
language: node_js
cache:
  npm: false
node_js:
- lts/*
before_script:
- npm install -g grunt-cli npm
env:
  global:
    secure: UwDM3bveI00exkkPcVz0I5sVvY6NmGJpMmzdiY/tBj8EdGb5+/VFcuhBaney9VlO4TFO2JV5ACkXmcAql0f2fjS3TcNGoH0woY91o0CSUrdx1P/YnLQLVwwq5k1ziX0JKIajPwlHa2v5RJ4u/DJP5fyJL6nnQpCNhIUL/5rHWSY33JNc9fFGaIBlH4Aghumd63kMHvrn/VxT9lDI2tsyrWruNFg57RoCKwpDSGUF1Z8WOVr389XLCggLgRaAtDkU525JmU+jMXo0Zc5+zIMaJQcU3AnjepxVTP23sijPxIu0oKG4a3WiWPaoQBT4N3IjnYSjiqFW6fgBuru2nCuIEGUJu/PKhSjXzNOs8yNg65va7EvXH5s7O/xJMfsn4MzMa57d19yz6D1aYR6xFcL7k5HEbLlaMNv/gu9ud100IM7UuPWiXpDQtggQOoocuBH/Dho+RykTmBlI8LP+8InVihWHHeFlLsTIxt08e5YezWHQSdXTcF0bSRvIo9andWQ1R+syKe9tykddjf+Bfam8dy6KAR8kggsfC+pzDjGXx9qQE9mSW0kY+UBITg4R+4L+8LYSPh86DiZ8cuSqLlbtGjNRTURv6zRzwhd8G8oS3Sg2kkTL3YuXM05FlQMjL69VymnzROAlCr90RrTsDjzQh63KRiZlslqIusz5EHRxIjY=
patrikx3@workstation:~/Projects/patrikx3/p3x/tools$ 

I suppose --no-interactive is not working as expected.

@BanzaiMan
Copy link
Contributor

1.9.0 doesn't have it. You'll need to install the pre-release version with --pre: gem install travis --pre.

@BanzaiMan
Copy link
Contributor

And you need the --no-interactive flag, since the -i/--interactive is the default.

@p3x-robot
Copy link
Author

And you need the --no-interactive flag, since the -i/--interactive is the default.

ok, thanks.

@BerninaMad
Copy link

patrikx3@workstation:~/Projects/patrikx3/redis-ui-workspace/redis-ui$ travis encrypt 'GH_TOKEN=12345' -r patrikx3/redis-u--add --pro -i


Overwrite the config file /home/patrikx3/Projects/patrikx3/redis-ui-workspace/redis-ui/.travis.yml with the content below?

This reformats the existing file.
os: osx
osx_image: xcode8
language: node_js
cache:
  npm: false
node_js:
- node
before_script:
- npm install -g grunt-cli npm
- export CSC_IDENTITY_AUTO_DISCOVERY=false
- npm run publish-osx
env:
  global:
  - secure: J79NeoXU/k9mr48U7ZG2JpivEZiZEc2ipdz8Am+g8wlKnBzoE6jj2Al7eysKwTLr+zizmo+xYRMKJMYd6F9wQ57WzHo4T1Xw7b+nPnRVxlzS/sm6NlbZ3GNRLQ9QivVpQicu/IRBB5eN+FEJ9G5Evr2lz2Ze2An3f7TYYpK4MitsTMl8eElj24CKryqp+n/MDQ0IoH5Pce/HuVgL+v7N6XmLPiuOJQbbHPUaktzo5gU+LPkQim5BdTcM3VRzLw/m2TYNuuRNUzgMcRw0pEZcqoZ/FtUtBUES7tDEpwUMsrQ/YfzvmmPVNE82Dc+iaYID93hS+GG6+Y4SZikXdBjMubAbfAC8obqVUgbIR0p1FlaNj4yZfs44Lr69S0r85zvOlzvS6hvbKz+pLsbPanduOx6vtK2cCEJfeJG4iXKRhUYdKiPJkRE61S+7uRHV8ysBDZszQlU/c/HzmH27CykrhJEOcqRHCkfMCbF1T+OiHnDK1X0iqzo3urTIWjzgNIexWETQs9ls68D9HaSz2biG0qYStR0q1qA0lZSvq6fWHc1YTm8kg6Q98/TjXYChsDUT/xLe/31hSO8AmjwQ8ESsfvot6yl5w+qgM8tFeAGA1faWHOCtLhbbIFVagXQ/3iuihjxHgy+ALvB9fysUpMRingzE3o3z84RxYJjP3fug0r0=
  - secure: yJ+nNWW70UrnWnSzyQhn184mDXUuGoFl9SfdaN+EMdYu6xzPUTpLJDspE5YdHaH2sSebi2CTLDiEysTPVqxOqI+Tqudbl3IgdcqippCPVMPKkzReLfQ2PYHvTifSA82Bykv4HfquAWPLqFqOClvwDC0+13xF1dPfg2gn7EsOfoOFaJ8RGMm0yqSiMKQZL/lnQ264SZfFYRmTCSgEwE+e2Udcgg7Ln9N5wJMMxiup+KCEPNV3C2QmXxqs8UAYDWVqSHUO8GpQ5xQQhNCk/SRjeJoxmonA+bQnRQE7ANXUQpnJP9/xKQBnAITACK7wzu/LMnWPNXBzl0l+Hoyuu3p1Hrjgp8whzkLSSPmc0nFpJLw4GovJshJnIxYmxsYCATCOB/Npk0uaelYTniTT3NhKiOUAk/hYUnCV52rEjqL2zfm1uniXjs+AFeOsWHRAWsNZJ1yjG41T2Vi23/QewyErjJS1g6OOAEGs5hHoFU4T7DaLhkbNSuqEVY01o0TMfnXYrcYf1h8FTfG4OR4LkzYvgNv5Y6Vy0MI+123/UxxVjC+mqyA3lAl724hKbv6BPEml1I8WYi7OIN8HxQu47FOwuDnKQqZ/TwdkPXeh6eidPm8aGJfRvkCRFHSXy8zzjoFgg7GBi0hl+V7MIDGvcTIARc8pTG3MvdPYtfNqV10YKug=
(y/N)

As y ou can see, it asks for Y/N, when this is automated. How can i force it to always be yes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants
@BanzaiMan @p3x-robot @BerninaMad and others