Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Добавлен deleteDir() для типа FilePath #111

Merged
merged 1 commit into from
Feb 20, 2024
Merged
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
3 changes: 3 additions & 0 deletions src/ru/pulsar/jenkins/library/IStepExecutor.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.pulsar.jenkins.library

import hudson.FilePath
import jenkins.plugins.http_request.HttpMode
import jenkins.plugins.http_request.MimeType
import jenkins.plugins.http_request.ResponseContentSupplier
Expand Down Expand Up @@ -53,6 +54,8 @@ interface IStepExecutor {

void deleteDir(String path)

void deleteDir(FilePath path)

def withEnv(List<String> strings, Closure body)

def archiveArtifacts(String path)
Expand Down
8 changes: 8 additions & 0 deletions src/ru/pulsar/jenkins/library/StepExecutor.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ru.pulsar.jenkins.library

import hudson.FilePath
import jenkins.plugins.http_request.HttpMode
import jenkins.plugins.http_request.MimeType
import jenkins.plugins.http_request.ResponseContentSupplier
Expand Down Expand Up @@ -119,6 +120,13 @@ class StepExecutor implements IStepExecutor {
}
}

@Override
void deleteDir(FilePath path) {
steps.dir(path.getRemote()) {
steps.deleteDir()
}
}

@Override
def withEnv(List<String> strings, Closure body) {
steps.withEnv(strings) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class DesignerToEdtFormatTransformation implements Serializable {
def configurationRoot = FileUtils.getFilePath("$env.WORKSPACE/$srcDir")
def edtVersionForRing = EDT.ringModule(config)

steps.deleteDir(workspaceDir.getRemote())
steps.deleteDir(workspaceDir)

Logger.println("Конвертация исходников из формата конфигуратора в формат EDT")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class EdtToDesignerFormatTransformation implements Serializable {
def configurationRoot = FileUtils.getFilePath("$env.WORKSPACE/$CONFIGURATION_DIR")
def edtVersionForRing = EDT.ringModule(config)

steps.deleteDir(workspaceDir.getRemote())
steps.deleteDir(configurationRoot.getRemote())
steps.deleteDir(workspaceDir)
steps.deleteDir(configurationRoot)

Logger.println("Конвертация исходников из формата EDT в формат Конфигуратора")

Expand Down