Skip to content

Commit

Permalink
Use hermit (#2648)
Browse files Browse the repository at this point in the history
  • Loading branch information
tso authored Jan 9, 2023
1 parent d07ef50 commit 39e01cb
Show file tree
Hide file tree
Showing 57 changed files with 111 additions and 376 deletions.
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- run:
name: "Compile"
command: |
./gradlew testClasses --parallel --build-cache
bin/gradle testClasses --parallel --build-cache
- save_cache:
paths:
- ~/.gradle/caches
Expand Down Expand Up @@ -74,9 +74,9 @@ jobs:
name: "Build and test"
command: |
if [ "$CIRCLE_NODE_INDEX" -eq 1 ]; then
./gradlew testShardHibernate -i --scan
bin/gradle testShardHibernate -i --scan
else
./gradlew testShardNonHibernate -i --scan --parallel
bin/gradle testShardNonHibernate -i --scan --parallel
fi
- run:
name: Collect test results
Expand Down
8 changes: 1 addition & 7 deletions .github/workflows/Publish-Website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,8 @@ jobs:
with:
python-version: 3.8

- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11.0.11+9

- name: Generate API docs
run: ./gradlew dokkaGfm
run: bin/gradle dokkaGfm

- name: Prep mkdocs
run: .github/workflows/prepare_mkdocs.sh
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11.0.3

- name: install misk-web
run: |
mkdir ~/.npm-global
Expand All @@ -40,4 +31,4 @@ jobs:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ARTIFACT_SIGNING_PRIVATE_KEY }}
run: ./gradlew publishAllPublicationsToMavenCentralRepository
run: bin/gradle publishAllPublicationsToMavenCentralRepository
13 changes: 2 additions & 11 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,13 @@ jobs:
matrix:
os: [ubuntu-latest]
cmd:
- ./gradlew testShardHibernate -i --scan
- ./gradlew testShardNonHibernate -i --scan --parallel
- bin/gradle testShardHibernate -i --scan
- bin/gradle testShardNonHibernate -i --scan --parallel

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1

- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 11.0.3

- name: Test
run: ${{ matrix.cmd }}

Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ Before your code can be accepted into the project you must also sign the

## Building Misk locally

Install and activate hermit: https://cashapp.github.io/hermit/

Use gradle to run all Kotlin tests locally:

```shell
./gradlew build
gradle build
```

