-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
459 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{:paths ["src" "test"]} |
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,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" = "master" ] | ||
then | ||
lein deploy clojars | ||
fi | ||
|
||
exit 0; |
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,32 @@ | ||
#!/usr/bin/env bash | ||
|
||
image_name="borkdude/clj-kondo" | ||
image_tag=$(cat resources/CLJ_KONDO_VERSION) | ||
latest_tag="latest" | ||
|
||
if [[ $image_tag =~ SNAPSHOT$ ]]; then | ||
echo "This is a snapshot version" | ||
snapshot="true" | ||
else | ||
echo "This is a non-snapshot version" | ||
snapshot="false" | ||
fi | ||
|
||
if [ -z "$CIRCLE_PULL_REQUEST" ] && [ "$CIRCLE_BRANCH" = "master" ]; then | ||
echo "Building Docker image $image_name:$image_tag" | ||
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USER" --password-stdin | ||
docker build -t "$image_name" . | ||
docker tag "$image_name:$latest_tag" "$image_name:$image_tag" | ||
# we only update latest when it's not a SNAPSHOT version | ||
if [ "false" = "$snapshot" ]; then | ||
echo "Pushing image $image_name:$latest_tag" | ||
docker push "$image_name:$latest_tag" | ||
fi | ||
# we update the version tag, even if it's a SNAPSHOT version | ||
echo "Pushing image $image_name:$image_tag" | ||
docker push "$image_name:$image_tag" | ||
else | ||
echo "Not publishing Docker image" | ||
fi | ||
|
||
exit 0; |
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,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
install_dir=${1:-/tmp/clojure} | ||
mkdir -p "$install_dir" | ||
cd /tmp | ||
curl -O -sL https://download.clojure.org/install/clojure-tools-1.10.1.727.tar.gz | ||
tar xzf clojure-tools-1.10.1.727.tar.gz | ||
cd clojure-tools | ||
clojure_lib_dir="$install_dir/lib/clojure" | ||
mkdir -p "$clojure_lib_dir/libexec" | ||
cp ./*.jar "$clojure_lib_dir/libexec" | ||
cp deps.edn "$clojure_lib_dir" | ||
cp example-deps.edn "$clojure_lib_dir" | ||
|
||
sed -i -e 's@PREFIX@'"$clojure_lib_dir"'@g' clojure | ||
mkdir -p "$install_dir/bin" | ||
cp clojure "$install_dir/bin" | ||
cp clj "$install_dir/bin" | ||
|
||
cd /tmp | ||
rm -rf clojure-tools-1.10.1.727.tar.gz | ||
rm -rf clojure-tools | ||
echo "Installed clojure to $install_dir/bin" |
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,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
curl https://raw.githubusercontent.com/technomancy/leiningen/2.9.1/bin/lein > lein | ||
sudo mkdir -p /usr/local/bin/ | ||
sudo mv lein /usr/local/bin/lein | ||
sudo chmod a+x /usr/local/bin/lein |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo '{:a 1}' | lein jet --from edn --to json |
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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
err=0 | ||
function _trap_error() { | ||
local exit_code="$1" | ||
if [ "$exit_code" -ne 2 ] && [ "$exit_code" -ne 3 ]; then | ||
echo "EXIT CODE :( $exit_code" | ||
(( err |= "$exit_code" )) | ||
fi | ||
} | ||
|
||
trap '_trap_error $?' ERR | ||
trap 'exit $err' SIGINT SIGTERM | ||
|
||
|
||
rm -rf performance.txt | ||
echo -e "==== Build initial cache" | tee -a performance.txt | ||
cp="$(clojure -R:cljs -Spath)" | ||
read -r -d '' config <<'EOF' || true | ||
{:linters | ||
{:not-a-function | ||
{:skip-args [clojure.pprint/defdirectives | ||
cljs.pprint/defdirectives | ||
clojure.data.json/codepoint-case]}}} | ||
EOF | ||
|
||
(time ./clj-kondo --lint "$cp" --cache --config "$config") 2>&1 | tee -a performance.txt | ||
|
||
echo -e "\n==== Lint a single file (emulate in-editor usage)" | tee -a performance.txt | ||
(time ./clj-kondo --lint src/clj_kondo/impl/core.clj --cache) 2>&1 | tee -a performance.txt | ||
|
||
count=$(find . -name "*.clj*" -type f | wc -l | tr -d ' ') | ||
echo -e "\n==== Launch clj-kondo for each file in project ($count)" | tee -a performance.txt | ||
(time find src -name "*.clj*" -type f -exec ./clj-kondo --lint {} --cache \; ) 2>&1 | tee -a performance.txt | ||
|
||
exit "$err" |
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,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
rm -rf /tmp/release | ||
mkdir -p /tmp/release | ||
cp carve /tmp/release | ||
VERSION=$(cat resources/CARVE_VERSION) | ||
|
||
cd /tmp/release | ||
|
||
## release binary as zip archive | ||
|
||
zip "carve-$VERSION-$APP_PLATFORM-amd64.zip" carve | ||
|
||
## cleanup | ||
|
||
rm carve |
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,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
err=0 | ||
function _trap_error() { | ||
local exit_code="$1" | ||
if [ "$exit_code" -ne 2 ] && [ "$exit_code" -ne 3 ]; then | ||
(( err |= "$exit_code" )) | ||
fi | ||
} | ||
|
||
trap '_trap_error $?' ERR | ||
trap 'exit $err' SIGINT SIGTERM | ||
|
||
|
||
# Run as local root dependency | ||
rm -rf /tmp/proj | ||
mkdir -p /tmp/proj | ||
cd /tmp/proj | ||
clojure -Sdeps '{:deps {clj-kondo {:local/root "/home/circleci/repo"}}}' \ | ||
-m clj-kondo.main --lint /home/circleci/repo/src /home/circleci/repo/test | ||
|
||
# Run as git dependency | ||
rm -rf /tmp/proj | ||
mkdir -p /tmp/proj | ||
cd /tmp/proj | ||
|
||
github_user=${CIRCLE_PR_USERNAME:-borkdude} | ||
clojure -Sdeps "{:deps {clj-kondo {:git/url \"https://github.com/$github_user/clj-kondo\" :sha \"$CIRCLE_SHA1\"}}}" \ | ||
-m clj-kondo.main --lint /home/circleci/repo/src /home/circleci/repo/test | ||
|
||
exit "$err" |
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,3 +1,5 @@ | ||
/.cpcache | ||
/target/ | ||
.dir-locals.el | ||
/carve | ||
/carve.jar |
Oops, something went wrong.