Compare commits
4 Commits
85d16ebfc7
...
main
Author | SHA1 | Date | |
---|---|---|---|
b2c166c806 | |||
5ec9a95d5e | |||
bb419be5f4 | |||
3edcc4e09d |
@ -9,6 +9,11 @@ COPY target/mavor.war /usr/local/tomcat/webapps/ROOT.war
|
|||||||
# create temporary directory, no need to be a volume
|
# create temporary directory, no need to be a volume
|
||||||
RUN mkdir /mavor
|
RUN mkdir /mavor
|
||||||
|
|
||||||
|
# this mvn command fails but is intended to fail
|
||||||
|
# it just initializes maven subsystem so the first
|
||||||
|
# download on the website is faster
|
||||||
|
RUN /usr/bin/mvn dependency:copy-dependencies || echo "maven init done. fail is intended"
|
||||||
|
|
||||||
# set required ENV
|
# set required ENV
|
||||||
ENV MAVOR_MAVEN_EXECUTABLE="/usr/bin/mvn"
|
ENV MAVOR_MAVEN_EXECUTABLE="/usr/bin/mvn"
|
||||||
ENV MAVOR_TEMP_DIR="/mavor"
|
ENV MAVOR_TEMP_DIR="/mavor"
|
||||||
|
21
drone.yml
21
drone.yml
@ -1,21 +0,0 @@
|
|||||||
kind: pipeline
|
|
||||||
name: default
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: maven
|
|
||||||
image: maven:3
|
|
||||||
commands:
|
|
||||||
- mvn package
|
|
||||||
- name: docker
|
|
||||||
image: plugins/docker
|
|
||||||
settings:
|
|
||||||
dockerfile: build/Dockerfile
|
|
||||||
registry: source.devloop.de
|
|
||||||
repo: source.devloop.de/damage/mavor
|
|
||||||
username:
|
|
||||||
from_secret: docker_username
|
|
||||||
password:
|
|
||||||
from_secret: docker_password
|
|
||||||
tags:
|
|
||||||
- latest
|
|
||||||
- '1'
|
|
@ -2,6 +2,7 @@ package de.devloop.mavor;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
@ -41,17 +42,30 @@ public class Configuration {
|
|||||||
developmentProperties.load(developmentPropertiesStream);
|
developmentProperties.load(developmentPropertiesStream);
|
||||||
initByProperties(developmentProperties);
|
initByProperties(developmentProperties);
|
||||||
} else {
|
} else {
|
||||||
initByProperties(System.getProperties());
|
initByMap(System.getenv());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initByMap(Map<String, String> map) {
|
||||||
|
webRoot = Objects.requireNonNull(map.get(ENV_WEB_ROOT));
|
||||||
|
mavenExecutable = Objects.requireNonNull(map.get(ENV_MAVEN_EXECUTABLE));
|
||||||
|
tempDir = Objects.requireNonNull(map.get(ENV_TEMP_DIR));
|
||||||
|
openIdClientId = Objects.requireNonNull(map.get(ENV_OPENID_CLIENT_ID));
|
||||||
|
openIdClientSecret = Objects.requireNonNull(map.get(ENV_OPENID_CLIENT_SECRET));
|
||||||
|
openIdRedirectUrl = Objects.requireNonNull(map.get(ENV_OPENID_REDIRECT_URL));
|
||||||
|
openIdAuthUrl = Objects.requireNonNull(map.get(ENV_OPENID_AUTH_URL));
|
||||||
|
openIdTokenUrl = Objects.requireNonNull(map.get(ENV_OPENID_TOKEN_URL));
|
||||||
|
openIdUserInfoUrl = Objects.requireNonNull(map.get(ENV_OPENID_USERINFO_URL));
|
||||||
|
openIdLogoutUrl = Objects.requireNonNull(map.get(ENV_OPENID_LOGOUT_URL));
|
||||||
|
}
|
||||||
|
|
||||||
private void initByProperties(Properties properties) {
|
private void initByProperties(Properties properties) {
|
||||||
webRoot = getNullSafeProperty(properties, ENV_WEB_ROOT);
|
webRoot = getNullSafeProperty(properties, ENV_WEB_ROOT);
|
||||||
mavenExecutable = getNullSafeProperty(properties, ENV_MAVEN_EXECUTABLE);
|
mavenExecutable = getNullSafeProperty(properties, ENV_MAVEN_EXECUTABLE);
|
||||||
tempDir = getNullSafeProperty(properties, ENV_TEMP_DIR);
|
tempDir = getNullSafeProperty(properties, ENV_TEMP_DIR);
|
||||||
openIdClientId = getNullSafeProperty(properties, ENV_OPENID_CLIENT_ID);
|
openIdClientId = getNullSafeProperty(properties, ENV_OPENID_CLIENT_ID);
|
||||||
openIdClientSecret = getNullSafeProperty(properties, ENV_OPENID_CLIENT_SECRET);
|
openIdClientSecret = getNullSafeProperty(properties, ENV_OPENID_CLIENT_SECRET);
|
||||||
openIdRedirectUrl = getNullSafeProperty((properties), ENV_OPENID_REDIRECT_URL);
|
openIdRedirectUrl = getNullSafeProperty(properties, ENV_OPENID_REDIRECT_URL);
|
||||||
openIdAuthUrl = getNullSafeProperty(properties, ENV_OPENID_AUTH_URL);
|
openIdAuthUrl = getNullSafeProperty(properties, ENV_OPENID_AUTH_URL);
|
||||||
openIdTokenUrl = getNullSafeProperty(properties, ENV_OPENID_TOKEN_URL);
|
openIdTokenUrl = getNullSafeProperty(properties, ENV_OPENID_TOKEN_URL);
|
||||||
openIdUserInfoUrl = getNullSafeProperty(properties, ENV_OPENID_USERINFO_URL);
|
openIdUserInfoUrl = getNullSafeProperty(properties, ENV_OPENID_USERINFO_URL);
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
<%@ taglib uri="jakarta.tags.core" prefix="c" %>
|
<%@ taglib uri="jakarta.tags.core" prefix="c" %>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
<html>
|
<html>
|
||||||
<body style="background-color:black; color:white">
|
<head>
|
||||||
Download dependencies (Link only works once!): <a href="${WEB_ROOT}/download/zip?file=${zipFilename}">${zipFilename}</a><br/>
|
<link rel="stylesheet" href="${WEB_ROOT}/style/main.css">
|
||||||
<a href="${WEB_ROOT}/logout">logout</a> | <a href="${WEB_ROOT}">back</a><br/>
|
</head>
|
||||||
Maven Output:<br/>
|
<body>
|
||||||
|
<h2>Hello ${username}</h2>
|
||||||
|
<a href="${WEB_ROOT}/logout">logout</a> | <a href="${WEB_ROOT}">back</a>
|
||||||
|
<h3>Download dependencies</h3>
|
||||||
|
(Link only works once!) <a href="${WEB_ROOT}/download/zip?file=${zipFilename}">${zipFilename}</a>
|
||||||
|
<h3>Maven Output:</h3>
|
||||||
<pre>${stdout}</pre>
|
<pre>${stdout}</pre>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,21 +1,59 @@
|
|||||||
<%@ taglib uri="jakarta.tags.core" prefix="c" %>
|
<%@ taglib uri="jakarta.tags.core" prefix="c" %>
|
||||||
<%@ page isELIgnored="false" %>
|
<%@ page isELIgnored="false" %>
|
||||||
<html>
|
<html>
|
||||||
<body style="background-color:black; color:white">
|
<head>
|
||||||
|
<link rel="stylesheet" href="${WEB_ROOT}/style/main.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
<h2>Hello ${username}</h2>
|
<h2>Hello ${username}</h2>
|
||||||
|
<a href="${WEB_ROOT}/logout">logout</a>
|
||||||
|
<h3>download dependencies of given artifact:</h3>
|
||||||
<form method="get" action="${WEB_ROOT}/download/jars">
|
<form method="get" action="${WEB_ROOT}/download/jars">
|
||||||
<input type="hidden" name="type" value="artifact"/>
|
<input type="hidden" name="type" value="artifact"/>
|
||||||
Repository: <input type="text" name="repository" value="https://source.devloop.de/api/packages/damage/maven/" /><br/>
|
<div class="row">
|
||||||
Group ID: <input type="text" name="groupId" value="org.apache.activemq"/><br/>
|
<div class="label">
|
||||||
Artifact ID: <input type="text" name="artifactId" value="artemis-core-client"/><br/>
|
<label for="repository">Repository:</label>
|
||||||
Version: <input type="text" name="version" value="2.39.0"/><br/>
|
</div>
|
||||||
<input type="submit"/>
|
<div class="input">
|
||||||
|
<input type="text" name="repository" id="repository" value="https://source.devloop.de/api/packages/damage/maven/" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="label">
|
||||||
|
<label for="groupId">Group ID:</label>
|
||||||
|
</div>
|
||||||
|
<div class="input small">
|
||||||
|
<input type="text" name="groupId" id="groupId" value="org.apache.activemq"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="label">
|
||||||
|
<label for="artifactId">Artifact ID:</label>
|
||||||
|
</div>
|
||||||
|
<div class="input small">
|
||||||
|
<input type="text" name="artifactId" id="artifactId" value="artemis-core-client"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="label">
|
||||||
|
<label for="version">Version:</label>
|
||||||
|
</div>
|
||||||
|
<div class="input small">
|
||||||
|
<input type="text" name="version" id="version" value="2.39.0"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="submit" value="download by artifact"/>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<h3>download dependencies as given in pom.xml:</h3>
|
||||||
<form method="post" action="${WEB_ROOT}/download/jars">
|
<form method="post" action="${WEB_ROOT}/download/jars">
|
||||||
<input type="hidden" name="type" value="pom"/>
|
<input type="hidden" name="type" value="pom"/>
|
||||||
POM: <textarea name="pom" cols="80" rows="20"></textarea><br/>
|
<div class="row">
|
||||||
<input type="submit"/>
|
<div class="input big">
|
||||||
|
<textarea name="pom" id="pom"></textarea><br/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<input type="submit" value="download by pom.xml"/>
|
||||||
</form>
|
</form>
|
||||||
<a href="${WEB_ROOT}/logout">logout</a>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
46
src/main/webapp/style/main.css
Normal file
46
src/main/webapp/style/main.css
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
body {
|
||||||
|
background-color: #1b1b1b;
|
||||||
|
color: #c0c0c0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea, input {
|
||||||
|
background-color: #2b2b2b;
|
||||||
|
color: #c0c0c0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.row div {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.label {
|
||||||
|
width: 75pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
width: 300pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input.small {
|
||||||
|
width: 150pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input.big {
|
||||||
|
width: 500pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input input, .input textarea {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input textarea {
|
||||||
|
height: 50em;
|
||||||
|
white-space: pre;
|
||||||
|
}
|
22
woodpecker.yml
Normal file
22
woodpecker.yml
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
when:
|
||||||
|
- event: [cron, manual]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: maven
|
||||||
|
image: maven:3
|
||||||
|
commands:
|
||||||
|
- mvn package
|
||||||
|
- name: tag
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- echo -n "$(date +%Y%m%d_%H%M%S), latest, 1" > .tags
|
||||||
|
- name: docker
|
||||||
|
image: woodpeckerci/plugin-docker-buildx:5
|
||||||
|
settings:
|
||||||
|
dockerfile: build/Dockerfile
|
||||||
|
registry: https://source.devloop.de
|
||||||
|
repo: source.devloop.de/damage/mavor
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
Reference in New Issue
Block a user