Skip to content

Commit

Permalink
Fix the referenced host and un-couple from Tomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
whikloj committed Dec 6, 2021
1 parent ff097e0 commit a741462
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion alpaca.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---

- hosts: karaf
- hosts: alpaca
become: yes

roles:
Expand Down
4 changes: 2 additions & 2 deletions roles/internal/Islandora-Devops.alpaca/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ alpaca_version: main
alpaca_clone_directory: /opt/alpaca
alpaca_jar_path: "{{ alpaca_clone_directory }}/islandora-alpaca-app/build/libs/islandora-alpaca-app-2.0.0-all.jar"

alpaca_user: tomcat
alpaca_group: tomcat
alpaca_user: vagrant
alpaca_group: vagrant

alpaca_log_level: INFO

Expand Down
10 changes: 10 additions & 0 deletions roles/internal/Islandora-Devops.alpaca/tasks/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
version: "{{ alpaca_version }}"
register: alpaca_git

- name: Change directory permissions
file:
path: "{{ alpaca_clone_directory }}"
state: directory
owner: "{{ alpaca_user }}"
group: "{{ alpaca_group }}"
recurse: yes

- name: Install Alpaca via Gradle
become: yes
become_user: "{{ alpaca_user }}"
command: ./gradlew build shadowJar
args:
chdir: "{{ alpaca_clone_directory }}"
Expand Down
12 changes: 7 additions & 5 deletions roles/internal/Islandora-Devops.alpaca/templates/startup.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/bin/sh

if [ -f "/usr/libexec/tomcat9/tomcat-locate-java.sh" ]; then
. /usr/libexec/tomcat9/tomcat-locate-java.sh
fi
if [ -z "$JAVA_HOME" ]; then
echo "Cannot locate JAVA, please define JAVA_HOME."
exit 1
if [ -d "/usr/lib/jvm/java-11-openjdk-amd64" ]; then
# Make a guess because this is only for Ubuntu
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
else
echo "Cannot locate JAVA, please define JAVA_HOME."
exit 1
fi
fi
# Source the config file.
. ${ALPACA_HOME}/${ALPACA_CONFIG}
Expand Down

0 comments on commit a741462

Please sign in to comment.