Skip to content

Commit

Permalink
heroku local run
Browse files Browse the repository at this point in the history
  • Loading branch information
BostX committed Mar 6, 2024
1 parent 59f3866 commit f901b3c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 11 deletions.
17 changes: 12 additions & 5 deletions .bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,25 @@ export SHELL
# return # ... and don't do anything else.
# fi

expedir_basename="corona_cases"
prjdir=$(pwd)
currdir_basename=$(basename $prjdir)
pgdata=./var/pg/data

if [ -n "$GUIX_ENVIRONMENT" ]; then
# /run is not automatically created by guix
[ ! -d /run ] && mkdir /run

# Quick access to $GUIX_ENVIRONMENT, for usage on config files
# (currently only /etc/nginx/nginx.conf)
[ ! -L /env ] && ln -s $GUIX_ENVIRONMENT /env

[ ! -d ./node_modules ] && npm install heroku

if [ ! -L ./node_modules/heroku/bin/heroku ]; then
ln -s ./node_modules/heroku/bin/run ./node_modules/heroku/bin/heroku
fi
export PATH=$PATH:$prjdir/node_modules/heroku/bin
fi

# # Link every file in /usr/etc on /etc
Expand All @@ -29,11 +41,6 @@ fi
# [ ! -L $bname ] && ln -s $filepath $bname
# done

expedir_basename="corona_cases"
prjdir=$(pwd)
currdir_basename=$(basename $prjdir)
pgdata=./var/pg/data

test_db () {
# for long names of keywords, use:
# select * from thresholds where kw in ('rec', 'dea', 'act', 'new') order by kw;
Expand Down
3 changes: 2 additions & 1 deletion .heroku-local.env → .custom.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

# The value must be one of `(keys corona.envdef/environment)`;
# lower-cased and not surrounded by the double quote chars "".
CORONA_ENV_TYPE=local
# CORONA_ENV_TYPE=local
CORONA_ENV_TYPE=devel

# https://clojure.org/guides/getting_started#_installation_on_linux
CLOJURE_CLI_VERSION=1.11.1.1165
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@
/resources/mockup/
/var/run/
/log/
/node_modules/
/package-lock.json
/package.json
/corona.log
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

# -Xmx<size> : increase max heap size from default 300MB
# Keep in sync with .dir-locals.el and .bashrc
web: java -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError -Djdk.attach.allowAttachSelf $JVM_OPTS -cp target/corona_cases-standalone.jar clojure.main -m corona.web.core
web: java -Xmx8192m -XX:+HeapDumpOnOutOfMemoryError -Djdk.attach.allowAttachSelf $JVM_OPTS -cp target/corona_cases-standalone.jar clojure.main -m corona.web.core
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ unix_socket_directories = '/tmp' # comma-separated list of directories
# start Postgres
pg_ctl --pgdata=./var/pg --log=./var/log/postgres.log start # on Guix
# pg_ctl --pgdata=./var/pg stop
bin/build; and heroku local --env=.heroku-local.env
bin/build && heroku local --env=.custom.env
# or:
# bin/build; and heroku local --env=.heroku-local.env --set COMMIT=...
# bin/build && heroku local --env=.custom.env --set COMMIT=...
```

## Heroku CI pipeline
Expand All @@ -195,8 +195,6 @@ psql --dbname=postgres --quiet --file=dbase/my.sql
psql --dbname=postgres
```

```bash
```
then
```postgres
-- help
Expand Down
6 changes: 6 additions & 0 deletions manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,11 @@
sed
which

;; #begin# for heroku installation
(@(gnu packages node) node-lts)
(@(gnu packages python) python)
(@(gnu packages base) gnu-make) ;; i.e. `make`
;; #end# for heroku installation

(@(gnu packages admin) neofetch) ;; pimp my ride
))

0 comments on commit f901b3c

Please sign in to comment.