App DevOps with Make Part 1

If you are not familiar with GNU Make, it is a tool to help automate development processes. I have been using it to help with my "one-man-band" development process.

Why use Make?

I decided to use make instead of tools like FastLine because I didn't want to introduce another language outside of shell scripts and Swift into my process. I also wanted to learn and stay close to how each step in my development process was done.

What am I using Make for?

I have a fascination with the process of development. How do you simplify the effort and eliminate the noise and focus on the app itself. I have a fairly straight forward process for devops that I've codified into steps in Make.

  • Manage branches - I use them for features
  • Review - Lint and Format the code
  • Secrets - hide and unhide secrets used within the devops pipeline
  • Increment Build
  • Build & Test the app
  • Commit the source in git
  • Merge Request in gitlab
  • Archive, Package, and Post the app to TestFlight
  • Generate my website for my app

    I will write a series of articles around these steps.

    Managing branches & commits

    I was using the git flow style of development for a while, but it was a lot to keep up with. I've also read articles that say that it doesn't scale like it needs to with large teams. Since it's just me, I only have feature branches off the main branch. I also use a file to manage commit messages.

    	git pull origin main
    	git checkout -b "feature/$(feature)"
    COMMIT_FILE = ""
    COMMIT_MODIFIED := $(shell git diff --name-only | grep
    	$(info Validating the commit message has been updated)
    	@[ "${COMMIT_MODIFIED}" ] && echo " update" || ( echo "Pleaes update your file"; exit 1 )
    feature-commit: check-commit-modified
    	git add -A && git commit -F
    	git checkout main
    	git branch -D "feature/$(feature)"

    What's going on here?

    • All of my features go under 'feature/feature-name' just for consistency. I check out the feature in git. I pull from the remote main before I start a new feature to ensure I have the lastest work.
    • I use a file for managing commit documentation. I try to use a shortened version of a Changelog in the commit message.
    • I don't allow any commits without updating the commit message. That is done by checking to see if the commit file is the same as the last checkin
    • When I am done with a feature, I delete the branch and go back to main.

    What is your dev ops process?

    If you are an Indie developer, what is your process? Have you written similar scripts? Are you using FastLane or Basil or something else?

    Find me on Twitter and tell me all about it!

    Tagged with: