Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ class CopyPlugin extends AbstractCommand {

def run(client) {
def body = [
siteId: siteOptions.siteId,
path : path
]
if (parameters) {
body.parameters = parameters
}

def path = '/studio/api/2/marketplace/copy'
def path = "/studio/api/2/marketplace/${siteOptions.siteId}/copy"
def result = client.post(path, body)
if (result) {
println "Copy plugin response"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class AddRemote extends AbstractCommand {

def run(client) {
def params = [
siteId : siteOptions.siteId,
remoteName : remoteName,
remoteUrl : remoteUrl,
authenticationType: authAware.authType
Expand All @@ -57,7 +56,7 @@ class AddRemote extends AbstractCommand {
params.remotePrivateKey = authAware.privateKey.text.trim()
}

def path = '/studio/api/2/repository/add_remote.json'
def path = "/studio/api/2/repository/${siteOptions.siteId}/add_remote.json"
def result = client.post(path, params)
if (result) {
println result.response.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ class ListRemotes extends AbstractCommand {
SiteOptions siteOptions

def run(client) {
def path = '/studio/api/2/repository/list_remotes.json'
def query = [siteId: siteOptions.siteId]
def result = client.get(path, query)
def path = "/studio/api/2/repository/${siteOptions.siteId}/list_remotes.json"
def result = client.get(path)
if (!result) {
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ class SyncFrom extends AbstractSyncCommand {

def run(client) {
def params = [
siteId : siteOptions.siteId,
remoteName : remoteOptions.remoteName,
remoteBranch: remoteOptions.remoteBranch
]
if (mergeStrategy) {
params.mergeStrategy = mergeStrategy
}

def path = '/studio/api/2/repository/pull_from_remote.json'
def path = "/studio/api/2/repository/${siteOptions.siteId}/pull_from_remote.json"
def result = client.post(path, params)
if (result) {
println result.response.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@ class SyncTo extends AbstractSyncCommand {

def run(client) {
def params = [
siteId : siteOptions.siteId,
remoteName : remoteOptions.remoteName,
remoteBranch: remoteOptions.remoteBranch
]
if (force) {
params.force = force
}

def path = '/studio/api/2/repository/push_to_remote.json'
def path = "/studio/api/2/repository/${siteOptions.siteId}/push_to_remote.json"
def result = client.post(path, params)
if (result) {
println result.response.message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class ReplaceProcessorUpgradeOperation extends AbstractProcessorUpgradeOp
protected String newProcessorName;

protected List<String> deleteProperties;
protected Map<String, String> properties;

@Override
@SuppressWarnings("rawtypes,unchecked")
Expand All @@ -59,6 +60,18 @@ protected void doInit(HierarchicalConfiguration config) throws ConfigurationExce
newProcessorName = getRequiredStringProperty(config, CONFIG_KEY_NEW_PROCESSOR);

deleteProperties = config.getList(String.class, CONFIG_KEY_DELETE_PROPERTIES, Collections.emptyList());

properties = new HashMap<>();
if (config.containsKey(CONFIG_KEY_PROPERTIES)) {
HierarchicalConfiguration propertyConfig = config.configurationAt(CONFIG_KEY_PROPERTIES);
if (propertyConfig != null) {
Iterator<String> it = propertyConfig.getKeys();
while (it.hasNext()) {
String key = it.next();
properties.put(key, propertyConfig.getString(key));
}
}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
}

protected boolean matchesAllConditions(Map<String, Object> processorObj) {
Expand All @@ -81,6 +94,7 @@ protected void doExecuteInternal(Target target, Map<String, Object> targetConfig
for (Map<String, Object> processorObj : pipelineObj) {
if (matchesAllConditions(processorObj)) {
processorObj.put(PROCESSOR_NAME_CONFIG_KEY, newProcessorName);
properties.forEach(processorObj::put);
deleteProperties.forEach(processorObj::remove);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ target:
- processorName: httpMethodCallProcessor
includeFiles: [ "^/?config/studio/scripts/classes/.*$" ]
method: GET
url: ${target.studioUrl}/api/2/plugin/script/reload.json?siteId=${target.siteName}&token=${target.studioManagementToken}
url: ${target.studioUrl}/api/2/plugin/${target.siteName}/script/reload.json?token=${target.studioManagementToken}
- processorName: fileOutputProcessor
14 changes: 12 additions & 2 deletions deployer/src/main/resources/upgrade/pipelines.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved.
# Copyright (C) 2007-2026 Crafter Software Corporation. All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as published by
Expand Down Expand Up @@ -97,7 +97,7 @@ pipelines:
value: ${target.engineUrl}/api/1/site/context/rebuild.json?crafterSite=${target.siteName}&token=${target.engineManagementToken}
- property: jumpTo
value: fileOutputProcessor

# Upgrade entrypoint
- currentVersion: 2.6
nextVersion: 4.1.3-t
Expand All @@ -114,3 +114,13 @@ pipelines:
- type: replaceProcessorUpgrader
processor: authoringElasticsearchIndexingProcessor
newProcessor: authoringSearchIndexingProcessor
- currentVersion: 4.1.3.0
nextVersion: 5.0.0.0
operations:
- type: replaceProcessorUpgrader
processor: httpMethodCallProcessor
newProcessor: httpMethodCallProcessor
conditions:
- url: '.*/api/2/plugin/script/reload.json.*'
properties:
- url: ${target.studioUrl}/api/2/plugin/${target.siteName}/script/reload.json?token=${target.studioManagementToken}
Loading