-
Notifications
You must be signed in to change notification settings - Fork 0
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
0 parents
commit f1f86dc
Showing
3 changed files
with
94 additions
and
0 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,30 @@ | ||
# Leiningen packaging for sdkman.io | ||
|
||
## Prerequisites | ||
|
||
* A Leiningen release (online) | ||
* wget | ||
* zip | ||
* sdkman credentials | ||
|
||
## Packaging | ||
|
||
``` | ||
./package.sh VERSION BUILD_DIR | ||
``` | ||
|
||
* `BUILD_DIR needs to be empty` | ||
* this yields a `zip` file in `BUILD_DIR/out/` | ||
|
||
## Uploading | ||
|
||
* Release this zip file in the `leiningen/leiningen-sdkman` repo and jot down the URL | ||
|
||
## Releasing | ||
|
||
``` | ||
export CONSUMER_KEY=x | ||
export CONSUMER_TOKEN=y | ||
./release.sh VERSION | ||
``` |
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,47 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" = "" -o "$2" = "" ]; then | ||
echo "Usage: $0 VERSION BUILD_DIR" | ||
exit | ||
fi | ||
|
||
VERSION="$1" | ||
BUILD_DIR="$2" | ||
SUB_DIR="leiningen-${VERSION}" | ||
OUT_DIR="out" | ||
|
||
test -d "$BUILD_DIR" && { | ||
echo "The build dir ${BUILD_DIR} exists, choose a different dir." | ||
exit 1 | ||
} | ||
|
||
echo "Packaging Leiningen ${VERSION} for SDKMAN in ${BUILD_DIR} ..." | ||
|
||
mkdir -p "$BUILD_DIR" | ||
cd "$BUILD_DIR" | ||
|
||
test -d "$SUB_DIR" || mkdir -p "$SUB_DIR" | ||
cd "$SUB_DIR" | ||
|
||
mkdir bin | ||
cd bin | ||
|
||
wget "https://raw.githubusercontent.com/technomancy/leiningen/${VERSION}/bin/lein-sdkman" -O "lein" | ||
wget "https://raw.githubusercontent.com/technomancy/leiningen/${VERSION}/bin/lein.bat" -O "lein.bat" | ||
|
||
cd .. | ||
mkdir lib | ||
cd lib | ||
|
||
wget "https://github.com/technomancy/leiningen/releases/download/${VERSION}/leiningen-${VERSION}-standalone.zip" -O "leiningen-${VERSION}-standalone.jar" | ||
|
||
cd ../.. | ||
test -d "$OUT_DIR" || mkdir -p "$OUT_DIR" | ||
|
||
FILE_NAME="${OUT_DIR}/${SUB_DIR}.zip" | ||
|
||
zip "FILE_NAME" "$SUB_DIR" | ||
|
||
echo "Leiningen ${VERSION} was packaged to ${FILE_NAME}" | ||
|
||
|
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,17 @@ | ||
#!/bin/bash | ||
|
||
if [ "$1" = "" ]; then | ||
echo "Usage: $0 VERSION" | ||
exit | ||
fi | ||
|
||
VERSION="$1" | ||
URL="https://github.com/leiningen/leiningen-sdkman/releases/download/${VERSION}/leiningen-${VERSION}.zip" | ||
|
||
curl -X POST \ | ||
-H "Consumer-Key: ${CONSUMER_KEY}" \ | ||
-H "Consumer-Token: ${CONSUMER_TOKEN}" \ | ||
-H "Content-Type: application/json" \ | ||
-H "Accept: application/json" \ | ||
-d "{\"candidate\": \"leiningen\", \"version\": \"${VERSION}\", \"url\": \"${URL}\"}" \ | ||
https://vendors.sdkman.io/release |