From fffaa51572596f38689f48039636299f42db1bcb Mon Sep 17 00:00:00 2001 From: Stefano Ortolani Date: Fri, 8 Dec 2023 08:45:49 +0000 Subject: [PATCH] Make variable names consistent --- README.md | 2 +- core/Dockerfile | 20 ++++++++++---------- docker-bake.hcl | 10 +++++----- docker-compose.yml | 4 ++-- template.env | 6 +++--- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index f2636f9..2bdec0b 100644 --- a/README.md +++ b/README.md @@ -86,4 +86,4 @@ New options are added on a regular basis. A GitHub Action builds both `misp-core` and `misp-modules` images automatically and pushes them to the [GitHub Package registry](https://github.com/orgs/MISP/packages). We do not use tags inside the repository; instead we tag images as they are pushed to the registry. For each build, `misp-core` and `misp-modules` images are tagged as follows: - `misp-core:${commit-sha1}[0:7]` and `misp-modules:${commit-sha1}[0:7]` where `${commit-sha1}` is the commit hash triggering the build - `misp-core:latest` and `misp-modules:latest` in order to track the latest builds available -- `misp-core:${MISP_TAG}` and `misp-modules:${MODULES_TAG}` reflecting the underlying version of MISP and MISP modules (as specified inside the `template.env` file at build time) +- `misp-core:${CORE_TAG}` and `misp-modules:${MODULES_TAG}` reflecting the underlying version of MISP and MISP modules (as specified inside the `template.env` file at build time) diff --git a/core/Dockerfile b/core/Dockerfile index 25a4c5c..ff762bc 100644 --- a/core/Dockerfile +++ b/core/Dockerfile @@ -3,8 +3,8 @@ ARG DOCKER_HUB_PROXY="" FROM "${DOCKER_HUB_PROXY}debian:bullseye-slim" as composer-build ENV DEBIAN_FRONTEND noninteractive ENV COMPOSER_ALLOW_SUPERUSER 1 - ARG MISP_TAG - ARG MISP_COMMIT + ARG CORE_TAG + ARG CORE_COMMIT RUN apt-get update; apt-get install -y --no-install-recommends \ ca-certificates \ @@ -24,7 +24,7 @@ FROM "${DOCKER_HUB_PROXY}debian:bullseye-slim" as composer-build && apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* WORKDIR /tmp - ADD https://raw.githubusercontent.com/MISP/MISP/${MISP_COMMIT:-${MISP_TAG}}/app/composer.json /tmp + ADD https://raw.githubusercontent.com/MISP/MISP/${CORE_COMMIT:-${CORE_TAG}}/app/composer.json /tmp COPY --from=composer:latest /usr/bin/composer /usr/bin/composer RUN composer config --no-interaction allow-plugins.composer/installers true RUN composer install @@ -64,8 +64,8 @@ FROM "${DOCKER_HUB_PROXY}debian:bullseye-slim" as php-build FROM "${DOCKER_HUB_PROXY}debian:bullseye-slim" as python-build ENV DEBIAN_FRONTEND noninteractive - ARG MISP_TAG - ARG MISP_COMMIT + ARG CORE_TAG + ARG CORE_COMMIT ARG PYPI_REDIS_VERSION ARG PYPI_LIEF_VERSION ARG PYPI_PYDEEP2_VERSION @@ -83,10 +83,10 @@ FROM "${DOCKER_HUB_PROXY}debian:bullseye-slim" as python-build # Download MISP using git in the /var/www/ directory. Remove unnecessary items. RUN <<-EOF - if [ ! -z "${MISP_COMMIT}" ]; then - git clone https://github.com/MISP/MISP.git /var/www/MISP && cd /var/www/MISP && git checkout "${MISP_COMMIT}" + if [ ! -z "${CORE_COMMIT}" ]; then + git clone https://github.com/MISP/MISP.git /var/www/MISP && cd /var/www/MISP && git checkout "${CORE_COMMIT}" else - git clone --branch "${MISP_TAG}" --depth 1 https://github.com/MISP/MISP.git /var/www/MISP + git clone --branch "${CORE_TAG}" --depth 1 https://github.com/MISP/MISP.git /var/www/MISP fi cd /var/www/MISP || exit; git submodule update --init --recursive . @@ -135,8 +135,8 @@ EOF FROM "${DOCKER_HUB_PROXY}debian:bullseye-slim" ENV DEBIAN_FRONTEND noninteractive - ARG MISP_TAG - ARG MISP_COMMIT + ARG CORE_TAG + ARG CORE_COMMIT ARG PHP_VER RUN apt-get update; apt-get install -y --no-install-recommends \ diff --git a/docker-bake.hcl b/docker-bake.hcl index 1a7f9d6..9cb37ab 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -58,11 +58,11 @@ variable "LIBFAUP_COMMIT" { default = "" } -variable "MISP_TAG" { +variable "CORE_TAG" { default = "" } -variable "MISP_COMMIT" { +variable "CORE_COMMIT" { default = "" } @@ -92,10 +92,10 @@ target "misp-modules" { target "misp-core" { context = "core/." dockerfile = "Dockerfile" - tags = flatten(["${NAMESPACE}/misp-core:latest", "${NAMESPACE}/misp-core:${COMMIT_HASH}", MISP_TAG != "" ? ["${NAMESPACE}/misp-core:${MISP_TAG}"] : []]) + tags = flatten(["${NAMESPACE}/misp-core:latest", "${NAMESPACE}/misp-core:${COMMIT_HASH}", CORE_TAG != "" ? ["${NAMESPACE}/misp-core:${CORE_TAG}"] : []]) args = { - "MISP_TAG": "${MISP_TAG}", - "MISP_COMMIT": "${MISP_COMMIT}", + "CORE_TAG": "${CORE_TAG}", + "CORE_COMMIT": "${CORE_COMMIT}", "PHP_VER": "${PHP_VER}", "PYPI_REDIS_VERSION": "${PYPI_REDIS_VERSION}", "PYPI_LIEF_VERSION": "${PYPI_LIEF_VERSION}", diff --git a/docker-compose.yml b/docker-compose.yml index 52b9214..98b0631 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,8 +33,8 @@ services: build: context: core/. args: - - MISP_TAG=${MISP_TAG} - - MISP_COMMIT=${MISP_COMMIT} + - CORE_TAG=${CORE_TAG} + - CORE_COMMIT=${CORE_COMMIT} - PHP_VER=${PHP_VER} - PYPI_REDIS_VERSION=${PYPI_REDIS_VERSION} - PYPI_LIEF_VERSION=${PYPI_LIEF_VERSION} diff --git a/template.env b/template.env index 83c0fea..773247b 100644 --- a/template.env +++ b/template.env @@ -2,7 +2,7 @@ # Build-time variables ## -MISP_TAG=v2.4.181 +CORE_TAG=v2.4.181 MODULES_TAG=v2.4.179 PHP_VER=20190902 LIBFAUP_COMMIT=3a26d0a @@ -18,8 +18,8 @@ LIBFAUP_COMMIT=3a26d0a # PYPI_CYBOX_VERSION="==2.1.*" # PYPI_PYMISP_VERSION="==2.4.178" -# MISP_COMMIT takes precedence over MISP_TAG -# MISP_COMMIT=c56d537 +# CORE_COMMIT takes precedence over CORE_TAG +# CORE_COMMIT=c56d537 # MODULES_COMMIT takes precedence over MODULES_TAG # MODULES_COMMIT=de69ae3