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

Allow usage of static encryption key #114

Open
wants to merge 1 commit into
base: master
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
3 changes: 3 additions & 0 deletions magento-integration-tests/7.0/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inputs:
magento_post_install_script:
description: 'Relative path to an optional script after Magento installation is run. Leave empty to use the default.'
required: false
magento_encryption_key:
description: 'Static encryption key to be used during Magento installation.'
required: false
runs:
using: 'docker'
image: 'docker://extdn/magento-integration-tests-action:7.0-latest'
Expand Down
3 changes: 3 additions & 0 deletions magento-integration-tests/7.1/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inputs:
magento_post_install_script:
description: 'Relative path to an optional script after Magento installation is run. Leave empty to use the default.'
required: false
magento_encryption_key:
description: 'Static encryption key to be used during Magento installation.'
required: false
runs:
using: 'docker'
image: 'docker://extdn/magento-integration-tests-action:7.1-latest'
Expand Down
3 changes: 3 additions & 0 deletions magento-integration-tests/7.2/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inputs:
magento_post_install_script:
description: 'Relative path to an optional script after Magento installation is run. Leave empty to use the default.'
required: false
magento_encryption_key:
description: 'Static encryption key to be used during Magento installation.'
required: false
runs:
using: 'docker'
image: 'docker://extdn/magento-integration-tests-action:7.2-latest'
Expand Down
3 changes: 3 additions & 0 deletions magento-integration-tests/7.3/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inputs:
magento_post_install_script:
description: 'Relative path to an optional script after Magento installation is run. Leave empty to use the default.'
required: false
magento_encryption_key:
description: 'Static encryption key to be used during Magento installation.'
required: false
runs:
using: 'docker'
image: 'docker://extdn/magento-integration-tests-action:7.3-latest'
Expand Down
3 changes: 3 additions & 0 deletions magento-integration-tests/7.4/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inputs:
magento_post_install_script:
description: 'Relative path to an optional script after Magento installation is run. Leave empty to use the default.'
required: false
magento_encryption_key:
description: 'Static encryption key to be used during Magento installation.'
required: false
composer_version:
description: 'The composer version to use. Can be either 1 or 2.'
required: false
Expand Down
3 changes: 3 additions & 0 deletions magento-integration-tests/8.1/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inputs:
magento_post_install_script:
description: 'Relative path to an optional script after Magento installation is run. Leave empty to use the default.'
required: false
magento_encryption_key:
description: 'Static encryption key to be used during Magento installation.'
required: false
composer_version:
description: 'The composer version to use. Can be either 1 or 2.'
required: false
Expand Down
3 changes: 3 additions & 0 deletions magento-integration-tests/8.2/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inputs:
magento_post_install_script:
description: 'Relative path to an optional script after Magento installation is run. Leave empty to use the default.'
required: false
magento_encryption_key:
description: 'Static encryption key to be used during Magento installation.'
required: false
composer_version:
description: 'The composer version to use. Can be either 1 or 2.'
required: false
Expand Down
3 changes: 3 additions & 0 deletions magento-integration-tests/8.3/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ inputs:
magento_post_install_script:
description: 'Relative path to an optional script after Magento installation is run. Leave empty to use the default.'
required: false
magento_encryption_key:
description: 'Static encryption key to be used during Magento installation.'
required: false
composer_version:
description: 'The composer version to use. Can be either 1 or 2.'
required: false
Expand Down
20 changes: 15 additions & 5 deletions magento-integration-tests/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ echo "Using composer ${COMPOSER_VERSION}"
ln -s /usr/local/bin/composer$COMPOSER_VERSION /usr/local/bin/composer

echo "Pre Project Script [pre_project_script]: $INPUT_PRE_PROJECT_SCRIPT"
if [[ ! -z "$INPUT_PRE_PROJECT_SCRIPT" && -f "${GITHUB_WORKSPACE}/$INPUT_PRE_PROJECT_SCRIPT" ]] ; then
if [[ -n "$INPUT_PRE_PROJECT_SCRIPT" && -f "${GITHUB_WORKSPACE}/$INPUT_PRE_PROJECT_SCRIPT" ]] ; then
echo "Running custom pre_project_script: ${INPUT_PRE_PROJECT_SCRIPT}"
. ${GITHUB_WORKSPACE}/$INPUT_PRE_PROJECT_SCRIPT
fi
Expand All @@ -60,7 +60,7 @@ cp -R ${GITHUB_WORKSPACE}/${MODULE_SOURCE} $GITHUB_ACTION
cd $MAGENTO_ROOT

