Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge build #2035

Merged
merged 23 commits into from
Dec 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
venv
.DS_Store
*.pyc
OMERO.server*
omero-install
omeroweb-install
79 changes: 79 additions & 0 deletions autogen_omero.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
#!/usr/bin/env bash
set -e
set -u
set -x

# TODO
echo no linkcheck

# from the sub-script
export WORKSPACE=${WORKSPACE:-$(pwd)}
export USER=${USER:-$(whoami)}
export OMERODIR=${WORKSPACE}/OMERO.server

# VARIABLES #1
MESSAGE="Update auto-generated documentation"
PUSH_COMMAND="update-submodules develop --no-ask --push develop/latest/autogen"
OPEN_PR=false
export SPHINXOPTS=-W

# Responsibilities of caller, likely omero-docs-superbuild
test -e $WORKSPACE/OMERO.server
test -e $WORKSPACE/omero-install
test -e $WORKSPACE/omeroweb-install

if [ -e $WORKSPACE/venv ]; then
rm -rf $WORKSPACE/venv
fi
python3 -m venv --system-site-packages $WORKSPACE/venv || virtualenv --system-site-packages $WORKSPACE/venv
$WORKSPACE/venv/bin/pip install -r $WORKSPACE/OMERO.server/share/web/requirements-py27.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$WORKSPACE/venv/bin/pip install -r $WORKSPACE/OMERO.server/share/web/requirements-py27.txt seems strange with the decoupled work

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Happy to replace it, but requires something upstream.
see ome/omero-web#96

$WORKSPACE/venv/bin/pip install future 'ansible<2.7'
$WORKSPACE/venv/bin/pip install -U PyYAML==5.1
$WORKSPACE/venv/bin/pip install scc
set +u # PS1 issue
. $WORKSPACE/venv/bin/activate
set -u
export PATH=$WORKSPACE/OMERO.server/bin:$PATH:$HOME/.local/bin
export PYTHONPATH=$WORKSPACE/OMERO.server/lib/python

cd $WORKSPACE/ome-documentation/
omero/autogen_docs

if [[ -z $(git status -s) ]]; then
echo "No local changes"
else
git add .
if [ "$OPEN_PR" = "true" ]; then
scc $PUSH_COMMAND -m "$MESSAGE"
else
scc $PUSH_COMMAND --no-pr -m "$MESSAGE"
fi
fi

# OSX compatibility for testing
MD5SUM=md5sum
type $MD5SUM || MD5SUM=md5
SHA1SUM=sha1sum
type $SHA1SUM || SHA1SUM=shasum

cd omero
run_ant(){
ant "$@" -Dsphinx.opts="$SPHINXOPTS" -Domero.release="$OMERO_RELEASE"
}
run_ant clean html

