mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-01-05 23:29:53 +01:00
write release descriptor to website repository during deploy
This commit is contained in:
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@@ -104,6 +104,11 @@ node('docker') {
|
||||
credentialsId: 'hub.docker.com-cesmarvin'
|
||||
])
|
||||
|
||||
mvn.useRepositoryCredentials([
|
||||
id: 'github.com/scm-manager/website',
|
||||
credentialsId: 'cesmarvin-github'
|
||||
])
|
||||
|
||||
// deploy java artifacts
|
||||
mvn.useDeploymentRepository([
|
||||
id: 'packages.scm-manager.org',
|
||||
|
||||
@@ -309,6 +309,18 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-package-yml</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scripts>
|
||||
<script>${project.basedir}/src/main/build/packageYaml.groovy</script>
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>set-repo-suffix</id>
|
||||
<phase>deploy</phase>
|
||||
|
||||
26
scm-packaging/deb/src/main/build/packageYaml.groovy
Normal file
26
scm-packaging/deb/src/main/build/packageYaml.groovy
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
def file = new File(project.build.directory, "package.yml")
|
||||
file << "type: debian\n"
|
||||
@@ -197,6 +197,18 @@
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>add-package-yml</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scripts>
|
||||
<script>${project.basedir}/src/main/build/packageYaml.groovy</script>
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
26
scm-packaging/docker/src/main/build/packageYaml.groovy
Normal file
26
scm-packaging/docker/src/main/build/packageYaml.groovy
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
def file = new File(project.build.directory, "package.yml")
|
||||
file << "type: docker\n"
|
||||
@@ -81,7 +81,7 @@
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-helm-url</id>
|
||||
<id>init-helm-environment</id>
|
||||
<phase>validate</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
@@ -94,6 +94,18 @@
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>add-package-yml</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scripts>
|
||||
<script>${project.basedir}/src/main/build/packageYaml.groovy</script>
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
26
scm-packaging/helm/src/main/build/packageYaml.groovy
Normal file
26
scm-packaging/helm/src/main/build/packageYaml.groovy
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
def file = new File(project.build.directory, "package.yml")
|
||||
file << "type: helm\n"
|
||||
@@ -55,6 +55,7 @@
|
||||
<module>rpm</module>
|
||||
<module>docker</module>
|
||||
<module>helm</module>
|
||||
<module>release-yaml</module>
|
||||
</modules>
|
||||
|
||||
</profile>
|
||||
|
||||
108
scm-packaging/release-yaml/pom.xml
Normal file
108
scm-packaging/release-yaml/pom.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>sonia.scm.packaging</groupId>
|
||||
<artifactId>scm-packaging</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>release-yaml</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<configuration>
|
||||
<skip>true</skip>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<version>3.0.3</version>
|
||||
<type>pom</type>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
<version>1.21</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>sonia.jgit</groupId>
|
||||
<artifactId>org.eclipse.jgit</artifactId>
|
||||
<version>${jgit.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-release-yml</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scripts>
|
||||
<script>${project.basedir}/src/main/build/releaseYaml.groovy</script>
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>deploy-release-yml</id>
|
||||
<phase>deploy</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scripts>
|
||||
<script>${project.basedir}/src/main/build/deploy.groovy</script>
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
65
scm-packaging/release-yaml/src/main/build/deploy.groovy
Normal file
65
scm-packaging/release-yaml/src/main/build/deploy.groovy
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
import org.eclipse.jgit.api.Git
|
||||
import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest
|
||||
import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider
|
||||
|
||||
def getCredentials() {
|
||||
def decrypter = session.lookup("org.apache.maven.settings.crypto.SettingsDecrypter")
|
||||
def server = session.settings.getServer("github.com/scm-manager/website")
|
||||
def result = decrypter.decrypt(new DefaultSettingsDecryptionRequest(server))
|
||||
return result.server
|
||||
}
|
||||
|
||||
if (project.version.contains("-SNAPSHOT")) {
|
||||
println "we do not deploy snapshot releases"
|
||||
return
|
||||
}
|
||||
|
||||
File websiteDir = new File(project.build.directory, "website")
|
||||
websiteDir.deleteDir()
|
||||
|
||||
Git git = Git.cloneRepository()
|
||||
.setURI("https://github.com/scm-manager/website.git")
|
||||
.setDirectory(websiteDir)
|
||||
.setBranch("refs/heads/master")
|
||||
.call()
|
||||
|
||||
String targetPath = "content/releases/" + project.version.replace('.', "-") + ".yml"
|
||||
|
||||
File source = new File(project.build.directory, "release.yml")
|
||||
File target = new File(websiteDir, targetPath)
|
||||
target << source.text
|
||||
|
||||
git.add().addFilepattern(targetPath).call()
|
||||
git.commit()
|
||||
.setAuthor("CES Marvin", "cesmarvin@cloudogu.com")
|
||||
.setMessage("add release descriptor for ${project.version}")
|
||||
.call()
|
||||
|
||||
def credentials = getCredentials()
|
||||
git.push()
|
||||
.setCredentialsProvider(new UsernamePasswordCredentialsProvider(credentials.username, credentials.password))
|
||||
.call()
|
||||
55
scm-packaging/release-yaml/src/main/build/releaseYaml.groovy
Normal file
55
scm-packaging/release-yaml/src/main/build/releaseYaml.groovy
Normal file
@@ -0,0 +1,55 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
import groovy.io.FileType
|
||||
import org.yaml.snakeyaml.Yaml
|
||||
import java.text.SimpleDateFormat
|
||||
|
||||
Yaml yaml = new Yaml();
|
||||
|
||||
def release = [:]
|
||||
release.tag = project.version
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'")
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("UTC"))
|
||||
release.date = sdf.format(new Date())
|
||||
release.packages = []
|
||||
|
||||
def moduleDirectory = project.basedir.getParentFile()
|
||||
moduleDirectory.eachFile FileType.DIRECTORIES, {
|
||||
def packageFile = new File(it, "target/package.yml")
|
||||
if (packageFile.exists()) {
|
||||
packageFile.withReader { r ->
|
||||
def pkg = yaml.load(r)
|
||||
release.packages.add(pkg)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def buildir = new File(project.build.directory)
|
||||
if (!buildir.exists()) {
|
||||
buildir.mkdirs()
|
||||
}
|
||||
|
||||
def file = new File(buildir, "release.yml")
|
||||
file << yaml.dump(release)
|
||||
@@ -343,6 +343,18 @@
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-package-yml</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scripts>
|
||||
<script>${project.basedir}/src/main/build/packageYaml.groovy</script>
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>set-repo-suffix</id>
|
||||
<phase>deploy</phase>
|
||||
|
||||
26
scm-packaging/rpm/src/main/build/packageYaml.groovy
Normal file
26
scm-packaging/rpm/src/main/build/packageYaml.groovy
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
def file = new File(project.build.directory, "package.yml")
|
||||
file << "type: redhat\n"
|
||||
@@ -109,6 +109,41 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<version>3.0.3</version>
|
||||
<type>pom</type>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>29.0-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-package-yml</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scripts>
|
||||
<script>${project.basedir}/src/main/build/packageYaml.groovy</script>
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
39
scm-packaging/unix/src/main/build/packageYaml.groovy
Normal file
39
scm-packaging/unix/src/main/build/packageYaml.groovy
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
import com.google.common.hash.*
|
||||
import com.google.common.io.Files
|
||||
|
||||
def packageFile = project.attachedArtifacts.find(it -> it.file.name.endsWith("tar.gz")).file
|
||||
def repository = project.version.contains("-SNAPSHOT") ? "snapshots" : "releases"
|
||||
|
||||
HashCode hashCode = Files.asByteSource(packageFile).hash(Hashing.sha256())
|
||||
def deploymentTarget = project.properties.getProperty("deployment.target")
|
||||
|
||||
def file = new File(project.build.directory, "package.yml")
|
||||
file << """
|
||||
type: unix
|
||||
checksum: ${hashCode}
|
||||
url: ${deploymentTarget}/${repository}/releases/sonia/scm/packaging/unix/${project.version}/${packageFile.name}
|
||||
"""
|
||||
@@ -99,6 +99,40 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.codehaus.gmavenplus</groupId>
|
||||
<artifactId>gmavenplus-plugin</artifactId>
|
||||
<version>1.9.0</version>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-all</artifactId>
|
||||
<version>3.0.3</version>
|
||||
<type>pom</type>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
<version>29.0-jre</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>add-package-yml</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<scripts>
|
||||
<script>${project.basedir}/src/main/build/packageYaml.groovy</script>
|
||||
</scripts>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
39
scm-packaging/windows/src/main/build/packageYaml.groovy
Normal file
39
scm-packaging/windows/src/main/build/packageYaml.groovy
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020-present Cloudogu GmbH and Contributors
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
import com.google.common.hash.*
|
||||
import com.google.common.io.Files
|
||||
|
||||
def packageFile = project.attachedArtifacts.find(it -> it.file.name.endsWith("zip")).file
|
||||
def repository = project.version.contains("-SNAPSHOT") ? "snapshots" : "releases"
|
||||
|
||||
HashCode hashCode = Files.asByteSource(packageFile).hash(Hashing.sha256())
|
||||
def deploymentTarget = project.properties.getProperty("deployment.target")
|
||||
|
||||
def file = new File(project.build.directory, "package.yml")
|
||||
file << """
|
||||
type: windows
|
||||
checksum: ${hashCode}
|
||||
url: ${deploymentTarget}/${repository}/releases/sonia/scm/packaging/unix/${project.version}/${packageFile.name}
|
||||
"""
|
||||
Reference in New Issue
Block a user