ec-europa / dtt-toolkit-upgrade
升级仓库到工具包的包
This package is auto-updated.
Last update: 2021-06-23 12:12:57 UTC
README
介绍
此包用于允许 DTT 在不实际升级其启动包的情况下测试工具包。它包含一个自定义的 composer.json,在安装工具包之前执行步骤以模拟升级。它将允许 DTT 在 Drone 管道上运行其代码库,以便他们可以提供有关缺少的内容或应该改进的内容的反馈。
在执行管道步骤之前,在代码库上执行以下当前步骤:https://github.com/ec-europa/dtt-toolkit-upgrade/blob/master/src/composer.json#L11-L23
升级步骤说明
PHPCS 规则集
升级过程的第一步是将 resources/phpcs-custom.xml
重命名为 phpcs-ruleset.xml
。通常不需要进一步的操作。但由于我们正在 europa 主题文件夹中构建资源,该文件夹位于 lib/ 中,因此自定义升级脚本在将其移动到正确位置后,正在向文件中添加一些与该主题相关的排除项
# Move file. mv resources/phpcs-custom.xml phpcs-ruleset.xml # Delete last line. sed -i '$ d' phpcs-ruleset.xml # Append extra exclusions. echo \"$(cat vendor/ec-europa/dtt-toolkit-upgrade/src/phpcs-ruleset.xml)\" >> phpcs-ruleset.xml
复制资源
我们复制所有必要的资源,以允许您的项目在 Drone 上运行工具包
# Copy the general build files into the root folder. # - props file contains property mappings from starterkit to toolkit. # - xml file contains new build targets to allow Drone to build on toolkit. cp -Rf vendor/ec-europa/dtt-toolkit-upgrade/build.project.* ./ # The individual project properties are being copied into the resources folder. cp -Rf vendor/ec-europa/dtt-toolkit-upgrade/resources ./
复制测试文件
我们将之前位于资源文件夹中的 composer.json 和 composer.lock 文件放置在测试文件夹中。这个额外的要求是要也将您的 bin-dir
定义为 "bin"。我们在测试文件夹中执行测试,因为资源实际上将被部署到生产环境中
# Copy the composer files with the bin-dir added to it. cp -Rf vendor/ec-europa/dtt-toolkit-upgrade/tests ./ # Add lines with brower and capabiities to run on headless chrome. sed -i '/ selenium2:/ r vendor/ec-europa/dtt-toolkit-upgrade/src/behat.yml.dist' tests/behat.*.dist # Remove all lines that have a step to with for AJAX (issue will be explained). sed -i '/And I wait for AJAX to finish/d' tests/features/**/*.feature
为模块和主题创建新的位置
工具包通过符号链接单个模块而不是整个文件夹,以更符合 composer 构建项目的方式。为了模拟升级,我们在 Lib/modules
下的 custom
模块和 features
下创建新的目录。
在创建目录后,我们将所有单个模块符号链接到新位置。
# Make new location directories. mkdir lib/modules/custom && mkdir lib/modules/features # Symlink all custom modules and remove the custom folder to avoid recursion. ln -s $(pwd)/lib/modules/*/ lib/modules/custom && rm lib/modules/custom/custom # Symlink all custom features. ln -s $(pwd)/lib/features/*/ lib/modules/features # Symlink the entire dev_modules foler so we can access it as well during build. ln -s $(pwd)/resources/dev_modules lib/modules/custom/dev_modules
安装工具包
最后一步是安装工具包,因为我们已经执行了所有模拟从启动包升级到工具包的步骤
PROJECT=$(pwd) composer run-script toolkit-install -d ./vendor/ec-europa/toolkit