Skip to content

Instantly share code, notes, and snippets.

@helins
Last active June 5, 2021 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save helins/59e3abfc96f7a641d608a314fb6b8665 to your computer and use it in GitHub Desktop.
Save helins/59e3abfc96f7a641d608a314fb6b8665 to your computer and use it in GitHub Desktop.
Command for installing and caching Babashka on CircleCI
commands:
install_bb:
description: "Install Babashka"
parameters:
version:
default: "0.4.4"
type: string
steps:
- restore_cache:
keys:
- babashka-<< parameters.version >>
- run:
name: Download Babashka
command: if ! [ -f "bb" ]; then \curl -L https://github.com/babashka/babashka/releases/download/v<< parameters.version >>/babashka-<< parameters.version >>-linux-amd64.tar.gz -o bb.tar.gz ; fi
- run:
name: Uncompress Babashka
command: if [ -f "bb.tar.gz" ]; then \tar -xzvf bb.tar.gz ; fi
- run:
name: Ensure Babashka is executable
command: chmod +x bb
- save_cache:
key: babashka-<< parameters.version >>
paths:
- bb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment