Skip to content

Commit

Permalink
Merge pull request #15 from bluem-development/further-plugin-update-i…
Browse files Browse the repository at this point in the history
…mprovements

Improved SVN integration for deployments
  • Loading branch information
daanrijpkemacb authored Oct 7, 2024
2 parents 63aa9a5 + 020956d commit ba9e272
Show file tree
Hide file tree
Showing 8 changed files with 68 additions and 102 deletions.
11 changes: 11 additions & 0 deletions .svnignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
.env.sample
.git/
.github/
.idea/
build/
scripts/
svn-directory/
tests/
tools/
vendor/
70 changes: 51 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ add_git_hooks:

PLUGIN_SLUG = bluem
SVN_URL = https://plugins.svn.wordpress.org/$(PLUGIN_SLUG)
SVN_DIR = svn-directory
SVN_DIR = svn-directory/${PLUGIN_SLUG}
CURRENT_DIR = $(shell pwd)
BUILD_DIR = $(CURRENT_DIR)/build

Expand All @@ -61,12 +61,14 @@ EMAIL = [email protected]
# Colors for terminal output
RED = \033[0;31m
GREEN = \033[0;32m
BLUE => \033[34m
NC = \033[0m # No Color


.PHONY: release

release: check-tag confirm svn-check repo-check pre-deployment add-tag svn-commit clean-up send-email
release: check-tag confirm svn-check repo-check pre-deployment add-tag add-tag-to-svn svn-commit update-trunk clean-up
# send-email

check-tag:
@if [ -z "$(NEW_TAG)" ]; then \
Expand All @@ -75,37 +77,67 @@ check-tag:
fi

confirm:
@echo "$(GREEN)You are about to release a new version: $(NEW_TAG). Are you sure? [Y/n]$(NC)" && read ans && [ $${ans:-Y} = Y ]
@echo "$(BLUE)You are about to release a new version, namely \"$(NEW_TAG)\". Are you sure? [Y/n]$(NC)" && read ans && [ $${ans:-Y} = Y ]

svn-check:
@echo "$(GREEN)Checking SVN availability...$(NC)"
@svn --version > /dev/null 2>&1 || (echo "$(RED)SVN not available. Please install SVN.$(NC)" && exit 1)
@#echo "$(BLUE)Checking SVN availability...$(NC)"
@#svn --version > /dev/null 2>&1 || (echo "$(RED)SVN not available. Please install SVN.$(NC)" && exit 1)

repo-check:
@echo "$(GREEN)Checking SVN repository availability...$(NC)"
@svn info $(SVN_URL) > /dev/null 2>&1 || (echo "$(RED)Cannot access SVN repository. Check network or URL.$(NC)" && exit 1)
@#echo "$(BLUE)Checking SVN repository availability...$(NC)"
@#svn info $(SVN_URL) > /dev/null 2>&1 || (echo "$(RED)Cannot access SVN repository. Check network or URL.$(NC)" && exit 1)

pre-deployment:
@echo "$(GREEN)Preparing build directory...$(NC)"
@mkdir -p $(BUILD_DIR)
@rsync -av --exclude='build/' $(CURRENT_DIR)/ $(BUILD_DIR)/
@echo "$(GREEN)Installing Composer dependencies in build directory...$(NC)"
@cd $(BUILD_DIR) && composer install --no-dev --optimize-autoloader
@echo "$(GREEN)Removing unnecessary files from build directory...$(NC)"
@cd $(BUILD_DIR) && rm -rf .git composer.* Makefile tools
@echo "$(BLUE)Preparing build directory...$(NC)"
if [ -d "$(BUILD_DIR)" ]; then \
if [ "$(BUILD_DIR)" != "/" ]; then \
rm -rf "$(BUILD_DIR)"/*; \
fi \
else \
mkdir -p "$(BUILD_DIR)"; \
fi
@rsync -av --exclude-from='.svnignore' $(CURRENT_DIR)/ $(BUILD_DIR)/
@echo "$(BLUE)Installing Composer dependencies in build directory...$(NC)"
@cd $(BUILD_DIR) && composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction || { echo "$(RED)Composer install failed!$(NC)"; exit 1; }
@cd $(BUILD_DIR) && composer clear-cache
@echo "$(BLUE)Removing unnecessary files from build directory...$(NC)"
@cd $(BUILD_DIR) && rm -rf README.md .git Makefile tools .env.sample .gitignore Dockerfile .env.sample .gitignore docker-compose.yml codeception.yml Dockerfile loadenv.sh Makefile .php-cs-fixer.cache .phpunit.result.cache .travis.yml phpunit.xml psalm.xml

add-tag:
@echo "$(GREEN)Copying files to SVN tag directory...$(NC)"
@echo "$(BLUE)Copying files to SVN tag directory...$(NC)"
@echo "Folder: $(SVN_DIR)/tags/$(NEW_TAG)"
if [ -d "$(SVN_DIR)/tags/$(NEW_TAG)" ]; then \
rm -rf "$(SVN_DIR)/tags/$(NEW_TAG)"/*; \
else \
mkdir -p "$(SVN_DIR)/tags/$(NEW_TAG)"; \
fi
@mkdir -p $(SVN_DIR)/tags/$(NEW_TAG)
@cp -R $(BUILD_DIR)/ $(SVN_DIR)/tags/$(NEW_TAG)/
@cd $(SVN_DIR)/tags/$(NEW_TAG) && svn add --force * --auto-props --parents --depth infinity -q

add-tag-to-svn:
@echo "$(BLUE)Adding new tag $(NEW_TAG) to SVN repository...$(NC)"
@#cd $(SVN_DIR)/tags/$(NEW_TAG) && svn add --force * --auto-props --parents --depth infinity -q

svn-commit:
@echo "$(GREEN)Committing new tag $(NEW_TAG) to SVN repository...$(NC)"
@cd $(SVN_DIR)/tags/$(NEW_TAG) && svn commit -m "Tagging version $(NEW_TAG)"
@echo "$(BLUE)Committing new tag $(NEW_TAG) to SVN repository...$(NC)"
@#cd $(SVN_DIR)/tags/$(NEW_TAG) && svn commit -m "Tagging version $(NEW_TAG)"

update-trunk:
@echo "$(BLUE)Also updating trunk files to latest tag $(NEW_TAG)...$(NC)"
if [ -d "$(SVN_DIR)/trunk" ]; then \
rm -rf "$(SVN_DIR)/trunk"/*; \
else \
mkdir -p "$(SVN_DIR)/trunk"; \
fi
@rm -rf $(SVN_DIR)/trunk/*
@cp -R $(BUILD_DIR)/* $(SVN_DIR)/trunk/.
@echo "$(BLUE)Commit trunk to SVN to this latest tag $(NEW_TAG)...$(NC)"
@echo "$(RED) Don't forget to actually commit to SVN now."
# @cd $(SVN_DIR)/trunk && svn add --force * --auto-props --parents --depth infinity -q
# @cd $(SVN_DIR)/trunk && svn commit -m "Updating trunk to version $(NEW_TAG)"

clean-up:
@echo "$(GREEN)Cleaning up...$(NC)"
@echo "$(BLUE)Cleaning up...$(NC)"
@rm -rf $(BUILD_DIR)

#send-email:
Expand Down
3 changes: 0 additions & 3 deletions bluem-payments.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<?php
// @todo: add Woo Product update key if necessary, check https://docs.woocommerce.com/document/create-a-plugin/
// @todo: Localize all error messages to english primarily
// @todo: finish docblocking

if ( ! defined( 'ABSPATH' ) ) {
exit;
Expand Down
14 changes: 3 additions & 11 deletions bluem.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: Bluem ePayments, iDIN and eMandates integration for shortcodes and WooCommerce checkout
* Version: 1.3.19
* Version: 1.3.20
* Plugin URI: https://wordpress.org/plugins/bluem
* Description: Bluem integration for WordPress and WooCommerce to facilitate Bluem services inside your site. Payments and eMandates payment gateway and iDIN identity verification
* Author: Bluem Payment Services
Expand All @@ -19,10 +19,6 @@
* @author Bluem Payment Services
*/

// @todo: add Woo Product update key if necessary, check https://docs.woocommerce.com/document/create-a-plugin/
// @todo: Localize all error messages to english primarily
// @todo: finish docblocking

if (!defined('ABSPATH')) {
exit;
}
Expand All @@ -32,13 +28,10 @@

const BLUEM_WOOCOMMERCE_MANUAL_URL = "https://codexology.notion.site/Bluem-voor-WordPress-en-WooCommerce-Handleiding-9e2df5c5254a4b8f9cbd272fae641f5e";

// get composer dependencies
require __DIR__ . '/vendor/autoload.php';

use Bluem\BluemPHP\Bluem;
use Bluem\Wordpress\Observability\BluemActivationNotifier;
use Bluem\Wordpress\Observability\SentryLogger;


if (!defined("BLUEM_LOCAL_DATE_FORMAT")) {
define("BLUEM_LOCAL_DATE_FORMAT", "Y-m-d\TH:i:s");
Expand Down Expand Up @@ -2023,8 +2016,7 @@ function bluem_register_error_logging()
update_option('bluem_woocommerce_options', $bluem_options);
}


$logger = new SentryLogger();
$logger->initialize();
// $logger = new SentryLogger();
// $logger->initialize();
}
}
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"require": {
"php": ">=8.0",
"bluem-development/bluem-php": "2.3.3",
"ext-json": "*",
"sentry/sdk": "^4.0"
"ext-json": "*"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: Bluem,Payments,iDIN,iDEAL,Incassomachtigen,woocommerce, bluem, payment gat
Requires at least: 5.0
Tested up to: 6.5
Requires PHP: 8.0
Stable tag: 1.3.19
Stable tag: 1.3.20
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -77,6 +77,7 @@ Shortcode: `[bluem_identificatieformulier]`
It is possible to programmatically block display and functionality on your site based on the verification status. Please contact us if you are interested in developing this in your site.

== Changelog ==
- 1.3.20: General stability and code improvements to adhere to the standards
- 1.3.19: General stability and code improvements to adhere to the standards
- 1.3.18.0: Improved observability, removed unnecessary dependencies
- 1.3.17.15: Webhook certificate update (yearly refresh)
Expand Down
50 changes: 0 additions & 50 deletions src/Observability/SentryLogger.php

This file was deleted.

16 changes: 0 additions & 16 deletions uninstall.php

This file was deleted.

0 comments on commit ba9e272

Please sign in to comment.