forked from jadudm/cgov-util
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
So that we allow this package to manage aws installation on cloud.gov when it needs it.
- Loading branch information
1 parent
87cb2f0
commit a7518b9
Showing
2 changed files
with
58 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package util | ||
|
||
import ( | ||
"os" | ||
"strings" | ||
|
||
"github.com/bitfield/script" | ||
"gov.gsa.fac.cgov-util/internal/logging" | ||
) | ||
|
||
func InstallAWS() { | ||
// curl -x $https_proxy -L "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | ||
getaws := []string{ | ||
"curl", | ||
"-x", | ||
os.Getenv("https_proxy"), | ||
"-L", | ||
"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip", | ||
"-o", | ||
"awscliv2.zip", | ||
} | ||
curlaws := strings.Join(getaws[:], " ") | ||
logging.Logger.Printf("Fetching aws cli via curl...") | ||
script.Exec(curlaws) | ||
|
||
// unzip awscliv2.zip && rm awscliv2.zip | ||
unzipaws := []string{ | ||
"unzip", | ||
"awscliv2.zip", | ||
"&&", | ||
"rm", | ||
"awscliv2.zip", | ||
} | ||
logging.Logger.Printf("Unzipping aws cli...") | ||
unzip := strings.Join(unzipaws[:], " ") | ||
script.Exec(unzip) | ||
|
||
// ./aws/install -i ~/usr -b ~/bin | ||
installaws := []string{ | ||
"./aws/install", | ||
"-i", | ||
"~/usr", | ||
"-b", | ||
"~/bin", | ||
} | ||
logging.Logger.Printf("Installing aws to bin...") | ||
install := strings.Join(installaws[:], " ") | ||
script.Exec(install) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters