diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index defc794..9f7ee03 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - RUBY_VERSION: [2.3, 2.4, 2.5, 2.6, 2.7, 3.1, 3.2, 3.3, 3.4] + RUBY_VERSION: [3.3, 3.4] env: RUBY_VERSION: ${{ matrix.RUBY_VERSION }} steps: diff --git a/Dockerfile b/Dockerfile index 2be7314..bbf6bfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,9 @@ -ARG RUBY_VERSION=2.3.1 +ARG RUBY_VERSION=3.4 FROM ruby:${RUBY_VERSION} -ARG BUNDLER_VERSION=1.17.3 -ENV BUNDLER_VERSION=${BUNDLER_VERSION} -RUN if [ "${BUNDLER_VERSION}" != "" ] ; then \ - gem install bundler -v "${BUNDLER_VERSION}" ; \ - fi +RUN apt-get upgrade -y ca-certificates + +RUN egrep '^mozilla/emSign_ECC_Root_CA_-_G3.crt|^mozilla/Comodo_AAA_Services_root.crt' /etc/ca-certificates.conf; [ $? -eq 1 ] WORKDIR /app COPY Gemfile /app/ diff --git a/Makefile b/Makefile index 0e1cad5..a0671b8 100644 --- a/Makefile +++ b/Makefile @@ -1,42 +1,7 @@ - -export COMPOSE_IGNORE_ORPHANS ?= true -export RUBY_VERSION ?= 2.3.1 -RUBY_VERSION_MAJOR = $(word 1,$(subst ., ,$(RUBY_VERSION))) -RUBY_VERSION_MINOR = $(word 2,$(subst ., ,$(RUBY_VERSION))) -export BUNDLER_VERSION ?= -ifeq ($(BUNDLER_VERSION),) -ifeq ($(RUBY_VERSION_MAJOR),2) -# Use old bundler for Ruby 2.3-2.6; Ruby 2.7 needs bundler 2.x to avoid resolver bugs -ifeq ($(RUBY_VERSION_MINOR),7) -export BUNDLER_VERSION = 2.4.22 -else -export BUNDLER_VERSION = 1.17.3 -endif -endif -endif -PROJECT_NAME = $(shell ls *.gemspec | sed 's/\.gemspec//') -export COMPOSE_PROJECT_NAME ?= $(PROJECT_NAME)-$(subst .,_,$(RUBY_VERSION)) - -default: help - -## Show this help message -help: - @echo "\n\033[1;34mAvailable targets:\033[0m\n" - @awk 'BEGIN {FS = ":"; prev = ""} \ - /^## / {prev = substr($$0, 4); next} \ - /^[a-zA-Z_-]+:/ {if (prev != "") printf " \033[1;36m%-20s\033[0m %s\n", $$1, prev; prev = ""} \ - {prev = ""}' $(MAKEFILE_LIST) | sort - @echo - -BUILD_ARGS ?= ## Build and pull docker compose images -build: gemfile-lock - docker compose build --pull $(BUILD_ARGS) - -## Create a Gemfile.lock specific to the container (i.e., for the ruby version) -gemfile-lock: - mkdir -pv ./docker/ruby-$(RUBY_VERSION)/ && \ - echo '' > ./docker/ruby-$(RUBY_VERSION)/Gemfile.lock +build: + touch docker/Gemfile.lock + docker compose build --pull ## Open shell in a docker container, supports CMD= bash: build @@ -64,11 +29,8 @@ lint-direct: $(MAKE) run CMD="bundle exec rake rubocop $(ARGS)" ## Clean up docker compose resources -clean: clean-gemfile-lock +clean: + truncate -s 0 docker/Gemfile.lock && \ docker compose down --remove-orphans --volumes -## Clean up the container specific Gemfile.lock -clean-gemfile-lock: - rm -v ./docker/ruby-$(RUBY_VERSION)/Gemfile.lock ||: - .PHONY: build bash test diff --git a/docker-compose.yml b/docker-compose.yml index 358f47e..3ac202c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,10 +3,10 @@ services: build: context: . args: - RUBY_VERSION: ${RUBY_VERSION:-2.3.1} + RUBY_VERSION: ${RUBY_VERSION:-3.4} BUNDLER_VERSION: ${BUNDLER_VERSION:-} volumes: - type: bind source: . target: /app - - ./docker/ruby-${RUBY_VERSION}/Gemfile.lock:/app/Gemfile.lock + - ./docker/Gemfile.lock:/app/Gemfile.lock diff --git a/docker/.keep b/docker/.keep new file mode 100644 index 0000000..e69de29