mirror of
https://github.com/silverstripe/recipe-plugin.git
synced 2024-10-22 14:05:55 +02:00
Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
acb067fdc2 | ||
|
e5dceb4546 | ||
|
c4e8728ff9 | ||
|
da89aa5dcc | ||
|
4ec7b15347 | ||
|
2f74096ea4 | ||
|
2175573ca5 | ||
|
f68a4cc2be |
11
.github/workflows/ci.yml
vendored
Normal file
11
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
ci:
|
||||||
|
name: CI
|
||||||
|
uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1
|
16
.github/workflows/dispatch-ci.yml
vendored
Normal file
16
.github/workflows/dispatch-ci.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
name: Dispatch CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
# At 12:00 PM UTC, only on Friday and Saturday
|
||||||
|
schedule:
|
||||||
|
- cron: '0 12 * * 5,6'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dispatch-ci:
|
||||||
|
name: Dispatch CI
|
||||||
|
# Only run cron on the silverstripe account
|
||||||
|
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Dispatch CI
|
||||||
|
uses: silverstripe/gha-dispatch-ci@v1
|
17
.github/workflows/keepalive.yml
vendored
Normal file
17
.github/workflows/keepalive.yml
vendored
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
name: Keepalive
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
# The 4th of every month at 10:50am UTC
|
||||||
|
schedule:
|
||||||
|
- cron: '50 10 4 * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
keepalive:
|
||||||
|
name: Keepalive
|
||||||
|
# Only run cron on the silverstripe account
|
||||||
|
if: (github.event_name == 'schedule' && github.repository_owner == 'silverstripe') || (github.event_name != 'schedule')
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Keepalive
|
||||||
|
uses: silverstripe/gha-keepalive@v1
|
@ -1,4 +1,7 @@
|
|||||||
# SilverStripe recipe-plugin
|
# Silverstripe recipe-plugin
|
||||||
|
|
||||||
|
[![CI](https://github.com/silverstripe/recipe-plugin/actions/workflows/ci.yml/badge.svg)](https://github.com/silverstripe/recipe-plugin/actions/workflows/ci.yml)
|
||||||
|
[![Silverstripe supported module](https://img.shields.io/badge/silverstripe-supported-0071C4.svg)](https://www.silverstripe.org/software/addons/silverstripe-commercially-supported-module-list/)
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
|
@ -25,7 +25,8 @@
|
|||||||
"composer-plugin-api": "^1.1 || ^2"
|
"composer-plugin-api": "^1.1 || ^2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"composer/composer": "^1.2 || 2"
|
"composer/composer": "^1.2 || 2",
|
||||||
|
"squizlabs/php_codesniffer": "^3.5"
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev"
|
"minimum-stability": "dev"
|
||||||
}
|
}
|
||||||
|
@ -1,2 +1,12 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ruleset><rule ref="PSR2" /></ruleset>
|
<ruleset name="SilverStripe">
|
||||||
|
<description>CodeSniffer ruleset for SilverStripe coding conventions.</description>
|
||||||
|
|
||||||
|
<file>src</file>
|
||||||
|
|
||||||
|
<!-- base rules are PSR-12 -->
|
||||||
|
<rule ref="PSR12" >
|
||||||
|
<exclude name="PSR1.Methods.CamelCapsMethodName.NotCamelCaps" />
|
||||||
|
<exclude name="PSR1.Files.SideEffects.FoundWithSymbols" />
|
||||||
|
</rule>
|
||||||
|
</ruleset>
|
||||||
|
@ -110,7 +110,8 @@ class RecipeInstaller extends LibraryInstaller
|
|||||||
" - Skipping <info>$relativePath</info> (<comment>existing and modified in project</comment>)"
|
" - Skipping <info>$relativePath</info> (<comment>existing and modified in project</comment>)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} elseif (in_array($relativePath, $installedFiles ?? []) ||
|
} elseif (
|
||||||
|
in_array($relativePath, $installedFiles ?? []) ||
|
||||||
in_array($relativeDestination, $installedFiles ?? [])
|
in_array($relativeDestination, $installedFiles ?? [])
|
||||||
) {
|
) {
|
||||||
// Don't re-install previously installed files that have been deleted
|
// Don't re-install previously installed files that have been deleted
|
||||||
@ -140,7 +141,7 @@ class RecipeInstaller extends LibraryInstaller
|
|||||||
foreach ($patterns as $pattern) {
|
foreach ($patterns as $pattern) {
|
||||||
$expressions[] = $this->globToRegexp($pattern);
|
$expressions[] = $this->globToRegexp($pattern);
|
||||||
}
|
}
|
||||||
$regExp = '#^' . $this->globToRegexp($sourceRoot . '/').'(('.implode(')|(', $expressions).'))$#';
|
$regExp = '#^' . $this->globToRegexp($sourceRoot . '/') . '((' . implode(')|(', $expressions) . '))$#';
|
||||||
|
|
||||||
// Build directory iterator
|
// Build directory iterator
|
||||||
$directoryIterator = new RecursiveDirectoryIterator(
|
$directoryIterator = new RecursiveDirectoryIterator(
|
||||||
@ -224,8 +225,9 @@ class RecipeInstaller extends LibraryInstaller
|
|||||||
* Perform any file rewrites necessary to a relative path of a file being installed.
|
* Perform any file rewrites necessary to a relative path of a file being installed.
|
||||||
* E.g. if 'mysite' folder exists, rewrite 'mysite' to 'app' and 'mysite/code' to 'app/src'
|
* E.g. if 'mysite' folder exists, rewrite 'mysite' to 'app' and 'mysite/code' to 'app/src'
|
||||||
*
|
*
|
||||||
* @deprecated 1.2..2.0 Will be removed in 2.0; app folder will be hard coded and no
|
* This will be removed in 2.0 as the app folder will be hard coded and no rewrites supported.
|
||||||
* rewrites supported.
|
*
|
||||||
|
* @deprecated 1.2.0 Will be removed without equivalent functionality to replace it
|
||||||
* @param string $destinationRoot Project root
|
* @param string $destinationRoot Project root
|
||||||
* @param string $relativePath Relative path to the resource being installed
|
* @param string $relativePath Relative path to the resource being installed
|
||||||
* @return string Relative path we should write to
|
* @return string Relative path we should write to
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace SilverStripe\RecipePlugin;
|
namespace SilverStripe\RecipePlugin;
|
||||||
|
|
||||||
use Composer\Composer;
|
use Composer\Composer;
|
||||||
@ -27,37 +26,37 @@ class RecipePlugin implements PluginInterface, EventSubscriberInterface, Capable
|
|||||||
/**
|
/**
|
||||||
* Type of recipe to check for
|
* Type of recipe to check for
|
||||||
*/
|
*/
|
||||||
const RECIPE_TYPE = 'silverstripe-recipe';
|
public const RECIPE_TYPE = 'silverstripe-recipe';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'extra' key for project files
|
* 'extra' key for project files
|
||||||
*/
|
*/
|
||||||
const PROJECT_FILES = 'project-files';
|
public const PROJECT_FILES = 'project-files';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'extra' key for public files
|
* 'extra' key for public files
|
||||||
*/
|
*/
|
||||||
const PUBLIC_FILES = 'public-files';
|
public const PUBLIC_FILES = 'public-files';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hard-coded 'public' web-root folder
|
* Hard-coded 'public' web-root folder
|
||||||
*/
|
*/
|
||||||
const PUBLIC_PATH = 'public';
|
public const PUBLIC_PATH = 'public';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'extra' key for list of project files installed
|
* 'extra' key for list of project files installed
|
||||||
*/
|
*/
|
||||||
const PROJECT_FILES_INSTALLED = 'project-files-installed';
|
public const PROJECT_FILES_INSTALLED = 'project-files-installed';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'extra' key for list of public files installed
|
* 'extra' key for list of public files installed
|
||||||
*/
|
*/
|
||||||
const PUBLIC_FILES_INSTALLED = 'public-files-installed';
|
public const PUBLIC_FILES_INSTALLED = 'public-files-installed';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'extra' key for project dependencies installed
|
* 'extra' key for project dependencies installed
|
||||||
*/
|
*/
|
||||||
const PROJECT_DEPENDENCIES_INSTALLED = 'project-dependencies-installed';
|
public const PROJECT_DEPENDENCIES_INSTALLED = 'project-dependencies-installed';
|
||||||
|
|
||||||
public function activate(Composer $composer, IOInterface $io)
|
public function activate(Composer $composer, IOInterface $io)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user