Skip to content

Commit

Permalink
Add pack_and_deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
oconn committed Jul 16, 2019
1 parent c046ef3 commit 1b79a01
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 4 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@

Port of [Day8/re-frame](https://github.com/Day8/re-frame) - desinged to work with [hx](https://github.com/Lokeh/hx) and [React's](https://reactjs.org/) [hook](https://reactjs.org/docs/hooks-intro.html) & [Context API's](https://reactjs.org/docs/context.html)

#### NOTE: Not production ready
## Install

[![Clojars Project](https://img.shields.io/clojars/v/oconn/hx-frame.svg)](https://clojars.org/oconn/hx-frame)

**Note** This project is currently in alpha and the API may change in future releases.
33 changes: 33 additions & 0 deletions bin/pack_and_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

if [[ $(git diff --stat) != '' ]]; then
echo "Error: dirty repo"
exit 1
elif [[ $(git rev-parse --show-toplevel) != $(pwd) ]]; then
echo "Error: Not in root directory"
exit 1
elif [ -z "$CLOJARS_USERNAME" ]; then
echo "Error: CLOJARS_USERNAME is empty"
exit 1
elif [ -z "$CLOJARS_PASSWORD" ]; then
echo "Error: CLOJARS_PASSWORD is empty"
exit 1
fi

# Generate pom file
clojure -Spom

perl -pi -e "s/HEAD/$(git rev-parse HEAD)/g" pom.xml

# Generate jar file
rm -f app.jar
clojure -Apack

# Upload to clojars
clj -Adeploy

perl -pi -e "s/$(git rev-parse HEAD)/HEAD/g" pom.xml

# Format pom file
xmllint --format pom.xml > pom.xml-formatted
mv pom.xml-formatted pom.xml
22 changes: 19 additions & 3 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
{:deps {lilactown/hx {:mvn/version "0.5.2"}
org.clojure/clojurescript {:mvn/version "1.10.520"}}
:paths ["src"]
:aliases {:test {:extra-paths ["test"]
:extra-deps {olical/cljs-test-runner {:mvn/version "3.5.0"}}
:main-opts ["-m" "cljs-test-runner.main"]}}}
:aliases {:test
{:extra-paths ["test"]
:extra-deps {olical/cljs-test-runner {:mvn/version "3.5.0"}}
:main-opts ["-m" "cljs-test-runner.main"]}

:pack
{:main-opts
["-m" "mach.pack.alpha.skinny" "--no-libs" "--project-path" "app.jar"]

:extra-deps
{pack/pack.alpha {:git/url "https://github.com/juxt/pack.alpha.git"
:sha "2769a6224bfb938e777906ea311b3daf7d2220f5"}}}

:deploy
{:main-opts
["-m" "deps-deploy.deps-deploy" "deploy" "app.jar"]

:extra-deps
{deps-deploy {:mvn/version "RELEASE"}}}}}
40 changes: 40 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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">
<scm>
<connection>scm:git:git://github.com/oconn/hx-frame.git</connection>
<developerConnection>scm:git:ssh://git@github.com/oconn/hx-frame.git</developerConnection>
<url>https://github.com/oconn/hx-frame</url>
<tag>HEAD</tag>
</scm>
<modelVersion>4.0.0</modelVersion>
<groupId>oconn</groupId>
<artifactId>hx-frame</artifactId>
<version>0.1.0-SNAPSHOT</version>
<name>hx-frame</name>
<dependencies>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojure</artifactId>
<version>1.9.0</version>
</dependency>
<dependency>
<groupId>lilactown</groupId>
<artifactId>hx</artifactId>
<version>0.5.2</version>
</dependency>
<dependency>
<groupId>org.clojure</groupId>
<artifactId>clojurescript</artifactId>
<version>1.10.520</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
</build>
<repositories>
<repository>
<id>clojars</id>
<url>https://repo.clojars.org/</url>
</repository>
</repositories>
</project>

0 comments on commit 1b79a01

Please sign in to comment.