Skip to content

Commit

Permalink
Fixes #201 - Separate web UI and Git HTTP functionality in separate w…
Browse files Browse the repository at this point in the history
…eb applications (#202)
  • Loading branch information
mnriem authored Jul 3, 2024
1 parent 24f648d commit 3b88386
Show file tree
Hide file tree
Showing 109 changed files with 4,905 additions and 123 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to GHCR
run: mvn --ntp -P docker install docker:build docker:push
run: |
cd repo
mvn --ntp -P docker install docker:build docker:push
cd ../ui
mvn --ntp -P docker install docker:build docker:push
6 changes: 5 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to GHCR
run: mvn --ntp -P docker install docker:build docker:push
run: |
cd repo
mvn --ntp -P docker install docker:build docker:push
cd ../ui
mvn --ntp -P docker install docker:build docker:push
128 changes: 7 additions & 121 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,130 +7,16 @@
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.manorrock.aegean</groupId>
<artifactId>aegean</artifactId>
<artifactId>project</artifactId>
<version>23.8.0-SNAPSHOT</version>
<packaging>war</packaging>
<name>Manorrock Aegean</name>
<packaging>pom</packaging>
<name>Manorrock Aegean - Project</name>
<organization>
<name>Manorrock.com</name>
<url>http://www.manorrock.com</url>
</organization>
<properties>
<cdi.version>2.0.2</cdi.version>
<docker-maven-plugin.version>0.42.1</docker-maven-plugin.version>
<jgit.version>6.5.0.202303070854-r</jgit.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
<mojarra.version>2.3.18</mojarra.version>
<weld.version>3.1.9.Final</weld.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<servlet.version>4.0.4</servlet.version>
<!-- other -->
<java.version>21</java.version>
</properties>
<build>
<finalName>aegean</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- see https://git.eclipse.org/r/plugins/gitiles/jgit/jgit -->
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.http.server</artifactId>
<version>${jgit.version}</version>
<scope>compile</scope>
</dependency>
<!-- see https://github.com/jakartaee/servlet -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet.version}</version>
<scope>provided</scope>
</dependency>
<!-- see https://github.com/jakartaee/cdi -->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>${cdi.version}</version>
<scope>provided</scope>
</dependency>
<!-- see https://github.com/weld -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-shaded</artifactId>
<version>${weld.version}</version>
<scope>runtime</scope>
</dependency>
<!-- see https://github.com/eclipse-ee4j/mojarra -->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.faces</artifactId>
<version>${mojarra.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>docker</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
<configuration>
<images>
<image>
<alias>aegean</alias>
<name>ghcr.io/manorrock/aegean:%l</name>
<build>
<buildx>
<platforms>
<platform>linux/amd64</platform>
<platform>linux/arm64/v8</platform>
</platforms>
</buildx>
<contextDir>${basedir}</contextDir>
<dockerFile>src/main/docker/Dockerfile</dockerFile>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build</id>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>push</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<modules>
<module>repo</module>
<module>ui</module>
</modules>
</project>
139 changes: 139 additions & 0 deletions repo/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.manorrock.aegean</groupId>
<artifactId>project</artifactId>
<version>23.8.0-SNAPSHOT</version>
</parent>
<artifactId>aegean</artifactId>
<packaging>war</packaging>
<name>Manorrock Aegean</name>
<organization>
<name>Manorrock.com</name>
<url>http://www.manorrock.com</url>
</organization>
<properties>
<cdi.version>2.0.2</cdi.version>
<docker-maven-plugin.version>0.42.1</docker-maven-plugin.version>
<jgit.version>6.5.0.202303070854-r</jgit.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<maven-war-plugin.version>3.3.2</maven-war-plugin.version>
<mojarra.version>2.3.18</mojarra.version>
<weld.version>3.1.9.Final</weld.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<servlet.version>4.0.4</servlet.version>
<!-- other -->
<java.version>21</java.version>
</properties>
<build>
<finalName>aegean</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${maven-war-plugin.version}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<!-- see https://git.eclipse.org/r/plugins/gitiles/jgit/jgit -->
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit.http.server</artifactId>
<version>${jgit.version}</version>
<scope>compile</scope>
</dependency>
<!-- see https://github.com/jakartaee/servlet -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet.version}</version>
<scope>provided</scope>
</dependency>
<!-- see https://github.com/jakartaee/cdi -->
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
<version>${cdi.version}</version>
<scope>provided</scope>
</dependency>
<!-- see https://github.com/weld -->
<dependency>
<groupId>org.jboss.weld.servlet</groupId>
<artifactId>weld-servlet-shaded</artifactId>
<version>${weld.version}</version>
<scope>runtime</scope>
</dependency>
<!-- see https://github.com/eclipse-ee4j/mojarra -->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>jakarta.faces</artifactId>
<version>${mojarra.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>docker</id>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>${docker-maven-plugin.version}</version>
<configuration>
<images>
<image>
<alias>aegean</alias>
<name>ghcr.io/manorrock/aegean:%l</name>
<build>
<buildx>
<platforms>
<platform>linux/amd64</platform>
<platform>linux/arm64/v8</platform>
</platforms>
</buildx>
<contextDir>${basedir}</contextDir>
<dockerFile>src/main/docker/Dockerfile</dockerFile>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<id>build</id>
<phase>install</phase>
<goals>
<goal>build</goal>
</goals>
</execution>
<execution>
<id>push</id>
<phase>deploy</phase>
<goals>
<goal>push</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
File renamed without changes.
91 changes: 91 additions & 0 deletions repo/src/main/java/com/manorrock/aegean/Application.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/*
* Copyright (c) 2002-2024, Manorrock.com. All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
package com.manorrock.aegean;

import java.io.File;
import static java.util.logging.Level.INFO;
import java.util.logging.Logger;
import javax.annotation.PostConstruct;
import javax.enterprise.context.ApplicationScoped;

/**
* The one and only application bean.
*
* @author Manfred Riem ([email protected])
*/
@ApplicationScoped
public class Application {

/**
* Stores the logger.
*/
private static final Logger LOGGER = Logger.getLogger(Application.class.getName());

/**
* Stores the repositories directory.
*/
private File repositoriesDirectory;

/**
* Initialize.
*/
@PostConstruct
public void initialize() {
String rootDirectoryFilename = System.getenv("ROOT_DIRECTORY");
if (rootDirectoryFilename == null) {
rootDirectoryFilename = System.getProperty("ROOT_DIRECTORY",
System.getProperty("user.home") + "/.manorrock/aegean");
}

if (LOGGER.isLoggable(INFO)) {
LOGGER.log(INFO, "Base directory: {0}", rootDirectoryFilename);
}

repositoriesDirectory = new File(rootDirectoryFilename, "repositories");

if (!repositoriesDirectory.exists()) {
repositoriesDirectory.mkdirs();
}
}

/**
* Get the repositories directory.
*
* @return the repositories directory.
*/
public File getRepositoriesDirectory() {
return repositoriesDirectory;
}

/**
* Set the repositories directory.
*
* @param repositoriesDirectory the repositories directory.
*/
public void setRepositoriesDirectory(File repositoriesDirectory) {
this.repositoriesDirectory = repositoriesDirectory;
}
}
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3b88386

Please sign in to comment.