Skip to content

Commit 195ef1f

Browse files
authored
Merge pull request #15 from Flowpack/add-option-to-publish-without-validation
FEATURE: allow full publish without validation
2 parents c8b0d2c + 79607c1 commit 195ef1f

4 files changed

Lines changed: 23 additions & 5 deletions

File tree

Classes/ContentReleaseManager.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,17 @@ public function startIncrementalContentRelease()
5050

5151
// the currentContentReleaseId is not used in any pipeline step in this package, but is a common need in other
5252
// use cases in extensions, e.g. calculating the differences between current and new release
53-
$this->prunnerApiService->schedulePipeline(PipelineName::create('do_content_release'), ['contentReleaseId' => (string)time(), 'currentContentReleaseId' => $currentContentReleaseId ?: self::NO_PREVIOUS_RELEASE]);
53+
$this->prunnerApiService->schedulePipeline(PipelineName::create('do_content_release'), ['contentReleaseId' => (string)time(), 'currentContentReleaseId' => $currentContentReleaseId ?: self::NO_PREVIOUS_RELEASE, 'validate' => true]);
5454
}
5555

56-
public function startFullContentRelease()
56+
// the validate parameter can be used to intentionally skip the validation step for this release
57+
public function startFullContentRelease(bool $validate = true)
5758
{
5859
$redis = $this->redisClientManager->getPrimaryRedis();
5960
$currentContentReleaseId = $redis->get(self::REDIS_CURRENT_RELEASE_KEY);
6061

6162
$this->contentCache->flush();
62-
$this->prunnerApiService->schedulePipeline(PipelineName::create('do_content_release'), ['contentReleaseId' => (string)time(), 'currentContentReleaseId' => $currentContentReleaseId ?: self::NO_PREVIOUS_RELEASE]);
63+
$this->prunnerApiService->schedulePipeline(PipelineName::create('do_content_release'), ['contentReleaseId' => (string)time(), 'currentContentReleaseId' => $currentContentReleaseId ?: self::NO_PREVIOUS_RELEASE, 'validate' => $validate]);
6364
}
6465

6566
public function cancelAllRunningContentReleases()

Classes/Controller/BackendController.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ public function publishAllAction()
135135
$this->redirect('index');
136136
}
137137

138+
public function publishAllWithoutValidationAction()
139+
{
140+
$this->contentReleaseManager->cancelAllRunningContentReleases();
141+
$this->contentReleaseManager->startFullContentRelease(false);
142+
$this->redirect('index');
143+
}
144+
138145
public function removeAction(string $contentReleaseIdentifier, string $redisInstanceIdentifier)
139146
{
140147
if ($this->request->getHttpRequest()->getMethod() !== 'POST') {

Resources/Private/BackendFusion/Integration/Backend.Index.fusion

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,17 @@ Flowpack.DecoupledContentStore.BackendController.index = Neos.Fusion:Component {
1010
// - showToggleConfigEpochButton: boolean
1111

1212
renderer = Neos.Fusion:Component {
13+
_publishAllWithoutValidationUri = Neos.Fusion:UriBuilder {
14+
action = 'publishAllWithoutValidation'
15+
}
16+
1317
_pruneContentStoreUri = Neos.Fusion:UriBuilder {
1418
action = 'pruneContentStore'
1519
arguments = Neos.Fusion:DataStructure {
1620
redisInstanceIdentifier = ${contentStore}
1721
}
1822
}
23+
1924
_cancelRunningReleaseUri = Neos.Fusion:UriBuilder {
2025
action = 'cancelRunningRelease'
2126
arguments = Neos.Fusion:DataStructure {
@@ -105,6 +110,10 @@ Flowpack.DecoupledContentStore.BackendController.index = Neos.Fusion:Component {
105110
<span>Store size: </span>
106111
<span class="neos-badge neos-badge-info">{storeSize}</span>
107112
<br />
113+
<button form="postHelper" formaction={props._publishAllWithoutValidationUri} type="submit" class="neos-button neos-button-danger" style="margin-top: 300px;">
114+
Publish all without validation
115+
</button>
116+
<span> </span>
108117
<button form="postHelper" formaction={props._pruneContentStoreUri} type="submit" class="neos-button neos-button-warning" style="margin-top: 300px;">
109118
Prune content store
110119
</button>

pipelines_template.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# The contents of this file is read by [prunner](https://github.com/Flowpack/prunner).
1010
#
1111
pipelines:
12-
# ARG: contentReleaseId, currentContentReleaseId
12+
# ARG: contentReleaseId, currentContentReleaseId, validate
1313
# the currentContentReleaseId is not used in any pipeline step here in the template, but is a common need in other
1414
# use cases in extensions, e.g. calculating the differences between current and new release
1515
do_content_release:
@@ -128,7 +128,8 @@ pipelines:
128128
################################################################################
129129
validate_content:
130130
script:
131-
- ./flow contentReleaseValidation:validate {{ .contentReleaseId }}
131+
- |
132+
{{ if .validate }} ./flow contentReleaseValidation:validate {{ .contentReleaseId }} {{ end }}
132133
depends_on: [ render_finished ]
133134

134135
# Extension Point: If you want to validate additional things

0 commit comments

Comments
 (0)