Skip to content

Commit

Permalink
Interpreter select + update build
Browse files Browse the repository at this point in the history
  • Loading branch information
qualman committed Oct 25, 2022
1 parent 1a2622f commit eb1a2d7
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 9 deletions.
88 changes: 83 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
import org.apache.tools.ant.filters.ReplaceTokens

buildscript {
repositories {
mavenLocal()
mavenCentral()
}
}
plugins {
id 'pl.allegro.tech.build.axion-release' version '1.9.3'
}

apply plugin: 'maven-publish'

defaultTasks 'clean', 'build', 'pluginZip'
task build(dependsOn: ['pluginZip']) doLast {
}

task install(dependsOn: ['build','publishToMavenLocal']) doLast {
}

task clean(type: Delete) {
delete('build')
}

ext.pluginName = 'Python Winrm Node Executor/File Copier Plugin'
ext.pluginDescription = "Connect to remote windows nodes using WINRM"
ext.sopsCopyright = "© 2017, Rundeck, Inc."
ext.sopsUrl = "http://rundeck.com"
ext.sopsCopyright = "© 2022, Pagerduty, Inc."
ext.sopsUrl = "https://pagerduty.com"
ext.buildDateString=new Date().format("yyyy-MM-dd'T'HH:mm:ssX")
ext.archivesBaseName = "py-winrm-plugin"
ext.pluginBaseFolder = "."

project.version = scmVersion.version
ext.archiveFilename = ext.archivesBaseName + '-' + version

scmVersion {
ignoreUncommittedChanges = true
Expand All @@ -33,8 +51,68 @@ scmVersion {
}
}

project.version = scmVersion.version

ext.archiveFilename = ext.archivesBaseName + '-' + version
task pluginZip(type: Jar) {
destinationDir = file("build/libs")
baseName = project.ext.archivesBaseName
version = project.version
classifier = ''
extension = 'zip'

from("${project.buildDir}/zip-contents") {
include("*.yaml")
include("resources/**")
include("contents/*")
into(archiveFilename)
}

manifest {
attributes 'Rundeck-Plugin-Name': pluginName.toString(),
'Rundeck-Plugin-Description': pluginDescription.toString(),
'Rundeck-Plugin-Archive': 'true',
'Rundeck-Plugin-File-Version': version,
'Rundeck-Plugin-Author': sopsCopyright,
'Rundeck-Plugin-URL': sopsUrl,
'Rundeck-Plugin-Date': buildDateString
}
}

apply from: 'https://raw.githubusercontent.com/rundeck-plugins/build-zip/master/build.gradle'
pluginZip.doFirst {
def assetsMap = new Properties()
def tokens = assetsMap + [
version : version,
date : new Date().format("yyyy-MM-dd'T'HH:mm:ssX").toString(),
author : sopsCopyright,
url : sopsUrl,
title : pluginName,
description: pluginDescription,
name : archivesBaseName.toString(),
]

copy {

from("${project.projectDir}/resources"){
include '**/*'
into "resources"
}

from("${project.projectDir}/contents"){
into "contents"
}

from("${project.projectDir}/plugin.yaml") {
filter(ReplaceTokens, tokens: tokens)
exclude '**/*.png'
}

into "${project.buildDir}/zip-contents"
}
}

publishing {
publications {
mavenZip(MavenPublication) {
artifact pluginZip
}
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
9 changes: 6 additions & 3 deletions plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ providers:
- name: interpreter
title: Python Interpreter
description: "Python Interpreter (Default: python)"
type: String
type: Select
values: "python,python2,python3"
default: "python"
required: true
scope: Instance
Expand Down Expand Up @@ -194,7 +195,8 @@ providers:
- name: interpreter
title: Python Interpreter
description: "Python Interpreter (Default: python)"
type: String
type: Select
values: "python,python2,python3"
default: "python"
required: true
scope: Instance
Expand Down Expand Up @@ -324,7 +326,8 @@ providers:
- name: interpreter
title: Python Interpreter
description: "Python Interpreter (Default: python)"
type: String
type: Select
values: "python,python2,python3"
default: "python"
required: true
scope: Instance
Expand Down

0 comments on commit eb1a2d7

Please sign in to comment.