Skip to content

Commit

Permalink
Make variable names consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
ostefano committed Dec 8, 2023
1 parent a861906 commit fffaa51
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
20 changes: 10 additions & 10 deletions core/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 .
Expand Down Expand Up @@ -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 \
Expand Down
10 changes: 5 additions & 5 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ variable "LIBFAUP_COMMIT" {
default = ""
}

variable "MISP_TAG" {
variable "CORE_TAG" {
default = ""
}

variable "MISP_COMMIT" {
variable "CORE_COMMIT" {
default = ""
}

Expand Down Expand Up @@ -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}",
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions template.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit fffaa51

Please sign in to comment.