misk-hibernate tests expect a mysql server running on `localhost:3306` with no password set on
Expand Down
2 changes: 1 addition & 1 deletion RELEASING-MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Cutting a Release
"s/\"com.squareup.misk:\([^\:]*\):[^\"]*\"/\"com.squareup.misk:\1:$RELEASE_VERSION\"/g" \
`find . -name "README.md"`
miskweb ci-build -e
./gradlew clean uploadArchives
gradle clean uploadArchives
```
5. Visit [Sonatype Nexus][sonatype_nexus] to promote (close then release) the artifact. Or drop it if there is a problem!
Expand Down
1 change: 1 addition & 0 deletions bin/.gradle-7.6.pkg
1 change: 1 addition & 0 deletions bin/.node-16.13.0.pkg
1 change: 1 addition & 0 deletions bin/.openjdk@11.pkg
7 changes: 7 additions & 0 deletions bin/README.hermit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Hermit environment

This is a [Hermit](https://github.com/cashapp/hermit) bin directory.

The symlinks in this directory are managed by Hermit and will automatically
download and install Hermit itself as well as packages. These packages are
local to this environment.
21 changes: 21 additions & 0 deletions bin/activate-hermit
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
# This file must be used with "source bin/activate-hermit" from bash or zsh.
# You cannot run it directly
#
# THIS FILE IS GENERATED; DO NOT MODIFY

if [ "${BASH_SOURCE-}" = "$0" ]; then
echo "You must source this script: \$ source $0" >&2
exit 33
fi

BIN_DIR="$(dirname "${BASH_SOURCE[0]:-${(%):-%x}}")"
if "${BIN_DIR}/hermit" noop > /dev/null; then
eval "$("${BIN_DIR}/hermit" activate "${BIN_DIR}/..")"

if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ]; then
hash -r 2>/dev/null
fi

echo "Hermit environment $("${HERMIT_ENV}"/bin/hermit env HERMIT_ENV) activated"
fi
1 change: 1 addition & 0 deletions bin/corepack
1 change: 1 addition & 0 deletions bin/gradle
28 changes: 28 additions & 0 deletions bin/hermit
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

set -eo pipefail

export HERMIT_USER_HOME=~

if [ -z "${HERMIT_STATE_DIR}" ]; then
case "$(uname -s)" in
Darwin)
export HERMIT_STATE_DIR="${HERMIT_USER_HOME}/Library/Caches/hermit"
;;
Linux)
export HERMIT_STATE_DIR="${XDG_CACHE_HOME:-${HERMIT_USER_HOME}/.cache}/hermit"
;;
esac
fi

export HERMIT_DIST_URL="${HERMIT_DIST_URL:-https://github.com/cashapp/hermit/releases/download/stable}"
HERMIT_CHANNEL="$(basename "${HERMIT_DIST_URL}")"
export HERMIT_CHANNEL
export HERMIT_EXE=${HERMIT_EXE:-${HERMIT_STATE_DIR}/pkg/hermit@${HERMIT_CHANNEL}/hermit}

if [ ! -x "${HERMIT_EXE}" ]; then
echo "Bootstrapping ${HERMIT_EXE} from ${HERMIT_DIST_URL}" 1>&2
curl -fsSL "${HERMIT_DIST_URL}/install.sh" | /bin/bash 1>&2
fi

exec "${HERMIT_EXE}" --level=fatal exec "$0" -- "$@"
Empty file added bin/hermit.hcl
Empty file.
1 change: 1 addition & 0 deletions bin/jar
1 change: 1 addition & 0 deletions bin/jarsigner
1 change: 1 addition & 0 deletions bin/java
1 change: 1 addition & 0 deletions bin/javac
1 change: 1 addition & 0 deletions bin/javadoc
1 change: 1 addition & 0 deletions bin/javap
1 change: 1 addition & 0 deletions bin/jcmd
1 change: 1 addition & 0 deletions bin/jconsole
1 change: 1 addition & 0 deletions bin/jdb
1 change: 1 addition & 0 deletions bin/jdeprscan
1 change: 1 addition & 0 deletions bin/jdeps
1 change: 1 addition & 0 deletions bin/jfr
1 change: 1 addition & 0 deletions bin/jhsdb
1 change: 1 addition & 0 deletions bin/jimage
1 change: 1 addition & 0 deletions bin/jinfo
1 change: 1 addition & 0 deletions bin/jjs
1 change: 1 addition & 0 deletions bin/jlink
1 change: 1 addition & 0 deletions bin/jmap
1 change: 1 addition & 0 deletions bin/jmod
1 change: 1 addition & 0 deletions bin/jps
1 change: 1 addition & 0 deletions bin/jrunscript
1 change: 1 addition & 0 deletions bin/jshell
1 change: 1 addition & 0 deletions bin/jstack
1 change: 1 addition & 0 deletions bin/jstat
1 change: 1 addition & 0 deletions bin/jstatd
1 change: 1 addition & 0 deletions bin/keytool
1 change: 1 addition & 0 deletions bin/node
1 change: 1 addition & 0 deletions bin/npm
1 change: 1 addition & 0 deletions bin/npx
1 change: 1 addition & 0 deletions bin/pack200
1 change: 1 addition & 0 deletions bin/rmic
1 change: 1 addition & 0 deletions bin/rmid
1 change: 1 addition & 0 deletions bin/rmiregistry
1 change: 1 addition & 0 deletions bin/serialver
1 change: 1 addition & 0 deletions bin/unpack200
4 changes: 3 additions & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ contains a Misk web app with the requisite dependencies.

## Start the service

Install and activate hermit: https://cashapp.github.io/hermit/

Run `ExemplarService#main`, or use gradle to run:

```bash
./gradlew run
gradle run
```

## Set up bindings
Expand Down
Binary file removed gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 0 additions & 5 deletions gradle/wrapper/gradle-wrapper.properties

This file was deleted.

Loading

0 comments on commit 39e01cb

Please sign in to comment.