echo "Post Project Script [post_project_script]: $INPUT_POST_PROJECT_SCRIPT"
if [[ ! -z "$INPUT_POST_PROJECT_SCRIPT" && -f "${GITHUB_WORKSPACE}/$INPUT_POST_PROJECT_SCRIPT" ]] ; then
if [[ -n "$INPUT_POST_PROJECT_SCRIPT" && -f "${GITHUB_WORKSPACE}/$INPUT_POST_PROJECT_SCRIPT" ]] ; then
echo "Running custom post_project_script: ${INPUT_POST_PROJECT_SCRIPT}"
. ${GITHUB_WORKSPACE}/$INPUT_POST_PROJECT_SCRIPT
fi
Expand All @@ -72,7 +72,7 @@ composer config repositories.magento composer $REPOSITORY_URL
composer require $COMPOSER_NAME:@dev --no-update --no-interaction

echo "Pre Install Script [magento_pre_install_script]: $INPUT_MAGENTO_PRE_INSTALL_SCRIPT"
if [[ ! -z "$INPUT_MAGENTO_PRE_INSTALL_SCRIPT" && -f "${GITHUB_WORKSPACE}/$INPUT_MAGENTO_PRE_INSTALL_SCRIPT" ]] ; then
if [[ -n "$INPUT_MAGENTO_PRE_INSTALL_SCRIPT" && -f "${GITHUB_WORKSPACE}/$INPUT_MAGENTO_PRE_INSTALL_SCRIPT" ]] ; then
echo "Running custom magento_pre_install_script: ${INPUT_MAGENTO_PRE_INSTALL_SCRIPT}"
. ${GITHUB_WORKSPACE}/$INPUT_MAGENTO_PRE_INSTALL_SCRIPT
fi
Expand Down Expand Up @@ -112,6 +112,11 @@ if bin/magento setup:install --help | grep -q '\-\-search\-engine='; then
SETUP_ARGS="$SETUP_ARGS --search-engine=elasticsearch7"
fi

if [[ -n "$INPUT_MAGENTO_ENCRYPTION_KEY" ]]; then
echo "Adding static encryption key"
SETUP_ARGS="$SETUP_ARGS --key=$INPUT_MAGENTO_ENCRYPTION_KEY"
fi

if [[ "$ELASTICSEARCH" == "1" ]]; then
SETUP_ARGS="$SETUP_ARGS --elasticsearch-host=es --elasticsearch-port=9200 --elasticsearch-enable-auth=0 --elasticsearch-timeout=60"
fi
Expand All @@ -120,13 +125,13 @@ echo "Run Magento setup: $SETUP_ARGS"
php bin/magento setup:install $SETUP_ARGS

echo "Post Install Script [magento_post_install_script]: $INPUT_MAGENTO_POST_INSTALL_SCRIPT"
if [[ ! -z "$INPUT_MAGENTO_POST_INSTALL_SCRIPT" && -f "${GITHUB_WORKSPACE}/$INPUT_MAGENTO_POST_INSTALL_SCRIPT" ]] ; then
if [[ -n "$INPUT_MAGENTO_POST_INSTALL_SCRIPT" && -f "${GITHUB_WORKSPACE}/$INPUT_MAGENTO_POST_INSTALL_SCRIPT" ]] ; then
echo "Running custom magento_post_install_script: ${INPUT_MAGENTO_POST_INSTALL_SCRIPT}"
. ${GITHUB_WORKSPACE}/$INPUT_MAGENTO_POST_INSTALL_SCRIPT
fi

echo "Trying phpunit.xml file $PHPUNIT_FILE"
if [[ ! -z "$PHPUNIT_FILE" ]] ; then
if [[ -n "$PHPUNIT_FILE" ]] ; then
PHPUNIT_FILE=${GITHUB_WORKSPACE}/${PHPUNIT_FILE}
fi

Expand All @@ -142,6 +147,11 @@ if [[ "$ELASTICSEARCH" == "1" ]]; then
cp /docker-files/install-config-mysql-with-es.php dev/tests/integration/etc/install-config-mysql.php
fi

if [[ -n "$INPUT_MAGENTO_ENCRYPTION_KEY" ]]; then
key_install_config="\ 'key' => '$INPUT_MAGENTO_ENCRYPTION_KEY',";
sed -i "/]/i $key_install_config" dev/tests/integration/etc/install-config-mysql.php
fi

sed "s#%COMPOSER_NAME%#$COMPOSER_NAME#g" $PHPUNIT_FILE > dev/tests/integration/phpunit.xml

for TESTSFOLDER in $(xmlstarlet select -t -v '/phpunit/testsuites/testsuite/directory/text()' dev/tests/integration/phpunit.xml)
Expand Down