-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from jenkins-infra/master
Pull in changes from the past 3-4 years
- Loading branch information
Showing
13 changed files
with
891 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: maven | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 | ||
target-branch: master | ||
reviewers: | ||
- kwhetstone | ||
- MarkEWaite | ||
labels: | ||
- dependencies | ||
ignore: | ||
# the dependency is actually provided by the Web container, hence it is aligned with Jetty. See https://github.com/jenkinsci/jenkins/pull/5211 | ||
- dependency-name: "javax.servlet:javax.servlet-api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,8 @@ | |
*.iws | ||
.* | ||
!.gitignore | ||
!.github/ | ||
secrets/ | ||
target/ | ||
work | ||
/nbactions.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,61 @@ | ||
stage "Setup" | ||
#!/usr/bin/env groovy | ||
|
||
|
||
stage "Create Plugin Folder" | ||
//pull in the plugins, save to ./plugins | ||
node { | ||
def mvntool = tool name: 'Maven 3.3.3', type: 'hudson.tasks.Maven$MavenInstallation' //system dependent | ||
def jdktool = tool name: 'Oracle JDK 8u40', type: 'hudson.model.JDK' //system dependent | ||
List customEnv = ["PATH+MVN=${mvntool}/bin", "PATH+JDK=${jdktool}/bin", "JAVA_HOME=${jdktool}/", "MAVEN_HOME=${mvntool}"] | ||
customEnv.add("MAVEN_OPTS=-Dmaven.repo.local=${pwd()}/.m2_repo") | ||
|
||
dir('pluginFolder'){ | ||
def curdir = pwd() | ||
echo curdir | ||
git changelog: false, poll: false, url:'https://github.com/jenkinsci/backend-extension-indexer.git', branch: 'master' | ||
withEnv(customEnv) { | ||
sh 'mvn clean install -DskipTests' | ||
pipeline { | ||
agent { label 'maven' } | ||
triggers { | ||
cron('H H * * 0') | ||
} | ||
sh "java -verbose:gc -jar ./target/*-bin/extension-indexer*.jar -plugins ${curdir}/plugins" | ||
stash includes: './plugins/*', name: 'plugins' | ||
deleteDir() | ||
} | ||
} | ||
|
||
node { | ||
def mvntool = tool name: 'Maven 3.3.3', type: 'hudson.tasks.Maven$MavenInstallation' //system dependent | ||
def jdktool = tool name: 'Oracle JDK 8u40', type: 'hudson.model.JDK' //systeme dependent | ||
List customEnv = ["PATH+MVN=${mvntool}/bin", "PATH+JDK=${jdktool}/bin", "JAVA_HOME=${jdktool}/", "MAVEN_HOME=${mvntool}"] | ||
customEnv.add("MAVEN_OPTS=-Dmaven.repo.local=${pwd()}/.m2_repo") | ||
|
||
stage "Generate Documentation" | ||
dir('docFolder'){ | ||
git changelog: false, poll: false, url: 'https://github.com/kwhetstone/pipeline-steps-doc-generator.git', branch: 'master' | ||
withEnv(customEnv) { | ||
sh 'mvn clean install -DskipTests' | ||
options { | ||
timestamps() | ||
} | ||
dir('pluings'){ | ||
unstash 'plugins' | ||
|
||
stages { | ||
stage('Checkout') { | ||
steps { | ||
deleteDir() | ||
checkout scm | ||
} | ||
} | ||
|
||
stage('Prepare Indexer') { | ||
steps { | ||
dir('pluginFolder') { | ||
git changelog: false, | ||
poll: false, | ||
url:'https://github.com/jenkinsci/backend-extension-indexer.git', | ||
branch: 'master' | ||
sh 'mvn -s ../settings.xml clean install -DskipTests' | ||
} | ||
} | ||
} | ||
|
||
stage('Run Indexer') { | ||
steps { | ||
dir('pluginFolder') { | ||
sh 'java -verbose:gc -jar ./target/*-bin/extension-indexer*.jar -plugins ./plugins && mv plugins ..' | ||
} | ||
} | ||
} | ||
|
||
stage('Generate Documentation') { | ||
steps { | ||
dir('docFolder') { | ||
checkout scm | ||
sh 'mvn -s ../settings.xml clean install -DskipTests' | ||
sh 'mv ../plugins . && java -verbose:gc -javaagent:./contrib/file-leak-detector.jar -jar ./target/*-bin/pipeline-steps-doc-generator*.jar' | ||
} | ||
} | ||
} | ||
|
||
stage('Clean up') { | ||
steps { | ||
dir('docFolder') { | ||
zip dir: './allAscii', glob: '', zipFile: 'allAscii.zip' | ||
zip dir: './declarative', glob: '', zipFile: 'declarative.zip' | ||
archiveArtifacts artifacts: 'allAscii.zip,declarative.zip', fingerprint: true | ||
} | ||
} | ||
} | ||
} | ||
sh 'java -verbose:gc -jar ./target/*-bin/pipeline-steps-doc-generator*.jar' | ||
} | ||
|
||
stage "Archive and Cleanup" | ||
dir('docFolder'){ | ||
zip dir: './allAscii', glob: '', zipFile: 'allAscii.zip' | ||
archive 'allAscii.zip' | ||
deleteDir() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,49 @@ | ||
# pipeline-plugin-doc-generator | ||
Creates the documentation for pipeline jobs | ||
|
||
## Development | ||
|
||
Rough outline of interactive development process: | ||
|
||
### Get repositories | ||
|
||
You will need | ||
|
||
* this repo (`jenkins-infra/pipeline-steps-doc-generator`) | ||
* `jenkins-infra/jenkins.io` | ||
* `jenkinsci/workflow-aggregator-plugin` (as an easy example) | ||
|
||
You will need to temporarily patch `jenkins.io` as follows: | ||
|
||
```diff | ||
diff --git a/scripts/fetch-external-resources b/scripts/fetch-external-resources | ||
index d3ee8319..cf8e38d2 100755 | ||
--- a/scripts/fetch-external-resources | ||
+++ b/scripts/fetch-external-resources | ||
@@ -25,12 +25,6 @@ RESOURCES = [ | ||
nil, | ||
nil | ||
], | ||
- [ | ||
- 'https://ci.jenkins.io/job/Infra/job/pipeline-steps-doc-generator/job/master/lastSuccessfulBuild/artifact/allAscii.zip', | ||
- 'content/_tmp/allAscii.zip', | ||
- nil, | ||
- 'content/doc/pipeline/steps' | ||
- ], | ||
[ | ||
'https://repo.jenkins-ci.org/api/search/versions?g=org.jenkins-ci.main&a=jenkins-core&repos=releases&v=?.*.1', | ||
'content/_data/_generated/lts_baselines.yml', | ||
``` | ||
|
||
### Create content | ||
|
||
From this repository, with others in relative positions: | ||
|
||
```bash | ||
rm -v ../jenkins.io/content/doc/pipeline/steps/*.adoc | ||
make -C ../../jenkinsci/workflow-aggregator-plugin/demo copy-plugins | ||
mvn "-Dexec.args=-classpath %classpath org.jenkinsci.pipeline_steps_doc_generator.PipelineStepExtractor -homeDir $(pwd)/../../jenkinsci/workflow-aggregator-plugin/demo -asciiDest $(pwd)/../jenkins.io/content/doc/pipeline/steps -declarativeDest /tmp/declarative" -Dexec.executable=$(which java) org.codehaus.mojo:exec-maven-plugin:3.0.0:exec | ||
make -C ../jenkins.io run | ||
``` | ||
|
||
Then browse: http://localhost:4242/doc/pipeline/steps/ |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<settings> | ||
<pluginGroups> | ||
<pluginGroup>org.jenkins-ci.tools</pluginGroup> | ||
</pluginGroups> | ||
|
||
<profiles> | ||
<!-- Give access to Jenkins plugins --> | ||
<profile> | ||
<id>jenkins</id> | ||
<activation> | ||
<activeByDefault>true</activeByDefault> <!-- change this to false, if you don't like to have it on per default --> | ||
</activation> | ||
<repositories> | ||
<repository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</repository> | ||
</repositories> | ||
<pluginRepositories> | ||
<pluginRepository> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
</pluginRepository> | ||
</pluginRepositories> | ||
</profile> | ||
</profiles> | ||
<mirrors> | ||
<mirror> | ||
<id>repo.jenkins-ci.org</id> | ||
<url>https://repo.jenkins-ci.org/public/</url> | ||
<mirrorOf>m.g.o-public</mirrorOf> | ||
</mirror> | ||
</mirrors> | ||
</settings> |
Oops, something went wrong.