Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched to ARG variables #504

Open
wants to merge 2 commits into
base: al-ops-stable
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bin/sdk/assets/baked.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ function Assets::build() {
-f "${DEPLOYMENT_PATH}/images/baked/assets/Dockerfile" \
--progress="${PROGRESS_TYPE}" \
--build-arg "SPRYKER_PARENT_IMAGE=${cliImage}" \
--build-arg="SPRYKER_PHP_IMAGE=${SPRYKER_PHP_IMAGE:-spryker/php:80}" \
--build-arg "SPRYKER_ASSETS_MODE=${mode}" \
--build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \
--build-arg "SPRYKER_BUILD_HASH=${SPRYKER_BUILD_HASH:-"current"}" \
Expand Down
2 changes: 2 additions & 0 deletions bin/sdk/images/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function Images::_buildApp() {
-f "${DEPLOYMENT_PATH}/images/common/application/Dockerfile" \
--progress="${PROGRESS_TYPE}" \
--build-arg "SPRYKER_PLATFORM_IMAGE=${SPRYKER_PLATFORM_IMAGE}" \
--build-arg "SPRYKER_PHP_IMAGE=${SPRYKER_PHP_IMAGE:-spryker/php:80}" \
--build-arg "SPRYKER_LOG_DIRECTORY=${SPRYKER_LOG_DIRECTORY}" \
--build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \
--build-arg "APPLICATION_ENV=${APPLICATION_ENV}" \
Expand All @@ -63,6 +64,7 @@ function Images::_buildApp() {
--build-arg "SPRYKER_NODE_IMAGE_VERSION=${SPRYKER_NODE_IMAGE_VERSION}" \
--build-arg "SPRYKER_NODE_IMAGE_DISTRO=${SPRYKER_NODE_IMAGE_DISTRO}" \
--build-arg "SPRYKER_NPM_VERSION=${SPRYKER_NPM_VERSION}" \
--build-arg "SPRYKER_NODE_IMAGE=${SPRYKER_NODE_IMAGE}" \
"${DEPLOYMENT_PATH}/context" 1>&2

docker build \
Expand Down
2 changes: 1 addition & 1 deletion ci/deploy.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace: spryker
tag: 'dev'

environment: docker
image: spryker/php:7.2
image: ${SPRYKER_CI_PHP_IMAGE:-spryker/php:7.2}

regions:
EU:
Expand Down
2 changes: 1 addition & 1 deletion ci/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace: spryker_demo
tag: '1.0'

environment: docker
image: spryker/php:7.2
image: ${SPRYKER_CI_PHP_IMAGE:-spryker/php:7.2}

regions:
EU:
Expand Down
3 changes: 2 additions & 1 deletion generator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# syntax = docker/dockerfile:experimental
ARG SPRYKER_PHP_VERSION=7.3
ARG SPRYKER_PHP_IMAGE=spryker/php:${SPRYKER_PHP_VERSION}

FROM spryker/php:${SPRYKER_PHP_VERSION}
FROM ${SPRYKER_PHP_IMAGE}
Copy link
Contributor

@zeetabit zeetabit Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to add --build-arg="SPRYKER_PHP_IMAGE=${SPRYKER_PHP_IMAGE:-spryker/php:73}" into bootstap step.
Check for Building generator...
in bin/command/install/bootstrap.sh
and in bin/command/install/config.sh.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


RUN apk add --no-cache openssl

Expand Down
3 changes: 2 additions & 1 deletion generator/deploy-file-generator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# syntax = docker/dockerfile:experimental
ARG SPRYKER_PHP_VERSION=7.3
ARG SPRYKER_PHP_IMAGE=spryker/php:${SPRYKER_PHP_VERSION}

FROM spryker/php:${SPRYKER_PHP_VERSION}
FROM ${SPRYKER_PHP_IMAGE}

WORKDIR /data
USER spryker
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
assets:
image: fholzer/nginx-brotli:v1.18.0
image: ${SPRYKER_CI_FRONTEND_IMAGE:-fholzer/nginx-brotli:v1.18.0}
mode: production
compression:
brotli:
Expand Down
7 changes: 6 additions & 1 deletion generator/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ public function setIsActive(bool $isActive): void

const SPRYKER_NODE_IMAGE_DISTRO_ENV_NAME = 'SPRYKER_NODE_IMAGE_DISTRO';
const SPRYKER_NODE_IMAGE_VERSION_ENV_NAME = 'SPRYKER_NODE_IMAGE_VERSION';
const SPRYKER_NODE_IMAGE_ENV_NAME = 'SPRYKER_NODE_IMAGE';
const SPRYKER_NPM_VERSION_ENV_NAME = 'SPRYKER_NPM_VERSION';

const DEFAULT_NODE_VERSION = 12;
Expand Down Expand Up @@ -1619,7 +1620,7 @@ function buildNodeJsNpmBuildConfig(array $projectData): array
$imageName = $projectData['image']['tag'];
$nodejsConfig = $projectData['image']['node'] ?? [];

return [
$nodeJsNpmBuildConfig = [
SPRYKER_NODE_IMAGE_DISTRO_ENV_NAME => getNodeDistroName($nodejsConfig, $imageName),
SPRYKER_NODE_IMAGE_VERSION_ENV_NAME => array_key_exists('version', $nodejsConfig)
? (int)$nodejsConfig['version']
Expand All @@ -1628,6 +1629,10 @@ function buildNodeJsNpmBuildConfig(array $projectData): array
? (int)$nodejsConfig['npm']
: DEFAULT_NPM_VERSION,
];

$nodeJsNpmBuildConfig[SPRYKER_NODE_IMAGE_ENV_NAME] = 'node:' . $nodeJsNpmBuildConfig[SPRYKER_NODE_IMAGE_VERSION_ENV_NAME] . '-' . $nodeJsNpmBuildConfig[SPRYKER_NODE_IMAGE_DISTRO_ENV_NAME];

return $nodeJsNpmBuildConfig;
}

/**
Expand Down
1 change: 1 addition & 0 deletions generator/src/templates/deploy.bash.twig
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ readonly SPRYKER_ASSETS_MODE="{{ assets['mode'] | default('development') }}"
readonly SPRYKER_DB_ENGINE="{{ services['database']['engine'] == 'mysql' ? 'mysql' : 'pgsql' }}"
readonly SPRYKER_STORES=({{ regions | map((regionData, region) => "'local REGION=" ~ '"' ~ region ~ '"' ~ "; local STORES=(" ~ (regionData['stores'] | keys | join(' ')) ~ ")'") | join(' ') | raw }})
readonly SPRYKER_DEFAULT_STORE="{{ (regions | first)['stores'] | keys | first }}"
readonly SPRYKER_ACTIVE_STORES={{ (regionData['stores'] | keys | join(',')) | upper }}
readonly SPRYKER_FILE_MODE="{{ _fileMode }}"
readonly SPRYKER_XDEBUG_MODE_ENABLE="{{ docker['debug']['xdebug']['enabled'] is not defined or docker['debug']['xdebug']['enabled'] == true ? '1' : '' }}"
readonly SPRYKER_SYNC_SESSION_NAME="{{ _syncSessionName }}"
Expand Down
2 changes: 1 addition & 1 deletion generator/src/templates/docker-compose.yml.twig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ x-volumes:
services:

cli_ssh_relay:
image: spryker/socat:latest
image: ${SPRYKER_CLI_SSH_RELAY_IMAGE:-spryker/socat:latest}
zeetabit marked this conversation as resolved.
Show resolved Hide resolved
privileged: true
command: UNIX-LISTEN:/tmp/ssh-relay/ssh-auth.sock,fork,unlink-early,user=1000,group=1000,mode=666 UNIX-CONNECT:/tmp/ssh-relay/input-ssh-auth.sock
networks:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ serviceName }}:
image: spryker/jenkins:2.305
image: ${SPRYKER_CI_JENKINS_IMAGE:-spryker/jenkins:2.305}
networks:
- private
labels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ serviceName }}:
image: spryker/jenkins:2.324
image: ${SPRYKER_CI_JENKINS_IMAGE:-spryker/jenkins:2.324}
networks:
- private
labels:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ serviceName }}:
image: spryker/rabbitmq:3.8
image: ${SPRYKER_CI_RABBITMQ_IMAGE:-spryker/rabbitmq:3.8}
hostname: {{ serviceName }} # RabbitMQ determines the cluster by its hostname
networks:
- private
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ serviceName }}:
image: spryker/rabbitmq:3.9
image: ${SPRYKER_CI_RABBITMQ_IMAGE:-spryker/rabbitmq:3.9}
hostname: {{ serviceName }} # RabbitMQ determines the cluster by its hostname
networks:
- private
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% set protocol = project['docker']['ssl']['enabled'] ? 'https://' : 'http://' %}
{% set firstGlueEndpointMap = project['_endpointMap'] | first %}
{{ serviceName }}:
image: spryker/swagger-ui:v3.24.3
image: ${SPRYKER_CI_SWAGGER_IMAGE:-spryker/swagger-ui:v3.24.3}
networks:
- private
labels:
Expand Down
3 changes: 2 additions & 1 deletion images/common/application/Dockerfile.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
ARG SPRYKER_PLATFORM_IMAGE=spryker/php:7.3
ARG SPRYKER_NODE_IMAGE_VERSION
ARG SPRYKER_NODE_IMAGE_DISTRO
ARG SPRYKER_NODE_IMAGE=node:${SPRYKER_NODE_IMAGE_VERSION}-${SPRYKER_NODE_IMAGE_DISTRO}

FROM node:${SPRYKER_NODE_IMAGE_VERSION}-${SPRYKER_NODE_IMAGE_DISTRO} AS node
FROM ${SPRYKER_NODE_IMAGE} AS node

ARG SPRYKER_NPM_VERSION

Expand Down
4 changes: 3 additions & 1 deletion images/common/dashboard/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM node:alpine AS dashboard
ARG SPRYKER_DASHBOARD_IMAGE=node:alpine

FROM ${SPRYKER_DASHBOARD_IMAGE} AS dashboard

RUN mkdir -p /dashboard
WORKDIR /dashboard
Expand Down
7 changes: 4 additions & 3 deletions images/common/services/jenkins/export/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# syntax = docker/dockerfile:experimental
ARG SPRYKER_PARENT_IMAGE
ARG SPRYKER_JENKINS_IMAGE=spryker/jenkins-boilerplate:latest

FROM spryker/jenkins-boilerplate:latest as spryker-jenkins-boilerplate
FROM ${SPRYKER_JENKINS_IMAGE} as spryker-jenkins-boilerplate
FROM ${SPRYKER_PARENT_IMAGE} as spryker_jenkins
EXPOSE 8080
COPY context/jenkins/export/jenkins.docker.xml.twig ./config/Zed/cronjobs/jenkins.docker.xml.twig

COPY --from=spryker-jenkins-boilerplate /usr/share/jenkins/ref/plugins /usr/share/jenkins/ref/plugins
COPY --from=spryker-jenkins-boilerplate /usr/share/jenkins/jenkins.war /usr/share/jenkins/jenkins.war
COPY --from=spryker-jenkins-boilerplate /usr/share/jenkins/jenkins-cli.jar /usr/share/jenkins/jenkins-cli.jar

# Install packages on Alpine
RUN bash -c 'if [ ! -z "$(which apk)" ]; then apk --no-cache add \
curl \
Expand All @@ -35,7 +36,7 @@ RUN bash -c 'if [ ! -z "$(which apt)" ]; then apt update -y && \
jq \
&& \
mkdir -p /envs \
; fi'
; fi'

COPY terraform/cli /envs/
COPY context/jenkins/export/entrypoint.sh /entrypoint.sh
Expand Down
Loading