Created
March 15, 2016 06:31
-
-
Save bwbaugh/2f3827e798d821bff03d to your computer and use it in GitHub Desktop.
EC2 user data script to install Haskell stack on Amazon Linux in order to build executables for AWS Lambda.
This file contains hidden or 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
#!/bin/bash | |
yum update -y | |
curl -sSL https://s3.amazonaws.com/download.fpcomplete.com/centos/7/fpco.repo | tee /etc/yum.repos.d/fpco.repo | |
yum -y install stack | |
sudo -H -u ec2-user -- stack setup | |
# TODO(2016-04-14): Maybe download files and run `stack build`. | |
# NOTE: This script is mostly just for fun // a learning exercise. It's | |
# probably better to use something like Travis CI that can cache the | |
# ~/.stack/ directory to make build times reasonable. Though the | |
# whole point of this is to run on Amazon Linux for building static | |
# executables to run on AWS Lambda. | |
# To build a static executable, he ghc-options in the cabal file will | |
# need to be set to: | |
# -fforce-recomp -static -optc-static -optl-static -optl-pthread |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment