diff --git a/dactyl-config.yml b/dactyl-config.yml index 1def2f899a..4d733ac9b1 100644 --- a/dactyl-config.yml +++ b/dactyl-config.yml @@ -42,12 +42,12 @@ targets: display_name: Ripple Developer Portal # These github_ fields are used by the template's "Edit on GitHub" link. # Override them with --vars to change which fork/branch to edit. - github_fork: ripple + github_forkurl: https://github.com/ripple/ripple-dev-portal/ github_branch: master - name: ripple.com display_name: Ripple Developer Center - github_fork: ripple + github_forkurl: https://github.com/ripple/ripple-dev-portal/ github_branch: master template: template-contentwithtoc.html link_subs: diff --git a/tool/all-target-link-checker.sh b/tool/all-target-link-checker.sh index 055e3e783e..5b1e03eda8 100755 --- a/tool/all-target-link-checker.sh +++ b/tool/all-target-link-checker.sh @@ -1,7 +1,11 @@ #!/bin/bash mkdir -p out -## One-liner syntax doesn't handle exit codes properly... -#./build.sh -lq | awk '{print "rm -r out/ && ./build.sh -t "$1" && ./check-links.sh"}' | xargs -0 bash -c + +# Pass forward extra dactyl args if provided +if [ -n "$1" ]; +then + dactyl_args=$1 +fi targets=`dactyl_build -lq | awk '{print $1}'` linkerrors=0 @@ -11,7 +15,7 @@ while read -r line; do echo "=======================================" echo "Checking Target: $line" rm -r out - dactyl_build -sq -t "$line" + dactyl_build -sq -t "$line" "$dactyl_args" buildresult=$? if [ $buildresult -eq 0 ] then diff --git a/tool/jenkins.sh b/tool/jenkins.sh index b72a6b4571..cadd449d74 100755 --- a/tool/jenkins.sh +++ b/tool/jenkins.sh @@ -7,7 +7,16 @@ echo "ghprbAuthorRepoGitUrl is: " ${ghprbAuthorRepoGitUrl} echo "ghprbSourceBranch is: " ${ghprbSourceBranch} echo "ghprbPullId is: " ${ghprbPullId} +gitForkWithoutSuffix=${ghprbAuthorRepoGitUrl%.git} + +if [ -n "$ghprbPullId" ]; +then + dactyl_vars='--vars '"'"'{"github_forkurl": "'"$gitForkWithoutSuffix"'", "github_branch": "'"$ghprbSourceBranch"'", "github_pr_id": "'"$ghprbPullId"'"}'"'" +else + dactyl_vars="" +fi + set -e tool/conflictmarkers.sh -tool/all-target-link-checker.sh +tool/all-target-link-checker.sh "$dactyl_vars" diff --git a/tool/template-base.html b/tool/template-base.html index 941010c0dc..15bd8a1c5d 100644 --- a/tool/template-base.html +++ b/tool/template-base.html @@ -55,15 +55,19 @@
DRAFT PAGE
{% if currentpage.md is defined %} - {% set githuburl = "https://github.com/" - + target.github_fork + "/ripple-dev-portal/edit/" - + target.github_branch + "/content/" + currentpage.md %} + {% set githuburl = target.github_forkurl + "/edit/" + + target.github_branch + + "/content/" + currentpage.md %} + {% endif %} {% elif currentpage.template is defined %} - {% set githuburl = "https://github.com/" - + target.github_fork + "/ripple-dev-portal/edit/" + {% set githuburl = target.github_forkurl + "/edit/" + target.github_branch + "/tool/" + currentpage.template %} {% else %} - {% set githuburl = "https://github.com/ripple/ripple-dev-portal/" %} + {% set githuburl = target.github_forkurl %} + {% endif %} + {% if target.is_pr_build %} + {% set githuburl = githuburl + "?pr=/ripple/ripple-dev-portal/pull/" + + target.github_pr_id %} {% endif %} Edit on GitHub