Skip to content

Commit

Permalink
Merge pull request #190 from jburel/jenkins
Browse files Browse the repository at this point in the history
Jenkins
  • Loading branch information
jburel committed Mar 4, 2022
2 parents 97d5c32 + a9f1ddc commit 09cc575
Show file tree
Hide file tree
Showing 23 changed files with 209 additions and 193 deletions.
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,17 @@ The following instructions explain how to deploy a devspace on a Docker host.
* Copy the SSH and Git configuration files used for fetching and pushing the
Git repositories under `slave/.ssh` and `slave/.gitconfig`. This is usually
your own SSH and Git configuration files.

You need to use a public key without a passphrase and a `.gitconfig` file containing
the following sections:
```
[user]
name = YOUR_NAME
email = YOUR_EMAIL
[github]
token = YOUR_GITHUB_TOKEN
user = YOUR_GITHUB_NAME
```

* Run `rename.py` to match your topic name. Specify the Git user corresponding to
the confguration files used above. If you do not yet have
topic branches available on origin, use `develop` or one of the
Expand All @@ -71,9 +81,13 @@ The following instructions explain how to deploy a devspace on a Docker host.

Start and configure:

* Build devspace using `docker-compose`:

$ docker-compose -f docker-compose.yml build

* Start devspace using `docker-compose`:

$ docker-compose up -d
$ docker-compose -f docker-compose.yml up -d

By default, this will use the name of the directory as the project name. In the case of a shared Docker host, it is possible to override the project name using

Expand All @@ -85,6 +99,10 @@ Start and configure:

$ docker-compose -p my_project port nginxjenkins 443

* Create the `maven-internal` Nexus repository:

$ docker-compose exec nexus /nexus-data/createRepoMavenInternal.sh

* [Optional] Turn on Basic HTTP authentication for Jenkins

sudo htpasswd -c jenkins/conf.d/passwdfile nginx
Expand All @@ -94,10 +112,6 @@ Start and configure:
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/conf.d/passwdfile;

* [Optional] Create the `maven-internal` Nexus repository:

$ docker-compose exec nexus /nexus-data/createRepoMavenInternal.sh


# GitHub OAuth

Expand All @@ -118,6 +132,8 @@ After the script has completed you can either leave it in place so it will overr

# Job configurations

* When running the OMERO-build job for the first time, select the ``PURGE_DATA`` option to create the database.

# Job workflow

