From 6771e0348cfdea55d0c2ef175b88560fb72777d1 Mon Sep 17 00:00:00 2001 From: Jaime Fournier Date: Thu, 26 Dec 2024 15:13:06 -0700 Subject: [PATCH] Fix docker packages names (#1289) To reflect accurately which version of gerbil is installed. This differs from just using "master". --- docker/Dockerfile | 2 +- docker/Makefile | 45 ++++++++++++++------------------------------- 2 files changed, 15 insertions(+), 32 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 264367765..9a726a393 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -29,7 +29,7 @@ RUN case ${distro} in \ eval yum install -y ${packages} \ ;; \ fedora) \ - yum update -y && yum groupinstall -y 'Development Tools' && \ + yum update -y && yum group install -y development-tools && \ eval yum install -y ${packages} \ ;; \ debian|ubuntu) \ diff --git a/docker/Makefile b/docker/Makefile index 5fb71ba85..17db7293e 100755 --- a/docker/Makefile +++ b/docker/Makefile @@ -1,4 +1,4 @@ -.PHONY: alpine amazonlinux debian ubuntu fedora ubuntu-current-jedi final +.PHONY: alpine debian ubuntu fedora ubuntu-current-jedi final ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) cores := $(shell nproc) @@ -6,14 +6,17 @@ arch := $(shell uname -m) DEFAULT=gerbilxx ifeq ($(BRANCH),) -BRANCH := master +BRANCH := $(shell git branch --show-current) endif +TAG := $(shell git describe --tags) + ifeq ($(REPO),) -REPO := mighty-gerbils/gerbil +REPO := $(shell git remote get-url $(shell git rev-parse --abbrev-ref --symbolic-full-name @{u}|cut -f1 -d/)|cut -f2 -d:) endif cores := $(shell nproc) + $(info the branch is $(BRANCH) and the repo is $(REPO) cores are: $(cores)) alpine_packages := autoconf \ @@ -119,6 +122,10 @@ debian_packages := autoconf \ texinfo \ zlib1g-dev +debug: + $(info the branch is $(BRANCH) and the repo is $(REPO) cores are: $(cores)) + + gerbilxx: docker build --target final \ --rm=true --no-cache \ @@ -146,20 +153,6 @@ gerbil: -t final $(ROOT_DIR) docker tag final gerbil/gerbil:$(arch)-$(BRANCH) -amazonlinux: - docker build --target final \ - --rm=true --no-cache \ - --build-arg branch="$(BRANCH)" \ - --build-arg configure_args="--enable-march=" \ - --build-arg cores=$(cores) \ - --build-arg distro="amazonlinux" \ - --build-arg packages="$(amazon_packages)" \ - --build-arg repo="$(REPO)" \ - --build-arg shared="no" \ - --build-arg with_db="YES" \ - -t final $(ROOT_DIR) - docker tag final gerbil/amazonlinux:$(arch)-$(BRANCH) - centos: docker build --target final \ --rm=true --no-cache \ @@ -222,7 +215,7 @@ ubuntu-current-jedi: package-ubuntu: docker run -v $(ROOT_DIR):/src:z -t gerbil/ubuntu:$(arch)-$(BRANCH) \ bash -c "gem install fpm && \ - fpm -f -s dir -p /src/ -t deb -n gerbil-$(BRANCH).ubuntu \ + fpm -f -s dir -p /src/ -t deb -n gerbil-scheme.ubuntu -v $(TAG) \ -d libsqlite3-dev -d libssl-dev \ --description 'Gerbil Scheme Package' /opt/gerbil" @@ -235,30 +228,20 @@ package-fedora: bash -c "yum install -y rubygems ruby-devel rpm-build && \ gem install fpm && \ fpm -f -s dir -p /src/ -t rpm \ - -n gerbil-$(BRANCH).fedora \ - -d zlib-devel -d zlib-static -d openssl-devel -d sqlite-devel \ + -n gerbil-$(BRANCH).fedora -v $(TAG) \ + -d zlib-devel -d zlib-static -d openssl-devel -d sqlite-devel \ --description 'Gerbil Scheme Package' /opt/gerbil" -package-amazonlinux: - docker run -v $(ROOT_DIR):/src:z -t gerbil/amazonlinux:$(arch)-$(BRANCH) \ - bash -c "amazon-linux-extras install -y ruby2.6 && \ - yum install -y ruby-devel rubygems rpm-build && \ - gem install fpm && \ - fpm -s dir -p /src/ -t rpm \ - -n gerbil-$(BRANCH).amazonlinux \ - --description 'Gerbil Package' /opt/gerbil" - packages: package-ubuntu package-fedora push-all: docker push gerbil/alpine docker push gerbil/ubuntu docker push gerbil/fedora - docker push gerbil/amazonlinux manifest: docker manifest create gerbil/alpine:latest --amend gerbil/alpine:aarch64 --amend gerbil/alpine:x86_64 -all: alpine amazonlinux fedora ubuntu +all: alpine fedora ubuntu docker: ubuntu