v1.8.0 #186
jacobobryant
announced in
Announcements
v1.8.0
#186
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
See the announcement post for commentary.
Changes
:db.op/upsert
on a document that doesn't yet exist, use the provided:xt/id
value if there is one instead of always using(random-uuid)
as the value.use-xtdb
get the value of:biff.xtdb.jdbc/jdbcUrl
from the:biff/secret
function if it's defined as a secret.server-setup.sh
delete Trenchman artifacts after installing.Thank you to @mathisto, @carlos, @olavfosse, and @wunki for contributions.
Upgrade instructions
deps.edn
,bb/deps.edn
and/ortasks/deps.edn
) to:git/tag "v1.8.0", :git/sha "3b2fa14"
Optional: upgrade config to use Aero
Apply the changes in this commit to your project:
resources/config.edn
file into your project. (NOTE: this new file should be saved atresources/config.edn
, notconfig.edn
).resources/config.template.env
file into your project. Copy it to bothresources/config.template.env
andconfig.env
./config.env
to your.gitignore
file.resources/config.edn
andconfig.env
to include any custom config that you previously put inconfig.edn
orsecrets.env
. For example, you'll need to copy the values ofCOOKIE_SECRET
andJWT_SECRET
fromsecrets.env
intoconfig.env
.resources/config.edn
will be parsed with Aero. To specify different config values for different environments, you'll do e.g.{:example/foo #profile {:prod "bar" :dev "baz"} ...
instead of{:prod {:example/foo "bar" ...} :dev {:example/foo "baz" ...} ...
. Here's some more migration advice.check-config
function to yourrepl.clj
file. Then runbb dev
and evaluate(check-config)
from your editor. (You can also do(biff/pprint (check-config))
if needed.) Make sure everything looks correct.git add .; git commit
.bb deploy
and thenbb prod-repl
. Evaluate(check-config)
again to make sure the new config is available in production.biff/use-config
andbiff/use-secrets
withbiff/use-aero-config
. Runbb dev
and make sure everything works locally. Then make a new commit, runbb deploy
, and ensure everything works in production.NOTE: this will make your application use the new Aero config, however, bb tasks will still read from the old
config.edn
file. To completely upgrade, you'll need to switch to clj tasks.Optional: switch from bb tasks to clj tasks
If you switch to clj tasks, you must first upgrade your config to use Aero as described above.
Apply the changes in this commit to your project:
:dev
and:prod
aliases to yourdeps.edn
file. Replace:local/root "../libs/tasks"
with:git/url "https://github.com/jacobobryant/biff", :git/tag "v1.8.0", :git/sha "3b2fa14", :deps/root "libs/tasks"
and changecom.example
to your main namespace.dev/tasks.clj
file to your project.-main
andstart
functions like so.server-setup.sh
, SSH into it as root, edit/etc/systemd/system/app.service
, and change theExecStart
line toExecStart=/bin/sh -c "mkdir -p target/resources; clj -M:prod"
. Then runsystemctl daemon-reload
. Also make the same change in yourserver-setup.sh
file. (Note: new projects also haveserver-setup.sh
setBIFF_PROFILE=prod
instead ofBIFF_ENV=dev
, butBIFF_ENV
is still recognized.)clj -M:dev dev
to make sure everything works locally, then (if you did step 4) runclj -M:dev deploy
and make sure it works in prod.alias biff='clj -M:dev'
to your.bashrc
file.Run
clj -M:dev --help
(orbiff --help
if you set up the alias) for a list of available commands. e.g. instead of runningbb dev
andbb deploy
, you'll now runclj -M:dev dev
andclj -M:dev deploy
.Optional: make your app work with Docker/Uberjars
After you upgrade to clj tasks, you can run
clj -M:dev uberjar
to generate an Uberjar for your app. You can also add thisDockerfile
to your app. The recommended way for most people to deploy Biff is still the old way (setting up a DigitalOcean droplet withserver-setup.sh
and deploying withclj -M:dev deploy
). But for those who know they want to deploy another way,clj -M:dev uberjar
and theDockerfile
are provided as a convenience.You'll need to make a few additional changes to your project. See this commit:
(:gen-class)
to your main namespace.css-path
andjs-path
so they don't break when called inside an Uberjar..dockerignore
to your project.Optional: clean up
If you followed the instructions above, there will be several files and directories that you no longer need. Feel free to delete them:
bb.edn
bb/
(previously this folder was namedtasks/
)config.edn
andsecrets.env
(these aren't checked into git by default, so be sure you've migrated all your config over to the new files before you delete them)Additionally, you can move your
repl.clj
file into the newdev
directory and yourtest.clj
file into a newtest
directory. You'll also need to editdeps.edn
and youron-save
function—see this commit.Optional: rename "plugins" to "modules"
This is a purely cosmetic change, but if you'd like to stay in line with new projects, the change is a simple find-and-replace.
This discussion was created from the release v1.8.0.
Beta Was this translation helpful? Give feedback.
All reactions