The default deployment initializes a Jenkins server with a [predefined set of
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ services:
networks:
- omero-network
volumes:
- ./server:/home/omero
- ./server:/home/omero-server
environment:
- SLAVE_NAME=omero
- SLAVE_EXECUTORS=2
Expand All @@ -74,8 +74,8 @@ services:
networks:
- omero-network
volumes:
- ./web:/home/omero
- ./nginx/conf.d:/home/omero/nginx
- ./web:/home/omero-web
- ./nginx/conf.d:/home/omero-web/nginx
environment:
- SLAVE_NAME=web
- SLAVE_EXECUTORS=2
Expand All @@ -91,7 +91,7 @@ services:
- omero-network
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./web/static:/home/omero/static
- ./web/static:/home/omero-web/static
- ./nginx/log:/var/log/nginx
- ./nginx/sslcert:/etc/nginx/ssl
environment:
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM openmicroscopy/devslave-c7:0.6.1
FROM openmicroscopy/devslave-c7:0.7.2

MAINTAINER OME

Expand Down
6 changes: 3 additions & 3 deletions home/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<disabledAdministrativeMonitors>
<string>jenkins.security.s2m.MasterKillSwitchWarning</string>
</disabledAdministrativeMonitors>
<version>2.150.3</version>
<version>2.319.2</version>
<installStateName>RESTART</installStateName>
<numExecutors>0</numExecutors>
<mode>NORMAL</mode>
Expand All @@ -29,8 +29,8 @@
<properties>
<hudson.tools.InstallSourceProperty>
<installers>
<hudson.tools.JDKInstaller plugin="jdk-tool@1.2">
<id>jdk-8u192-oth-JPR</id>
<hudson.tools.JDKInstaller plugin="jdk-tool@1.5">
<id>jdk-8u221-oth-JPR</id>
<acceptLicense>true</acceptLicense>
</hudson.tools.JDKInstaller>
</installers>
Expand Down
4 changes: 4 additions & 0 deletions home/hudson.plugins.copyartifact.CopyArtifactConfigurat
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.1' encoding='UTF-8'?>
<hudson.plugins.copyartifact.CopyArtifactConfiguration plugin="[email protected]">
<mode>PRODUCTION</mode>
</hudson.plugins.copyartifact.CopyArtifactConfiguration>
2 changes: 1 addition & 1 deletion home/hudson.plugins.git.GitTool.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.1' encoding='UTF-8'?>
<hudson.plugins.git.GitTool_-DescriptorImpl plugin="git-client@2.7.2">
<hudson.plugins.git.GitTool_-DescriptorImpl plugin="git-client@3.11.0">
<installations class="hudson.plugins.git.GitTool-array">
<hudson.plugins.git.GitTool>
<name>Default</name>
Expand Down
4 changes: 4 additions & 0 deletions home/hudson.plugins.gradle.Gradle.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.1' encoding='UTF-8'?>
<hudson.plugins.gradle.Gradle_-DescriptorImpl plugin="[email protected]">
<installations/>
</hudson.plugins.gradle.Gradle_-DescriptorImpl>
2 changes: 1 addition & 1 deletion home/hudson.tasks.Ant.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.1' encoding='UTF-8'?>
<hudson.tasks.Ant_-DescriptorImpl plugin="ant@1.8">
<hudson.tasks.Ant_-DescriptorImpl plugin="ant@1.13">
<installations>
<hudson.tasks.Ant_-AntInstallation>
<name>Ant 1.9</name>
Expand Down
4 changes: 2 additions & 2 deletions home/jobs/BIOFORMATS-build/config.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version='1.1' encoding='UTF-8'?>
<matrix-project plugin="[email protected]">
<matrix-project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
Expand All @@ -22,7 +22,7 @@
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]">
<scm class="hudson.plugins.git.GitSCM">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
Expand Down
4 changes: 2 additions & 2 deletions home/jobs/BIOFORMATS-push/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</parameterDefinitions>
</hudson.model.ParametersDefinitionProperty>
</properties>
<scm class="hudson.plugins.git.GitSCM" plugin="[email protected]">
<scm class="hudson.plugins.git.GitSCM">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
Expand Down Expand Up @@ -123,7 +123,7 @@ foreach-get-version-as-property &gt; ${WORKSPACE}/target/version.properties</com
</builders>
<publishers>
<hudson.tasks.ArtifactArchiver>
<artifacts>target/version.tsv</artifacts>
<artifacts>target/version.tsv, target/version.properties</artifacts>
<allowEmptyArchive>false</allowEmptyArchive>
<onlyIfSuccessful>false</onlyIfSuccessful>
<fingerprint>false</fingerprint>
Expand Down
18 changes: 15 additions & 3 deletions home/jobs/OMERO-build/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,26 @@
<triggers/>
<concurrentBuild>false</concurrentBuild>
<builders>
<hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact">
<project>OMERO-python-superbuild-build</project>
<filter></filter>
<target></target>
<excludes></excludes>
<selector class="hudson.plugins.copyartifact.StatusBuildSelector"/>
<flatten>false</flatten>
<doNotFingerprintArtifacts>false</doNotFingerprintArtifacts>
</hudson.plugins.copyartifact.CopyArtifact>
<hudson.tasks.Shell>
<command>cd src
<command>
mv omero-scripts/dist/*.tar.gz .
cd src
export OMERO_BRANCH=$MERGE_PUSH_BRANCH

virtualenv $WORKSPACE/omero-virtualenv --system-site-packages

source $WORKSPACE/omero-virtualenv/bin/activate
pip install https://github.com/ome/zeroc-ice-py-centos7/releases/download/0.2.1/zeroc_ice-3.6.5-cp36-cp36m-linux_x86_64.whl
pip install -U setuptools &apos;omero-py&gt;=5.6.0.dev9&apos;
pip install -U setuptools omero-py
source docs/hudson/OMERO.sh
</command>
</hudson.tasks.Shell>
Expand Down
16 changes: 1 addition & 15 deletions home/jobs/OMERO-server/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ source $WORKSPACE/.venv3/bin/activate
pip install https://github.com/ome/zeroc-ice-py-centos7/releases/download/0.2.1/zeroc_ice-3.6.5-cp36-cp36m-linux_x86_64.whl
pip install -U pip future
pip install markdown
pip install reportlab # For figure
pip install &quot;reportlab<3.6&quot; # For figure
pip install omego
pip install tables
pip install jinja2
Expand Down Expand Up @@ -106,7 +106,6 @@ OMERO_DATA_DIR=$DATA_DIR

mkdir -p $OMERO_DATA_DIR

# UNZIP SERVER
OMERO_DIST=$WORKSPACE/OMERO.server
export OMERODIR=$OMERO_DIST

Expand All @@ -122,7 +121,6 @@ unzip $ZIP
rm -f $ZIP
mv $WORKSPACE/$DIST $OMERO_DIST

# INSTALL PYTHON PACKAGES
source $WORKSPACE/.venv3/bin/activate
pip install git+https://github.com/$SPACE_USER/omero-metadata.git@$MERGE_PUSH_BRANCH#egg=omero-metadata
pip install git+https://github.com/$SPACE_USER/omero-cli-render.git@$MERGE_PUSH_BRANCH#egg=omero-cli-render
Expand All @@ -132,12 +130,7 @@ for x in *.tar.gz; do
pip install -U $x # Install marshal, etc. *after* requirements
done

## LOAD CONFIG

# LOAD EXTRA CONFIG
#omero load configfile.omero

# DEFAULT CONFIG
omero config set omero.db.name $OMERO_DB_NAME
omero config set omero.db.host $OMERO_DB_HOST
omero config set omero.db.user $OMERO_DB_USER
Expand All @@ -147,10 +140,6 @@ omero config set omero.db.poolsize 25
omero config set omero.security.trustStore /etc/pki/ca-trust/extracted/java/cacerts
omero config set omero.security.trustStorePassword changeit
omero certificates
## END LOAD CONFIG


## PURGE

if [ &quot;$PURGE_DATA&quot; = &quot;true&quot; ]; then
createdb -h $OMERO_DB_HOST -U $OMERO_DB_USER $OMERO_DB_NAME
Expand All @@ -160,14 +149,11 @@ else
omego db -vvv upgrade --serverdir $OMERO_DIST --dbname $OMERO_DB_NAME
fi

## END PURGE

export LANG=&apos;en_US.UTF-8&apos;
export LANGUAGE=&apos;en_US:en&apos;
export LC_ALL=&apos;en_US.UTF-8&apos;
BUILD_ID=DONT_KILL_ME omero admin start

# WAIT FOR OMERO TO START UP AND ACCEPT CONNECTIONS
omero admin waitup
omero admin diagnostics

Expand Down
4 changes: 4 additions & 0 deletions home/org.jenkinsci.plugins.docker.commons.tools.DockerT
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.1' encoding='UTF-8'?>
<org.jenkinsci.plugins.docker.commons.tools.DockerTool_-DescriptorImpl plugin="[email protected]">
<installations class="org.jenkinsci.plugins.docker.commons.tools.DockerTool-array"/>
</org.jenkinsci.plugins.docker.commons.tools.DockerTool_-DescriptorImpl>
4 changes: 4 additions & 0 deletions home/org.jenkinsci.plugins.gitclient.JGitApacheTool.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version='1.1' encoding='UTF-8'?>
<org.jenkinsci.plugins.gitclient.JGitApacheTool_-DescriptorImpl plugin="[email protected]">
<installations class="hudson.plugins.git.GitTool-array"/>
</org.jenkinsci.plugins.gitclient.JGitApacheTool_-DescriptorImpl>
2 changes: 1 addition & 1 deletion home/org.jenkinsci.plugins.gitclient.JGitTool.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version='1.1' encoding='UTF-8'?>
<org.jenkinsci.plugins.gitclient.JGitTool_-DescriptorImpl plugin="git-client@2.7.2">
<org.jenkinsci.plugins.gitclient.JGitTool_-DescriptorImpl plugin="git-client@3.11.0">
<installations class="hudson.plugins.git.GitTool-array"/>
</org.jenkinsci.plugins.gitclient.JGitTool_-DescriptorImpl>
5 changes: 3 additions & 2 deletions jenkins/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
FROM jenkins/jenkins:2.150.3
FROM jenkins/jenkins:2.319.2-lts-jdk11
MAINTAINER OME

# Temp fix robot test results
ENV JAVA_OPTS "-Dhudson.model.DirectoryBrowserSupport.CSP="
ENV JAVA_OPTS "-Dhudson.model.DirectoryBrowserSupport.CSP=" -Djenkins.install.runSetupWizard=false

COPY plugins.txt /usr/share/jenkins/ref/plugins.txt

RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt

USER root
Expand Down
Loading

0 comments on commit 09cc575

Please sign in to comment.