Day 10 - Create a bin/setup script

Having a setup script is an awesome idea. We already had a list of commands that needed to be run prior to development within the readme, so moved those and added some others into a setup script.

It’s a bit shorter and doing less than the example, but for my personal use it’s good enough. Most of our projects also have a docker-compose file to simplify that even more.

export JAVA_HOME=`/usr/libexec/java_home -v 11`; java -version
mvn clean package 
java -jar target/xxx.jar```

Having a small project and being pretty new to Expo and RN, in 20 min I was using my time reading about these and an article on how to automate React Native deployment workflow. I am sure this will be useful for the future.

I’ve already done this one a few weeks ago, before onboarding a new dev. It works perfectly in VSCode Dev Container and is clear enough to be a reference guide for anyone who wants to use another editor (plus the awesome README I’ve done later)

My side project is a small NPM package, so the setup would just be npm install but I filed a ticket to add Husky and did the “remove a compound conditional” task I skipped.

Just plugged together 4 command line steps that I was manually typing to deploy a container to Cloud Run!

I’ve always loved setup scripts since I first encountered them in Rails. Took this as an opportunity to add one to a new project I’m working on.

How are folks handling system-level dependencies? Say a project needs to compile native extensions for MySQL. Should the script try to install it? Should it check if MySQL is installed and fail with a good error message if it isn’t? Or should it just try to install the project’s dependencies and rely on them to produce an meaningful error message?

Curious how others think about this…

Today I tested the install script in my job project and it’s still working fine the only thing that I think we need to improve is the part where we request a staging DB copy to a partner I think we could add an extra step to get it automatically. I will talk about this with my manager tomorrow.

Had a super busy and I just got this finished under the wire. I updated the bin/setup and the bin/update which resulted in an update to the README. All in the name of simplicity!

Different project from the original readme improvement I did, so I got to improve a readme and set up a script.

Instead of a setup script I tend to default to creating a docker compose setup for everything. This has included, setting up a local certificate CA with mk-cert, local DNS/routing and one off containers to create users and download and load a staging database dump.

I particularly like this setup given it helps create parity between a local setup and a hosted environment as well as increasing the compatibility across OS’s and it’s normally just one command once the env files are setup correctly.

In terms of the 20 minutes of work, I finished off a MR which I started to fix a script to pull the staging DB locally and looked into docker-compose profiles for the different services we have.