Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. ###############################################################################
  4. # Bash best practice
  5. ###############################################################################
  6.  
  7. # Exit on error. Append "|| true" if you expect an error.
  8. set -o errexit
  9. # Print a helpful message if a pipeline with non-zero exit code causes the
  10. # script to exit as described above.
  11. trap 'echo "Aborting due to errexit on line $LINENO. Exit code: $?" >&2' ERR
  12.  
  13. # Exit on error inside any functions or subshells.
  14. set -o errtrace
  15. # Do not allow use of undefined vars. Use ${VAR:-} to use an undefined VAR
  16. set -o nounset
  17.  
  18.  
  19. ###############################################################################
  20. # Functions
  21. ###############################################################################
  22.  
  23. echo "Step 1"; echo; echo; sleep 1;
  24.  
  25. docker build -t machinepacket .
  26. echo "Build docker image: "; echo; echo;
  27.  
  28. echo "Step 2"; echo; echo; sleep 1;
  29.  
  30. docker run --rm -it machinepacket \
  31. docker-machine create sloth --driver packet --packet-api-key=q09rghq309ghq309ghq0395gh --packet-os=ubuntu_16_04 --packet-project-id=DIVA03 --packet-facility-code "ewr1" --packet-plan "baremetal_0"
  32.  
  33. # Buzz me on Slack
  34. # /create a function via cmd.sh
  35.  
  36. echo "Step 3 - Done"; echo; echo; sleep 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement