Skip to content

Commit

Permalink
Circleci project setup (#3)
Browse files Browse the repository at this point in the history
* Add .circleci/config.yml

* Add Build and deploy config and script
  • Loading branch information
bsless authored Dec 14, 2020
1 parent 7dde73d commit 38c57c4
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Clojure CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-clojure/ for more details
#
version: 2
workflows:
version: 2
ci:
jobs:
- test
- deploy:
context: Clojars
requires:
- test
filters:
branches:
only: master
jobs:
test:
docker:
- image: circleci/clojure:lein-2.9.3
working_directory: ~/repo
environment:
LEIN_ROOT: "true"
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "project.clj" }}
- v1-dependencies-
- run: lein deps
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "project.clj" }}
- run: lein test

deploy:
docker:
- image: circleci/clojure:lein-2.9.3
working_directory: ~/repo
environment:
LEIN_ROOT: "true"
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "project.clj" }}
- v1-dependencies-
- run: .circleci/script/deploy
- save_cache:
paths:
- ~/.m2
key: v1-dependencies-{{ checksum "project.clj" }}
8 changes: 8 additions & 0 deletions .circleci/script/deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" = "master" ] && ! head -1 project.clj | grep -q SNAPSHOT
then
lein do clean, deploy clojars
fi

exit 0;

0 comments on commit 38c57c4

Please sign in to comment.