Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions command/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ type suripuApp struct {
}

//This hash should be updated anytime default_userdata.sh is updated on S3
// Update using the provided script `sanders/scripts/userdata-update` or manually use `openssl sha1 <file>`

var expectedUserDataHash = "78c2b582d19f302b956ddae0c30086a00abf2f1f"

var suripuApps []suripuApp = []suripuApp{
Expand Down
17 changes: 17 additions & 0 deletions scripts/userdata-update
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

echo $GOPATH
src_path="${GOPATH}src/github.com/hello/sanders/"
userdata="${src_path}resources/default_userdata.sh"
create_cmd="${src_path}command/create.go"
sha=$(openssl sha1 $userdata | awk '{print $2}')
sub=$(sed -e "s/^var\ expectedUser.*/var\ expectedUserDataHash\ =\ \"$sha\"/" $create_cmd > temp)
mv temp $create_cmd

#Upload default_userdata.sh to S3
aws s3 cp $userdata s3://hello-deploy/userdata/

if [[ "$?" -ne 0 ]]; then
err "Failed to upload userdata"
exit 1
fi