Revert "Update RTD to use custom trigger url" 54/9654/1
authorThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 28 Mar 2018 16:40:52 +0000 (16:40 +0000)
committerThanh Ha <thanh.ha@linuxfoundation.org>
Wed, 28 Mar 2018 16:40:52 +0000 (16:40 +0000)
This reverts commit 12d6179c0e7c208a360a3c61c0b715b49310b39e.

Change-Id: I87a8f3b25ab977cdcfd3c23da6cebd610edaf325
Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
docs/jjb/lf-rtd-jobs.rst
jjb/lf-macros.yaml
jjb/lf-rtd-jobs.yaml
shell/rtd-trigger-build.sh

index 2b3500e..8f85f1a 100644 (file)
@@ -44,18 +44,7 @@ Job Templates
 ReadTheDocs Merge
 -----------------
 
 ReadTheDocs Merge
 -----------------
 
-Merge job which triggers a POST of the docs project to readthedocs.  There is some setup
-required on read the docs to get started with this.  After you have created the
-individual read the docs project (lets call it "PROJECT" here), then browse to
-https://readthedocs.org/dashboard/PROJECT/integrations/ and click on
-"Generic API incoming webhook".  Here you will see a custom url to trigger the job as
-well as a token.  Persist the token in the project Jenkins global-settings
-file.  You will need to put it in a username/password credentials type to make
-it available in the global-settings file.  set ```rtd-build-url to the
-custom build url as defined in read the docs.  Also set the rtd-server-id
-to the id you specified in the global-settings file, this will enable the script to parse
-the token out. Set ```rtd-project``` to your read the docs project name.
-
+Merge job which triggers a POST of the docs project to readthedocs
 
 :Template Names:
     - {project-name}-rtd-merge-{stream}
 
 :Template Names:
     - {project-name}-rtd-merge-{stream}
@@ -68,11 +57,6 @@ the token out. Set ```rtd-project``` to your read the docs project name.
     :jenkins-ssh-credential: Credential to use for SSH. (Generally set
         in defaults.yaml)
     :rtd-project: This is the name of the project on ReadTheDocs.org.
     :jenkins-ssh-credential: Credential to use for SSH. (Generally set
         in defaults.yaml)
     :rtd-project: This is the name of the project on ReadTheDocs.org.
-    :rtd-build-url: This is the generic webhook url from readthedocs.org
-    :global-settings-file: This is the location of the Jenkins global settings file.
-        This file contains the entry with the location for the readthedocs build token.
-    :rtd-server-id: This is the id of the entry in the global-settings-file.
-
 
 :Optional parameters:
 
 
 :Optional parameters:
 
index 9aa05e0..133becd 100644 (file)
     name: lf-rtd-trigger-build
     builders:
       - inject:
     name: lf-rtd-trigger-build
     builders:
       - inject:
-          properties-content: |
-            RTD_PROJECT={rtd-project}
-            RTD_BUILD_URL={rtd-build-url}
-            SETTINGS_FILE={global-settings-file}
-            SERVER_ID={rtd-server-id}
+          properties-content: RTD_PROJECT={rtd-project}
       - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
 
 - builder:
       - shell: !include-raw-escape: ../shell/rtd-trigger-build.sh
 
 - builder:
index d8d757f..20470be 100644 (file)
     ######################
     # Default parameters #
     ######################
     ######################
     # Default parameters #
     ######################
-    rtd-project: ''
-    rtd-build-url: ''
-    global-settings-file: '$WORKSPACE/settings.xml'
-    rtd-server-id: ''
-
 
     gerrit_trigger_file_paths:
       - compare-type: ANT
 
     gerrit_trigger_file_paths:
       - compare-type: ANT
@@ -93,9 +88,6 @@
     builders:
       - lf-rtd-trigger-build:
           rtd-project: '{rtd-project}'
     builders:
       - lf-rtd-trigger-build:
           rtd-project: '{rtd-project}'
-          rtd-build-url: '{rtd-build-url}'
-          global-settings-file: '{global-settings-file}'
-          rtd-server-id: '{rtd-server-id}'
 
 - job-template:
     name: '{project-name}-rtd-merge-{stream}'
 
 - job-template:
     name: '{project-name}-rtd-merge-{stream}'
index 5c47ea6..21e7269 100644 (file)
@@ -20,12 +20,4 @@ else
     RTD_BUILD_VERSION="${GERRIT_BRANCH/\//-}"
 fi
 
     RTD_BUILD_VERSION="${GERRIT_BRANCH/\//-}"
 fi
 
-CREDENTIAL=$(xmlstarlet sel -N "x=http://maven.apache.org/SETTINGS/1.0.0" \
-    -t -m "/x:settings/x:servers/x:server[x:id='${SERVER_ID}']" \
-    -v x:username -o ":" -v x:password \
-    "$SETTINGS_FILE")
-
-RTD_BUILD_TOKEN=$(echo "$CREDENTIAL" | cut -f2 -d:)
-
-curl -X POST -d "branches=$RTD_BUILD_VERSION" -d "token=$RTD_BUILD_TOKEN" "$RTD_BUILD_URL"
-
+curl -X POST --data "version_slug=$RTD_BUILD_VERSION" "https://readthedocs.org/build/$RTD_PROJECT"