Skip to content

Instantly share code, notes, and snippets.

@jml
Created March 8, 2015 12:05
Show Gist options
  • Save jml/111439c3307deef0787a to your computer and use it in GitHub Desktop.
Save jml/111439c3307deef0787a to your computer and use it in GitHub Desktop.
WIP ansible for Haskell build machine
---
- hosts: all
tasks:
# XXX: This is pretty manual. Would just like a thing that says 'install
# these packages from this PPA'
- name: approve cabal PPA
apt_key: keyserver=keyserver.ubuntu.com
id=063DAB2BDC0B3F9FCEBC378BFF3AEACEF6F88286
state=present
sudo: yes
- name: add cabal PPA
apt_repository: repo='ppa:hvr/ghc' state=present
sudo: yes
- name: apt-get update
sudo: yes
apt: update_cache=yes
- name: install cabal and ghc
sudo: yes
apt: pkg={{item}} state=latest
with_items:
- ghc-7.8.4
- cabal-install-1.20
- happy-1.19.4
- alex-3.1.3
- libz-dev
- name: create a user to do the builds
sudo: yes
user: name=cabal-builder shell=/bin/bash state=present
# XXX: Perhaps a good idea to remove the PPA?
# XXX: export PATH=/opt/ghc/7.8.4/bin:/opt/cabal/1.20/bin:/opt/happy/XXX/bin:/opt/alex/XXX/bin:$PATH
- name: update package list
command: cabal update
- name: upgrade to latest cabal
command: cabal install cabal-install
# XXX: At this point, we have a Linux box configured to build Haskell
# packages.
#
# What's the next step? We want to be able to build:
# - current working copy
# - a given label / revid
#
# We want to not overwrite the build artifacts from OS X (because that's
# just confusing), so that means no using the /vagrant directory
# cabal install cabal-install
# cabal sandbox init
# cabal install --dependencies-only
# cabal build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment