Skip to content

Commit

Permalink
Add deployment script tool
Browse files Browse the repository at this point in the history
ISSUE: CS-3177
  • Loading branch information
goran-stamenkovski-logeecom committed May 24, 2022
1 parent 4a2c7d4 commit c20a43c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ psalm.xml
grumphp.yml
.*.cache
tools/vendor
tools/AdyenPayment.zip
!tools/composer.lock
tests/fixtures/applepay/*
!tests/fixtures/applepay/ZipExtractor.zip
46 changes: 46 additions & 0 deletions tools/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Cleanup any leftovers
rm -f ./tools/AdyenPayment.zip
rm -fR /tmp/Adyen

# Create deployment source
echo "Copying plugin source..."
mkdir -p /tmp/Adyen/deploy
cp -R ./ /tmp/Adyen/deploy/AdyenPayment

# Ensure proper composer dependencies
echo "Installing composer dependencies..."
rm -fR /tmp/Adyen/deploy/AdyenPayment/vendor
composer install --no-dev --working-dir=/tmp/Adyen/deploy/AdyenPayment/

# Remove unnecessary files from final release archive
echo "Removing unnecessary files from final release archive..."
rm -fR /tmp/Adyen/deploy/AdyenPayment/tests
rm -fR /tmp/Adyen/deploy/AdyenPayment/tools
rm -fR /tmp/Adyen/deploy/AdyenPayment/PluginInstallation
rm -fR /tmp/Adyen/deploy/AdyenPayment/.git
rm -fR /tmp/Adyen/deploy/AdyenPayment/.idea
rm -fR /tmp/Adyen/deploy/AdyenPayment/.github
rm -fR /tmp/Adyen/deploy/AdyenPayment/.gitignore
rm -fR /tmp/Adyen/deploy/AdyenPayment/.php-cs-fixer.cache
rm -fR /tmp/Adyen/deploy/AdyenPayment/.php-cs-fixer.dist.php
rm -fR /tmp/Adyen/deploy/AdyenPayment/.phpunit.result.cache
rm -fR /tmp/Adyen/deploy/AdyenPayment/bitbucket-pipelines.yml
rm -fR /tmp/Adyen/deploy/AdyenPayment/grumphp.yml
rm -fR /tmp/Adyen/deploy/AdyenPayment/grumphp.yml.dist
rm -fR /tmp/Adyen/deploy/AdyenPayment/phpcs.xml
rm -fR /tmp/Adyen/deploy/AdyenPayment/phpunit.xml.dist
rm -fR /tmp/Adyen/deploy/AdyenPayment/psalm.xml.dist

# Create plugin archive
echo "Reading plugin archive version from plugin.xml file..."
version=$(grep -oPm1 "(?<=<version>)[^<]+" ./plugin.xml)
echo "The plugin version from plugin.xml is: $version"

echo "Creating new archive..."
php tools/sw.phar plugin:zip:dir -q /tmp/Adyen/deploy/AdyenPayment/
rm -fR /tmp/Adyen

mv AdyenPayment.zip ./tools/AdyenPayment.zip
echo "New plugin archive for version $version created: $PWD/tools/AdyenPayment.zip"
Binary file added tools/sw.phar
Binary file not shown.

0 comments on commit c20a43c

Please sign in to comment.