Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Conversation

metaskills
Copy link
Contributor

This project was using the LambCI images and AWS SAM along with AWS are using these image name/formats:

  • BUILD: amazon/aws-sam-cli-build-image-ruby2.x
  • RUNTIME: public.ecr.aws/lambda/ruby:2.x

The goal of this work is to leverage these images for our static gem builds, but also I want to update the developer experience here some. To that end, here are a few things I did to make this project easier to use and update if needed. Note: The MySQL2 gem is rock solid and has not been updated in a year. So the idea is that we want to easily be able to explore Ruby 3 or other BUILD variants when the time comes. For now, this update pushes our version 0.5.3.1 to rubygems which still works on both 2.5 and 2.7. As promised, here is the list of newness.

  • New local VERSION file that controls which version of mysql2 we are building. Ex: 0.5.3
  • New local BUILD variant number for our build variant. Current 1
  • Combined these two numbers are single source of truth for our version. Ex: 0.5.3.1
  • Leverage docker-compose to install & test build gem package using RUNTIME images.
  • Hook up tests to GitHub Action.

Docker Compose Test Setup

I am really happy with this pattern! From the outside, I wanted this interface:

./bin/test 2.5
./bin/test 2.7

If you look under the hood you will notice how I leverage the COMPOSE_FILE environment variable to target individual docker-compose YAML files. These both pull in MySQL via Docker so our little Ruby test script can be exercised. My favorite thing to do when testing DB is my SELECT 1 AS ONE pattern. Gets the job done.

What Is Next?

I hope to duplicate this repo and do exactly the same thing for the ruby-oci8 gem. I did a quick read of their guides and it appears they expose all the tools needed to build static gems.

This means we do not have to have things like "Oracle Images", we just have gems to install.

@metaskills metaskills merged commit 0f4ca9b into master Feb 20, 2021
@delete-merged-branch delete-merged-branch bot deleted the UpdateImages branch February 20, 2021 21:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant