generated from replikativ/datahike-backend-template
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: switch to replikativ workflow (#24)
- Loading branch information
1 parent
d7609c8
commit fad8985
Showing
7 changed files
with
154 additions
and
83 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# These are supported funding model platforms | ||
|
||
github: replikativ |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
(ns build | ||
(:refer-clojure :exclude [test]) | ||
(:require [clojure.tools.build.api :as b] | ||
[borkdude.gh-release-artifact :as gh] | ||
[deps-deploy.deps-deploy :as dd]) | ||
(:import [clojure.lang ExceptionInfo])) | ||
|
||
(def org "replikativ") | ||
(def lib 'io.replikativ/datahike-jdbc) | ||
(def current-commit (b/git-process {:git-args "rev-parse HEAD"})) | ||
(def version (format "0.1.%s" (b/git-count-revs nil))) | ||
(def class-dir "target/classes") | ||
(def basis (b/create-basis {:project "deps.edn"})) | ||
(def jar-file (format "target/%s-%s.jar" (name lib) version)) | ||
|
||
(defn clean | ||
[_] | ||
(b/delete {:path "target"})) | ||
|
||
(defn jar | ||
[_] | ||
(b/write-pom {:class-dir class-dir | ||
:src-pom "./template/pom.xml" | ||
:lib lib | ||
:version version | ||
:basis basis | ||
:src-dirs ["src"]}) | ||
(b/copy-dir {:src-dirs ["src" "resources"] | ||
:target-dir class-dir}) | ||
(b/jar {:class-dir class-dir | ||
:jar-file jar-file})) | ||
|
||
(defn deploy | ||
"Don't forget to set CLOJARS_USERNAME and CLOJARS_PASSWORD env vars." | ||
[_] | ||
(dd/deploy {:installer :remote :artifact jar-file | ||
:pom-file (b/pom-path {:lib lib :class-dir class-dir})})) | ||
|
||
(defn fib [a b] | ||
(lazy-seq (cons a (fib b (+ a b))))) | ||
|
||
(defn retry-with-fib-backoff [retries exec-fn test-fn] | ||
(loop [idle-times (take retries (fib 1 2))] | ||
(let [result (exec-fn)] | ||
(if (test-fn result) | ||
(do (println "Returned: " result) | ||
(if-let [sleep-ms (first idle-times)] | ||
(do (println "Retrying with remaining back-off times (in s): " idle-times) | ||
(Thread/sleep (* 1000 sleep-ms)) | ||
(recur (rest idle-times))) | ||
result)) | ||
result)))) | ||
|
||
(defn try-release [] | ||
(try (gh/overwrite-asset {:org org | ||
:repo (name lib) | ||
:tag version | ||
:commit current-commit | ||
:file jar-file | ||
:content-type "application/java-archive" | ||
:draft false}) | ||
(catch ExceptionInfo e | ||
(assoc (ex-data e) :failure? true)))) | ||
|
||
(defn release | ||
[_] | ||
(println "Trying to release artifact...") | ||
(let [ret (retry-with-fib-backoff 10 try-release :failure?)] | ||
(if (:failure? ret) | ||
(do (println "GitHub release failed!") | ||
(System/exit 1)) | ||
(println (:url ret))))) | ||
|
||
(defn install | ||
[_] | ||
(clean nil) | ||
(jar nil) | ||
(b/install {:basis (b/create-basis {}) | ||
:lib lib | ||
:version version | ||
:jar-file jar-file | ||
:class-dir class-dir})) | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
{:deps {org.clojure/clojure {:mvn/version "1.11.1" :scope "provided"} | ||
io.replikativ/konserve-jdbc {:mvn/version "0.1.1"}} | ||
{:deps {org.clojure/clojure {:mvn/version "1.11.1" :scope "provided"} | ||
io.replikativ/konserve-jdbc {:mvn/version "0.1.79"}} | ||
:paths ["src"] | ||
:aliases {:test {:extra-paths ["test"] | ||
:extra-deps {lambdaisland/kaocha {:mvn/version "1.60.977"} | ||
io.replikativ/datahike {:mvn/version "RELEASE"}} | ||
:extra-deps {lambdaisland/kaocha {:mvn/version "1.84.1335"} | ||
io.replikativ/datahike {:mvn/version "0.6.1541"}} | ||
:main-opts ["-m" "kaocha.runner"]} | ||
|
||
:repl {:extra-deps {cider/cider-nrepl {:mvn/version "0.27.4"} | ||
nrepl/nrepl {:mvn/version "0.9.0"} | ||
org.clojure/tools.namespace {:mvn/version "1.2.0"}} | ||
:main-opts ["-m" "nrepl.cmdline" "--middleware" "[cider.nrepl/cider-middleware]"]} | ||
|
||
:jar {:extra-deps {com.github.seancorfield/depstar {:mvn/version "1.1.136"}} | ||
:main-opts ["-m" "hf.depstar.jar" "replikativ-konserve-jdbc.jar"]} | ||
|
||
:deploy {:extra-deps {slipset/deps-deploy {:mvn/version "0.2.0"}} | ||
:main-opts ["-m" "deps-deploy.deps-deploy" "deploy" "replikativ-datahike-jdbc.jar"]} | ||
|
||
:install {:extra-deps {slipset/deps-deploy {:mvn/version "0.2.0"}} | ||
:exec-fn deps-deploy.deps-deploy/deploy | ||
:exec-args {:installer :local | ||
:artifact "replikativ-datahike-jdbc.jar"}} | ||
|
||
:format {:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}} | ||
:format {:extra-deps {cljfmt/cljfmt {:mvn/version "0.9.2"}} | ||
:main-opts ["-m" "cljfmt.main" "check"]} | ||
|
||
:ffix {:extra-deps {cljfmt/cljfmt {:mvn/version "0.8.0"}} | ||
:main-opts ["-m" "cljfmt.main" "fix"]}}} | ||
:ffix {:extra-deps {cljfmt/cljfmt {:mvn/version "0.9.2"}} | ||
:main-opts ["-m" "cljfmt.main" "fix"]} | ||
|
||
:build {:deps {io.github.clojure/tools.build {:mvn/version "0.9.3"} | ||
slipset/deps-deploy {:mvn/version "0.2.0"} | ||
io.github.borkdude/gh-release-artifact {:git/sha "05f8d8659e6805d513c59447ff41dc8497878462"} | ||
babashka/babashka.curl {:mvn/version "0.1.2"} | ||
babashka/fs {:mvn/version "0.1.6"} | ||
cheshire/cheshire {:mvn/version "5.10.2"}} | ||
:ns-default build}}} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
version: '3.3' | ||
|
||
services: | ||
mysql: | ||
image: docker.io/mysql:8 | ||
restart: always | ||
command: --max_allowed_packet=32505856 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: password | ||
MYSQL_DATABASE: config-test | ||
MYSQL_USER: alice | ||
MYSQL_PASSWORD: foo | ||
ports: | ||
- 3306:3306 | ||
|
||
postgres: | ||
image: docker.io/postgres:14 | ||
restart: always | ||
environment: | ||
POSTGRES_DB: config-test | ||
POSTGRES_USER: alice | ||
POSTGRES_PASSWORD: foo | ||
ports: | ||
- "5432:5432" | ||
|
||
mssql: | ||
image: mcr.microsoft.com/mssql/server:2019-latest | ||
restart: always | ||
environment: | ||
ACCEPT_EULA: Y | ||
SA_PASSWORD: passwordA1! | ||
MSSQL_PID: Developer | ||
MSSQL_TCP_PORT: 1433 | ||
ports: | ||
- 1433:1433 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>io.replikativ</groupId> | ||
<groupId>org.clojars.timokramer</groupId> | ||
<artifactId>datahike-jdbc</artifactId> | ||
<packaging>jar</packaging> | ||
<name>datahike-jdbc</name> | ||
<description>A JDBC backend for Datahike</description> | ||
<version>0.1.2</version> | ||
<url>https://datahike.io</url> | ||
<licenses> | ||
<license> | ||
|
@@ -19,23 +18,6 @@ | |
<developerConnection>scm:git:[email protected]/replikativ/datahike-jdbc.git</developerConnection> | ||
<url>https://github.com/replikativ/datahike-jdbc</url> | ||
</scm> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.clojure</groupId> | ||
<artifactId>clojure</artifactId> | ||
<version>1.10.3</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.replikativ</groupId> | ||
<artifactId>konserve-jdbc</artifactId> | ||
<version>0.1.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.replikativ</groupId> | ||
<artifactId>superv.async</artifactId> | ||
<version>0.2.11</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<sourceDirectory>src</sourceDirectory> | ||
</build> | ||
|