Skip to content

Instantly share code, notes, and snippets.

@mcgivrer

mcgivrer/dep.xml Secret

Last active March 31, 2022 00:26
Show Gist options
  • Save mcgivrer/247a302c67b8542f3e67b6de831ec83c to your computer and use it in GitHub Desktop.
Save mcgivrer/247a302c67b8542f3e67b6de831ec83c to your computer and use it in GitHub Desktop.
JDK Java and Docker tools
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>bin</id>
<!-- output format for the package-->
<formats>
<format>tar.gz</format>
<format>zip</format>
</formats>
<fileSets>
<!-- Application related files to be package with -->
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
<include>NOTICE*</include>
</includes>
</fileSet>
<!-- the JAR application file -->
<fileSet>
<directory>${project.build.directory}</directory>
<outputDirectory>/bin</outputDirectory>
<includes>
<include>*-shaded.jar</include>
</includes>
</fileSet>
<!-- the future website to be package as documentation -->
<fileSet>
<directory>${project.build.directory}/site</directory>
<outputDirectory>docs</outputDirectory>
</fileSet>
<!-- the JLINk build jre to be embedded in the package -->
<fileSet>
<directory>${project.build.directory}/embeddedjdk</directory>
<outputDirectory>bin</outputDirectory>
</fileSet>
</fileSets>
<!-- Specific files needing to be parsed and adapted to project and version-->
<files>
<!-- powershell launch script -->
<file>
<outputDirectory>/</outputDirectory>
<source>src/assembly/scripts/launch.ps1</source>
<filtered>true</filtered>
</file>
<!-- bash/shell launch script -->
<file>
<outputDirectory>/</outputDirectory>
<source>src/assembly/scripts/launch.sh</source>
<filtered>true</filtered>
</file>
<!-- Windows command line launch script -->
<file>
<outputDirectory>/</outputDirectory>
<source>src/assembly/scripts/launch.bat</source>
<filtered>true</filtered>
</file>
</files>
</assembly>
title author date description url
JDK Java and Docker Tools
Frédéric Delorme
2021-11-02
Everything useful to start with java and docker

Java Development Kit

Javadoc

@see and @link

extracted from Javadoc @see or {@link}?.

The @see tag is a bit different than the @link tag, limited in some ways and more flexible in others:

Usage of see and link javadoc annotation

different JavaDoc link types Different JavaDoc link types

  1. Displays the member name for better learning, and is refactorable; the name will update when renaming by refactor
  2. Refactorable and customizable; your text is displayed instead of the member name
  3. Displays name, refactorable
  4. Refactorable, customizable
  5. A rather mediocre combination that is:
  • Refactorable, customizable, and stays in the See Also section
  • Displays nicely in the Eclipse hover
  • Displays the link tag and its formatting when generated 😞
  • When using multiple @see items, commas in the description make the output confusing
  1. Completely illegal; causes unexpected content and illegal character errors in the generator

See the results below:

JavaDoc generation results with different link types JavaDoc generation results with different link types JavaDoc generation results with different link types

Docker

Install Docker

sudo apt install docker.io
sudo usermod -aG docker ${USER}

Install Portainer

  1. Create volume:
docker volume create portainer_data
  1. run portainer-ce

on linux :

docker run -d -p 8000:8000 -p 9443:9443 --name portainer \
    --restart=always \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v portainer_data:/data \
    portainer/portainer-ce:latest

Install JetBrain TeamCity

  1. create destination dicrectories
mkdir -p /var/data/teamcity/data
mkdir -p /var/data/teamcity/logs

As the TeamCity start under user user 0, you need to chown on the just created directories:

chown -R 1000:1000 /var/data/teamcity/data
chown -R 1000:1000 /var/data/teamcity/logs
  1. start container
docker run -it --name teamcity-server-instance  \
-v /var/data/teamcity/data:/data/teamcity_server/datadir \
-v /var/data/teamcity/logs:/opt/teamcity/logs  \
-p 8090:8111 \
-u 1000:1000 \
jetbrains/teamcity-server
  1. Add TeamCity agent

first create its working dicrectory :

sudo mkdir -p /var/data/teamcity-agent1

Then adapt the user:

chown -R 1000:1000 /var/data/teamcity-agent1

And finaly start the TeamCity agent:

run -it -e SERVER_URL="http://<server-host-name>:8090/" \
-v /var/data/teamcity-agent1/data:/data/teamcity_agent/conf  \
--name="Agent-1" jetbrains/teamcity-minimal-agent" \
jetbrains/teamcity-minimal-agent

Add any number of agent your server can support but change the working directory and name for each agent.

Install Jenkins

Simply run the docker image :

docker run -p 8080:8080 -p 50000:50000 -v /var/data/jenkins:/var/jenkins_home jenkins/jenkins

Install Gitea

One more time, just a matter of Docker command to get an out-of-the-box running gitea:

sudo mkdir -p /var/lib/gitea
docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/[repo_github_username]/[repo_github_name]</url>
<snapshots><enabled>true</enabled></snapshots>
<releases><enabled>true</enabled></releases>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>github</id>
<username>[repo_github_username]</username>
<password>[repo_github_token]</password>
</server>
</servers>
</settings>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment