Skip to content

Commit

Permalink
Merge branch 'master' into feature/paas
Browse files Browse the repository at this point in the history
  • Loading branch information
winstonnolan-spryker authored Sep 7, 2024
2 parents d60bbfa + 72f4a92 commit d542bbd
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 27 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Spryker Commerce OS — Docker SDK
[![Build Status](https://travis-ci.com/spryker/docker-sdk.svg?branch=master)](https://travis-ci.com/spryker/docker-sdk)

## Description

Expand Down
1 change: 1 addition & 0 deletions bin/sdk/assets/baked.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function Assets::build() {
--build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \
--build-arg "SPRYKER_BUILD_HASH=${SPRYKER_BUILD_HASH:-"current"}" \
--build-arg "SPRYKER_BUILD_STAMP=${SPRYKER_BUILD_STAMP:-""}" \
--build-arg "SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN:-""}" \
. 1>&2

Console::end "[DONE]"
Expand Down
1 change: 1 addition & 0 deletions bin/sdk/images/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ function Images::_buildApp() {
--build-arg "SPRYKER_PIPELINE=${SPRYKER_PIPELINE}" \
--build-arg "SPRYKER_BUILD_HASH=${SPRYKER_BUILD_HASH:-"current"}" \
--build-arg "SPRYKER_BUILD_STAMP=${SPRYKER_BUILD_STAMP:-""}" \
--build-arg "SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN:-""}" \
. 1>&2

if [ -n "${SPRYKER_XDEBUG_MODE_ENABLE}" ]; then
Expand Down
61 changes: 36 additions & 25 deletions context/dashboard/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion context/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
"express": "^4.19.2",
"http-proxy-middleware": "^1.3.1",
"path-parse": ">=1.0.7",
"pug": "^3.0.1",
"pug": "^3.0.3",
"serve-favicon": "^2.5.0",
"through2": "^4.0.2"
},
"devDependencies": {
"minimist": ">=1.2.6"
},
"overrides": {
"micromatch": "4.0.6"
}
}
15 changes: 15 additions & 0 deletions generator/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ public function setIsActive(bool $isActive): void
$projectData['_requirementAnalyzerData'] = buildDataForRequirementAnalyzer($projectData);
$projectData['secrets'] = buildSecrets($deploymentDir);
$projectData = buildDefaultCredentials($projectData);
$projectData['_isAcpLocalDevelopmentEnabled'] = isAcpLocalDevelopmentEnabled($projectData);

$dockerVersionObject = json_decode(getenv('DOCKER_VERSION', '{}'));
$skipVersionHeader = version_compare($dockerVersionObject?->Client?->Version, '26.0.0', '>=');
Expand Down Expand Up @@ -1140,6 +1141,20 @@ function isAutoloadCacheEnabled(array $projectData): bool
return $projectData['docker']['cache']['autoload']['enabled'] ?? false;
}

/**
* @param array $projectData
*
* @return bool
*/
function isAcpLocalDevelopmentEnabled(array $projectData): bool
{
if (empty($projectData['image']['environment']['ACP_DOCKER_SDK_FILE'])) {
return false;
}

return true;
}

/**
* @param array $projectData
*
Expand Down
13 changes: 13 additions & 0 deletions generator/src/templates/deploy.bash.twig
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ import service/database/{{ services['database']['engine'] | default('mysql') }}.
import service/broker/{{ services['broker']['engine'] | default('rabbitmq') }}.sh
import service/scheduler/{{ services['scheduler']['engine'] | default('jenkins') }}.sh

{% if _isAcpLocalDevelopmentEnabled %}
# ACP
[[ -f "{{ image['environment']['ACP_DOCKER_SDK_FILE'] }}" ]] && source "{{ image['environment']['ACP_DOCKER_SDK_FILE'] }}"
{% endif %}

# Implementation
import sdk/compose.sh
import sdk/data/demo.sh
Expand Down Expand Up @@ -238,6 +243,14 @@ export TIDEWAYS_ENVIRONMENT_NAME=${TIDEWAYS_ENVIRONMENT_NAME}
{# For avoid https://github.com/docker/compose/issues/9104 #}
export DOCKER_COMPOSE_TTY_DISABLED="$(Environment::getDockerComposeTTY)"

{% if _isAcpLocalDevelopmentEnabled %}
# ACP
export ACP_AWS_ENDPOINT={{ image['environment']['AWS_ENDPOINT'] | default('http://localhost:4566') }}
export ACP_AWS_REGION={{ image['environment']['AWS_DEFAULT_REGION'] | default('eu-central-1') }}
export ACP_AWS_ACCESS_KEY_ID={{ image['environment']['AWS_ACCESS_KEY_ID'] | default('test') }}
export ACP_AWS_SECRET_ACCESS_KEY={{ image['environment']['AWS_SECRET_ACCESS_KEY'] | default('test') }}
{% endif %}

Registry::Flow::runBoot

# Running command
Expand Down
8 changes: 8 additions & 0 deletions images/baked/assets/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ COPY --chown=spryker:spryker package.json package-lock.json ${srcRoot}/
COPY --chown=spryker:spryker frontend* ${srcRoot}/frontend
COPY --chown=spryker:spryker tsconfig*.json ${srcRoot}/
COPY --chown=spryker:spryker config/Yves ${srcRoot}/config/Yves
COPY --chown=spryker:spryker .npmrc ${srcRoot}/

ARG SPRYKER_NPM_TOKEN
ENV SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN}

RUN if [ -n "$SPRYKER_NPM_TOKEN" ]; then \
sed -i "s|\${SPRYKER_NPM_TOKEN}|${SPRYKER_NPM_TOKEN}|" .npmrc; \
fi

ARG SPRYKER_ASSETS_MODE='development'
ENV SPRYKER_ASSETS_MODE=${SPRYKER_ASSETS_MODE}
Expand Down
3 changes: 3 additions & 0 deletions images/mount/cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ FROM ${SPRYKER_PARENT_IMAGE} as cli-development

ENV DEVELOPMENT_CONSOLE_COMMANDS=1

ARG SPRYKER_NPM_TOKEN
ENV SPRYKER_NPM_TOKEN=${SPRYKER_NPM_TOKEN}

0 comments on commit d542bbd

Please sign in to comment.