Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// https://github.com/CookieFactoryInSpring/demo-module-maven/blob/demo-jenkins/Jenkinsfile
// https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html

pipeline {
agent any
environment {
REPO_USER = credentials('artifactory-user-id')
REPO_USER_PWD = credentials('artifactory-apikey-id')
}
stages {
stage ('Initialize') {
steps {
sh '''
echo "PATH = ${PATH}"
echo "M2_HOME = ${M2_HOME}"
cp assets/settings.xml ${M2_HOME}/
ls -lah ${M2_HOME}
java -version
mvn -version
'''
}
}
stage('Verify') {
steps {
sh "cd backend && mvn clean verify"
}
}
stage('Build all') {
steps {
sh "cd backend && mvn -Drepo.id=snapshots clean deploy"
}
}
}
}
17 changes: 17 additions & 0 deletions agent/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM jenkins/agent:latest-jdk17

ENV PATH="$PATH:/home/jenkins/.local/bin"
ENV M2_HOME="/home/jenkins/.m2"

RUN mkdir -p ~/.local/bin \
&& mkdir -p ~/.m2 \
# Maven
&& curl -L https://dlcdn.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz --output maven.tgz \
&& tar xzvf maven.tgz \
&& mv apache-maven-*/* ~/.local/ \
&& rm -rf apache-maven-*/ maven.tgz \
# Docker
&& curl -L https://download.docker.com/linux/static/stable/x86_64/docker-23.0.0.tgz --output docker.tgz \
&& tar xzvf docker.tgz \
&& mv docker/* ~/.local/bin/ \
&& rm -rf docker/ docker.tgz
4 changes: 4 additions & 0 deletions agent/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

docker build -t nrousseau/jenkins-agent-allinone:4.0 .
docker push nrousseau/jenkins-agent-allinone:4.0
56 changes: 56 additions & 0 deletions assets/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd" xmlns="http://maven.apache.org/SETTINGS/1.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<servers>
<server>
<username>admin</username>
<password>4UHq2vpt78vKiqa_</password>
<id>central</id>
</server>
<server>
<username>admin</username>
<password>4UHq2vpt78vKiqa_</password>
<id>snapshots</id>
</server>
</servers>
<profiles>
<profile>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>tcf-libs-release</name>
<url>http://vmpx17.polytech.unice.fr:8081/artifactory/tcf-libs-release</url>
</repository>
<repository>
<snapshots />
<id>snapshots</id>
<name>tcf-libs-snapshot</name>
<url>http://vmpx17.polytech.unice.fr:8081/artifactory/tcf-libs-snapshot</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>tcf-libs-release</name>
<url>http://vmpx17.polytech.unice.fr:8081/artifactory/tcf-libs-release</url>
</pluginRepository>
<pluginRepository>
<snapshots />
<id>snapshots</id>
<name>tcf-libs-snapshot</name>
<url>http://vmpx17.polytech.unice.fr:8081/artifactory/tcf-libs-snapshot</url>
</pluginRepository>
</pluginRepositories>
<id>artifactory</id>
</profile>
</profiles>
<activeProfiles>
<activeProfile>artifactory</activeProfile>
</activeProfiles>
</settings>
8 changes: 8 additions & 0 deletions backend/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,12 @@
</plugins>
</build>

<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<name>0375b9d96ca0-snapshots</name>
<url>http://vmpx17.polytech.unice.fr:8081/artifactory/tcf-libs-snapshot-local</url>
</snapshotRepository>
</distributionManagement>

</project>