Last active
September 27, 2016 21:41
-
-
Save chrisforrette/95861ac35882c10c554d to your computer and use it in GitHub Desktop.
CircleCI Libsass Configuration
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
| dependencies: | |
| cache_directories: | |
| - sassc | |
| - libsass | |
| post: | |
| - if [[ ! -e sassc ]]; then git clone [email protected]:sass/sassc.git sassc; fi | |
| - if [[ ! -e libsass ]]; then git clone --recursive [email protected]:sass/libsass.git && cd sassc && export SASS_LIBSASS_PATH=$(readlink -f ../libsass) && make && cd ..; fi | |
| - ln -s sassc/bin/sassc ~/bin/sassc |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a chunk of configuration to drop in to a CircleCI YAML file (see here for configuration documentation). This pulls down SassC and Libsass manually from their respective Github repositories and sets them up to be followed up with something like node-sass to compile Sass files with Libsass.
The
cache_directoriesstanza ensures that the Git clone process doesn't need to take place for every single build.At Jolby we hook into the
deploymentstanza where we would run an NPM script to build the CSS. Something like this would sit inpackage.json:{ "scripts": { "build:css": "node-sass ./app/static/scss/app.scss --precision 7 --stdout --include-path ./node_modules/ | autoprefixer -o ./app/static/build/css/app.css" } }And in our
circleci.ymlwe would add something like this:The
fab ...command leverages Fabric, running astagingcommand to point any subsequent commands at staging server(s), followed by abuildcommand that would triggernpm run build:css, along with other build process such as Javascript compilation, followed by adeploycommand that sends over the bundled up build artifacts to the server viarsyncor something similar, followed by a restart or something along those lines.