echo "Order deny,allow
Deny from all
Allow from 134.36
Allow from 10
Satisfy Any" > _build/.htaccess
run_ant zip
for x in $WORKSPACE/ome-documentation/omero/_build/*.zip
do
base=`basename $x`
dir=`dirname $x`
pushd "$dir"
$MD5SUM "$base" >> "$base.md5"
$SHA1SUM "$base" >> "$base.sha1"
popd
done
4 changes: 4 additions & 0 deletions omero/autogen_db_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from __future__ import print_function
import glob
import os
import re
Expand Down Expand Up @@ -66,3 +67,6 @@ def get_mmp(sqlfile):
print('version_dsl_plugin = "5.5.0"')
print('version_blitz_plugin = "5.5.0"')
print('version_ice_builder = "1.5.0"')
print('version_py = "5.6.0.dev6"')
print('version_web = "5.6.0.dev6"')
print('version_dropbox = "5.6.0.dev3"')
28 changes: 15 additions & 13 deletions omero/autogen_docs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
set -u
set -e
set -x
set -o pipefail
WORKSPACE=${WORKSPACE:-$(pwd)}
USER=${USER:-$(whoami)}

Expand All @@ -19,36 +20,37 @@ cat $WORKSPACE/OMERO.server/history.rst >> newfile.rst
mv newfile.rst omero/users/history.rst

echo "Generating configuration properties page"
$WORKSPACE/OMERO.server/bin/omero config parse --rst | sed "s|$WORKSPACE|/home/omero|" > omero/sysadmins/config.rst
omero config parse --rst # Pre-run to see errors
omero config parse --rst | sed "s|$WORKSPACE|/home/omero|" > omero/sysadmins/config.rst

echo "Generating ldap setdn usage page"
mkdir -p omero/downloads/ldap
(cd $WORKSPACE/OMERO.server && bin/omero ldap setdn -h) > omero/downloads/ldap/setdn.out
(cd $WORKSPACE/OMERO.server && omero ldap setdn -h) > omero/downloads/ldap/setdn.out

echo "Generating advanced CLI help"
(cd $WORKSPACE/OMERO.server && bin/omero import --advanced-help) 2> advanced-help.txt || echo "Dumped"
(cd $WORKSPACE/OMERO.server && omero import --advanced-help) 2> advanced-help.txt || echo "Dumped"
sed 1,5d advanced-help.txt > omero/downloads/inplace/advanced-help.txt
(cd $WORKSPACE/OMERO.server && bin/omero import --javahelp) 2> java-help.txt || echo "Dumped"
(cd $WORKSPACE/OMERO.server && omero import --javahelp) 2> java-help.txt || echo "Dumped"
sed 1,5d java-help.txt > omero/downloads/cli/help.out

echo "Generating DB script example"
(cd $WORKSPACE && OMERO.server/bin/omero db script --password secretpassword 2>&1) | sed "s|$WORKSPACE|/home/omero|" > omero/downloads/cli/db-script-example.txt
(cd $WORKSPACE && omero db script --password secretpassword 2>&1) | sed "s|$WORKSPACE|/home/omero|" > omero/downloads/cli/db-script-example.txt

echo "Generating Web configuration templates"
# Nginx / WSGI
$WORKSPACE/OMERO.server/bin/omero web config nginx | sed "s|$WORKSPACE/OMERO.server|/home/omero/OMERO.py|g" > omero/sysadmins/unix/install-web/nginx-omero.conf
$WORKSPACE/OMERO.server/bin/omero web config nginx-location | sed "s|$WORKSPACE/OMERO.server|/home/omero/OMERO.py|g" | grep -v '^#' > omero/sysadmins/unix/install-web/nginx-location.conf
$WORKSPACE/OMERO.server/bin/omero web config nginx-location | sed "s|/opt/omero/web|/home/omero|g" | grep '^##' | cut -c3-
omero config set omero.web.application_server wsgi-tcp
omero web config nginx | sed "s|$WORKSPACE/OMERO.server|/home/omero/OMERO.py|g" > omero/sysadmins/unix/install-web/nginx-omero.conf
omero web config nginx-location | sed "s|$WORKSPACE/OMERO.server|/home/omero/OMERO.py|g" | grep -v '^#' > omero/sysadmins/unix/install-web/nginx-location.conf
omero web config nginx-location | sed "s|/opt/omero/web|/home/omero|g" | grep '^##' | cut -c3-
Copy link
Member

@jburel jburel Dec 5, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to self. This will have to be reviewed when we rename omero ->omero-web/omero-server

> omero/sysadmins/unix/install-web/nginx-location-manual-wrapper.conf

echo "Generating omeroweb install walkthrough"

(cd $WORKSPACE/omeroweb-install && ansible-playbook ./.travis/../ansible/omeroweb-install-doc.yml -i ./.travis/../ansible/hosts/centos7-ice3.6 --extra-vars '{"os": "centos7", "ice_version": "3.6", "clean": True}')
(cd $WORKSPACE/omeroweb-install && ansible-playbook ./.travis/../ansible/omeroweb-install-doc.yml -i ./.travis/../ansible/hosts/ubuntu-ice3.6 --extra-vars '{"os": "ubuntu", "ice_version": "3.6", "clean": True}')
(cd $WORKSPACE/omeroweb-install && ansible-playbook ./.travis/../ansible/omeroweb-install-doc.yml -i ./.travis/../ansible/hosts/osx-ice3.6 --extra-vars '{"os": "osx", "ice_version": "3.6", "clean": True}')
(cd $WORKSPACE/omeroweb-install && ansible-playbook ./.travis/../ansible/omeroweb-install-doc.yml -i ./.travis/../ansible/hosts/debian-ice3.6 --extra-vars '{"os": "debian", "ice_version": "3.6", "clean": True}')

mv $WORKSPACE/omeroweb-install/ansible/doc/* $WORKSPACE/src/omero/sysadmins/unix/install-web/walkthrough
mv $WORKSPACE/omeroweb-install/ansible/doc/* $WORKSPACE/ome-documentation/omero/sysadmins/unix/install-web/walkthrough

echo "Copying omero-install Linux scripts"
DIRECTORY=omero/sysadmins/unix/walkthrough/
Expand All @@ -64,11 +66,11 @@ rm walkthrough_*.sh

for f in \
README.md \
requirements* \
requirements\* \
settings.env \
settings-web.env \
setup_* \
omero-* \
setup_\* \
omero-\* \
; do
cp $WORKSPACE/omero-install/linux/$f $DIRECTORY
done
Expand Down