[ 
https://issues.apache.org/jira/browse/SOLR-10568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16086636#comment-16086636
 ] 

Steve Rowe edited comment on SOLR-10568 at 7/14/17 12:16 AM:
-------------------------------------------------------------

Yesterday the Jenkins jobs to build the ref guide stopped working, apparently 
because of version incompatibilities between the RVM (Ruby Version Manager), 
the system {{ruby}} version, and the gems used (jekyll, jekyll-asciidoc, and 
pygments.rb).  See dev list thread 
[https://lists.apache.org/thread.html/4b1e483db65dbafff682c40878057380617f7a514da902b0f6b8bb92@%3Cdev.lucene.apache.org%3E]
 for more information.

I've re-enabled the ref guide building jobs for master, branch_7x and 
branch_7_0, and all three have since succeeded.

Details follow.

I modified the shell script embedded in the Jenkins jobs' configuration that 
performs the build so versions are pinned as follows:

* RVM: the one labeled "stable"
* Ruby: 2.3.3
* jekyll gem: 3.5.0
* jekyll-asciidoc gem: 2.1.0
* pygments.rb gem: 1.1.2

The RVM documentation is not well connected, so it took me a while to figure 
out the necessary incantations - the original version of the script was 
cargo-culted from another build (see comment above: 
[https://issues.apache.org/jira/browse/SOLR-10568?focusedCommentId=15988057&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15988057]).
  Some notable changes: 

# Switch RVM's single-user install dir from {{\~/shared/.rvm/}} to {{\~/.rvm/}} 
- some stuff didn't work with a non-default install dir.
# Install RVM's "stable" version instead of the default ("master").
# Disable RVM's "autolibs" functionality; without this change, RVM will refuse 
to do a single-user install.
# Install a non-system Ruby in {{~/.rvm}}.
# Create and use an RVM "gemset", which is a combination of an RVM ruby version 
and a set of gems installed with it.
# Invoke {{gem install}} once for each gem, so that its version can be 
specified.
# Use the {{--force}} parameter with {{gem install}}, to ignore dependency 
conflicts.  Without this change, {{gem install}} fails when installing the 
{{jekyll}} gem, because {{listen's executable "listen" conflicts with 
sass-listen}}.

Here's the final script:

{noformat}
!/usr/bin/env bash
set -x                                         # Echo commands to the console
set -e                                         # Fail the script if any command 
fails

RVM_PATH=$HOME/.rvm
RUBY_VERSION=ruby-2.3.3

# Install the "stable" RVM release to ~/.rvm/, and don't mess with 
.bash_profile etc.
\curl -sSL https://get.rvm.io | bash -s -- --ignore-dotfiles stable

set +x                                         # Temporarily disable command 
echoing to reduce clutter
RVM_SCRIPT_CMD="source $RVM_PATH/scripts/rvm"  # Load RVM into a shell session 
*as a function*
echo "Running '$RVM_SCRIPT_CMD'"
$RVM_SCRIPT_CMD
RVM_AUTOLIBS_DISABLE="rvm autolibs disable"
echo "Running '$RVM_AUTOLIBS_DISABLE'"
$RVM_AUTOLIBS_DISABLE                          # Enable single-user mode
INSTALL_RUBY_CMD="rvm install $RUBY_VERSION"
echo "Running '$INSTALL_RUBY_CMD'"
$INSTALL_RUBY_CMD                              # Install Ruby 
REF_GUIDE_GEMSET=solr-refguide-gemset
CREATE_GEMSET_CMD="rvm gemset create $REF_GUIDE_GEMSET"
echo "Running '$CREATE_GEMSET_CMD'"
$CREATE_GEMSET_CMD                             # Create this project's gemset
ACTIVATE_GEMSET_CMD="rvm $RUBY_VERSION@$REF_GUIDE_GEMSET"
echo "Running '$ACTIVATE_GEMSET_CMD'"
$ACTIVATE_GEMSET_CMD                           # Activate this project's gemset

set -x
gem install --force --version 3.5.0 jekyll     # --force disables dependency 
conflict detection
gem install --force --version 2.1.0 jekyll-asciidoc
gem install --force --version 1.1.2 pygments.rb

cd solr/solr-ref-guide
ant clean build-site build-pdf
{noformat}


was (Author: steve_rowe):
Yesterday the Jenkins jobs to build the ref guide stopped working, apparently 
because of version incompatibilities between the RVM (Ruby Version Manager), 
the system {{ruby}} version, and the gems used (jekyll, jekyll-asciidoc, and 
pygments.rb).  See dev list thread 
[https://lists.apache.org/thread.html/4b1e483db65dbafff682c40878057380617f7a514da902b0f6b8bb92@%3Cdev.lucene.apache.org%3E]
 for more information.

I've re-enabled the ref guide building jobs for master, branch_7x and 
branch_7_0, and all three have since succeeded.

Details follow.

I modified the shell script embedded in the Jenkins jobs' configuration that 
performs the build so versions are pinned as follows:

* RVM: the one labeled "stable"
* Ruby: 2.3.3
* jekyll gem: 3.5.0
* jekyll-asciidoc gem: 2.1.0
* pygments.rb gem: 1.1.2

The RVM documentation is not well connected, so it took me a while to figure 
out the necessary incantations - the original version of the script was 
cargo-culted from another build (see comment above: 
[https://issues.apache.org/jira/browse/SOLR-10568?focusedCommentId=15988057&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15988057]).
  Some notable changes: 

# Switch RVM's single-user install dir from {{~/shared/.rvm/}} to {{~/.rvm/}} - 
some stuff didn't work with a non-default install dir.
# Install RVM's "stable" version instead of the default ("master").
# Disable RVM's "autolibs" functionality; without this change, RVM will refuse 
to do a single-user install.
# Install a non-system Ruby in {{~/.rvm}}.
# Create and use an RVM "gemset", which is a combination of an RVM ruby version 
and a set of gems installed with it.
# Invoke {{gem install}} once for each gem, so that its version can be 
specified.
# Use the {{--force}} parameter with {{gem install}}, to ignore dependency 
conflicts.  Without this change, {{gem install}} fails when installing the 
{{jekyll}} gem, because {{listen's executable "listen" conflicts with 
sass-listen}}.

Here's the final script:

{noformat}
!/usr/bin/env bash
set -x                                         # Echo commands to the console
set -e                                         # Fail the script if any command 
fails

RVM_PATH=$HOME/.rvm
RUBY_VERSION=ruby-2.3.3

# Install the "stable" RVM release to ~/.rvm/, and don't mess with 
.bash_profile etc.
\curl -sSL https://get.rvm.io | bash -s -- --ignore-dotfiles stable

set +x                                         # Temporarily disable command 
echoing to reduce clutter
RVM_SCRIPT_CMD="source $RVM_PATH/scripts/rvm"  # Load RVM into a shell session 
*as a function*
echo "Running '$RVM_SCRIPT_CMD'"
$RVM_SCRIPT_CMD
RVM_AUTOLIBS_DISABLE="rvm autolibs disable"
echo "Running '$RVM_AUTOLIBS_DISABLE'"
$RVM_AUTOLIBS_DISABLE                          # Enable single-user mode
INSTALL_RUBY_CMD="rvm install $RUBY_VERSION"
echo "Running '$INSTALL_RUBY_CMD'"
$INSTALL_RUBY_CMD                              # Install Ruby 
REF_GUIDE_GEMSET=solr-refguide-gemset
CREATE_GEMSET_CMD="rvm gemset create $REF_GUIDE_GEMSET"
echo "Running '$CREATE_GEMSET_CMD'"
$CREATE_GEMSET_CMD                             # Create this project's gemset
ACTIVATE_GEMSET_CMD="rvm $RUBY_VERSION@$REF_GUIDE_GEMSET"
echo "Running '$ACTIVATE_GEMSET_CMD'"
$ACTIVATE_GEMSET_CMD                           # Activate this project's gemset

set -x
gem install --force --version 3.5.0 jekyll     # --force disables dependency 
conflict detection
gem install --force --version 2.1.0 jekyll-asciidoc
gem install --force --version 1.1.2 pygments.rb

cd solr/solr-ref-guide
ant clean build-site build-pdf
{noformat}

> Automate HTML builds via Jenkins to occur with each commit
> ----------------------------------------------------------
>
>                 Key: SOLR-10568
>                 URL: https://issues.apache.org/jira/browse/SOLR-10568
>             Project: Solr
>          Issue Type: Sub-task
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: documentation
>            Reporter: Cassandra Targett
>            Assignee: Steve Rowe
>            Priority: Minor
>
> Spin-off from SOLR-10295.
> The idea is to use a mechanism (possibly gitpubsub and/or svnpubsub?) so 
> Jenkins builds of HTML format of the Ref Guide occur as soon as commits are 
> made to any non-released branch.
> This would allow any committer to see doc changes ASAP after a commit to 
> verify the presentation of the information is as expected.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to