Skip to content

Instantly share code, notes, and snippets.

@maxfi
Created February 1, 2016 13:07
Show Gist options
  • Save maxfi/7d3e1084a2558d026996 to your computer and use it in GitHub Desktop.
Save maxfi/7d3e1084a2558d026996 to your computer and use it in GitHub Desktop.
Migrate environment variables from one resin.io project to another project
#!/bin/bash
# Creates script output
# $1 = app to get ENVs from
# $2 = app to set ENVs to
resin envs --application $1 | tail -n +2 | sed 's/^[0-9]* //gm' | sed "s/ \+/ '/gm" | sed "s/$/'/m" | sed 's/^/resin env add /m' | sed "s/$/ --application $2/m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment