Skip to content

Commit

Permalink
revert deployment changes (#228)
Browse files Browse the repository at this point in the history
* revert deployment changes

* update docker and compose for previous deployment

* minor readme update

* use package instead of install

this avoids exploding war file in tomcat but seems to be missing overlays for VIVO theme

* test docker workflow

* test deploy workflow

* add package profile for home

* skip deploy for installer

* skip installer by profile

* update workflows

* minor readme update

* use app-name for vivo log file name

* Update log4j.properties
  • Loading branch information
wwelling authored Mar 22, 2021
1 parent fdda5f0 commit 7773db3
Show file tree
Hide file tree
Showing 17 changed files with 358 additions and 167 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ jobs:
java-version: 11

- name: Maven Build
run: mvn clean install
run: mvn clean package -s installer/example-settings.xml
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
server-password: MAVEN_PASSWORD

- name: Maven Deploy
run: mvn --batch-mode deploy
run: mvn --batch-mode deploy -Pskip
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
java-version: 11

- name: Maven Build
run: mvn clean install
run: mvn clean package -s installer/example-settings.xml

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
Expand Down
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FROM tomcat:9-jdk11-openjdk

ARG SOLR_URL=http://localhost:8983/solr/vivocore
ARG VIVO_DIR=/opt/vivo/home
ARG VIVO_DIR=/usr/local/vivo/home
ARG TDB_FILE_MODE=direct

ENV SOLR_URL=${SOLR_URL}
ENV JAVA_OPTS="${JAVA_OPTS} -Dvivo-dir=$VIVO_DIR -Dtdb:fileMode=$TDB_FILE_MODE"
ENV JAVA_OPTS="${JAVA_OPTS} -Dtdb:fileMode=$TDB_FILE_MODE"

RUN mkdir /opt/vivo
RUN mkdir /opt/vivo/home
RUN mkdir /usr/local/vivo
RUN mkdir /usr/local/vivo/home

COPY ./installer/home/target/vivo /vivo-home
COPY ./installer/webapp/target/vivo.war /usr/local/tomcat/webapps/ROOT.war

COPY ./home/src/main/resources/config/default.applicationSetup.n3 /applicationSetup.n3
COPY ./home/src/main/resources/config/default.runtime.properties /runtime.properties

COPY start.sh /start.sh

EXPOSE 8080
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ RESET_CORE=false
```

- `LOCAL_VIVO_HOME`: VIVO home directory on your host machine which will mount to volume in docker container.
- `RESET_HOME`: Convinience to reset VIVO home when starting container. **Caution** will delete local configuration, content, and configuration model.
- `RESET_CORE`: Convinience to reset VIVO Solr core when starting container. **Caution** will require complete reindex.
- `RESET_HOME`: Convinience to reset VIVO home when starting container. **Caution**, will delete local configuration, content, and configuration model.
- `RESET_CORE`: Convinience to reset VIVO Solr core when starting container. **Caution**, will require complete reindex.

Build and start VIVO.

```
mvn clean install
mvn clean package -s installer/example-settings.xml
docker-compose up
```

Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
context: ./
dockerfile: Dockerfile
args:
- VIVO_DIR=/opt/vivo/home
- VIVO_DIR=/usr/local/vivo/home
- TDB_FILE_MODE=direct
- SOLR_URL=http://solr:8983/solr/vivocore
environment:
Expand All @@ -28,7 +28,7 @@ services:
ports:
- 8080:8080
volumes:
- ${LOCAL_VIVO_HOME}:/opt/vivo/home
- ${LOCAL_VIVO_HOME}:/usr/local/vivo/home
networks:
- vivo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@
# BASIC PROPERTIES
# -----------------------------------------------------------------------------

#
# This namespace will be used when generating URIs for objects created in the
# editor. In order to serve linked data, the default namespace must be composed
# as follows (optional elements in parentheses):
#
# scheme + server_name (+ port) (+ servlet_context) + "/individual/"
#
# For example, Cornell's default namespace is:
#
# http://vivo.cornell.edu/individual/
#
Vitro.defaultNamespace = http://vivo.mydomain.edu/individual/

#
# The email address of the root user for the VIVO application. The password
# for this user is initially set to "rootPassword", but you will be asked to
# change the password the first time you log in.
#
rootUser.emailAddress = [email protected]

#
# Argon2 password hashing parameters for time, memory and parallelism required to
# compute a hash.
Expand Down
21 changes: 21 additions & 0 deletions installer/example-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">

<profiles>
<profile>
<id>defaults</id>
<properties>
<app-name>vivo</app-name>

<vivo-dir>/usr/local/vivo/home</vivo-dir>
<tomcat-dir>/usr/local/tomcat</tomcat-dir>

<default-theme>wilma</default-theme>
</properties>
</profile>
</profiles>

<activeProfiles>
<activeProfile>defaults</activeProfile>
</activeProfiles>
</settings>
110 changes: 97 additions & 13 deletions installer/home/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,108 @@
<default-theme>wilma</default-theme>
</properties>

<profiles>
<profile>
<id>package</id>
<activation>
<property><name>vivo-dir</name></property>
</activation>
<build>
<finalName>${app-name}</finalName>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/home.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>install</id>
<activation>
<property><name>vivo-dir</name></property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/home.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>remove-webapp</id>
<phase>verify</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<delete dir="${vivo-dir}/rdf" />
</target>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${vivo-dir}</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}/${project.build.finalName}</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/home.xml</descriptor>
</descriptors>
<appendAssemblyId>false</appendAssemblyId>
<skip>true</skip>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Expand Down
1 change: 0 additions & 1 deletion installer/home/src/main/assembly/home.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<id>home</id>
<formats>
<format>dir</format>
<format>tar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
Expand Down
66 changes: 66 additions & 0 deletions installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
Expand Down Expand Up @@ -142,6 +148,12 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
Expand All @@ -165,6 +177,60 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<executions>
<execution>
<id>default-war</id>
<phase/>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>install</id>
<activation>
<property><name>vivo-dir</name></property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>enforce-properties</id>
<phase>validate</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireProperty>
<property>app-name</property>
<message>You must provide an application name (app-name)</message>
</requireProperty>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>skip</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand Down
Loading

0 comments on commit 7773db3

Please sign in to comment.