Gradle setup #2
No files matched your search
Vendored
-84
@@ -1,84 +0,0 @@
|
|||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
|
|
||||||
stages {
|
|
||||||
stage('Configuration') {
|
|
||||||
steps {
|
|
||||||
dir('codiki-properties') {
|
|
||||||
git url:'https://gitea.takiguchi.ovh/Codiki/codiki-properties.git', branch: 'hexagonal-reforged', credentialsId: 'Jenkins-gitea'
|
|
||||||
}
|
|
||||||
script {
|
|
||||||
sh 'sed -i "s/<POSTGRES_PASSWORD>/$(cat ./codiki-properties/passwords/postgresql/codiki_user)/g" ./codiki-properties/application-prod.yml'
|
|
||||||
sh 'cp ./codiki-properties/application-prod.yml ./backend/codiki-launcher/src/main/resources/application-prod.yml'
|
|
||||||
sh 'sed -i "s/<POSTGRES_PASSWORD>/$(cat ./codiki-properties/passwords/postgresql/codiki_admin)/g" ./docker-compose.yml'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Build') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
sh """
|
|
||||||
sudo /usr/bin/docker build -t codiki-backend -f ./Dockerfile-backend . --no-cache
|
|
||||||
sudo /usr/bin/docker build -t codiki-frontend -f ./Dockerfile-frontend . --no-cache
|
|
||||||
sudo /usr/bin/docker save codiki-backend:latest -o ./codiki-backend.tar
|
|
||||||
sudo /usr/bin/docker save codiki-frontend:latest -o ./codiki-frontend.tar
|
|
||||||
sudo chown jenkins:jenkins ./codiki-backend.tar
|
|
||||||
sudo chown jenkins:jenkins ./codiki-frontend.tar
|
|
||||||
chmod 644 ./codiki-backend.tar
|
|
||||||
chmod 644 ./codiki-frontend.tar
|
|
||||||
"""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Deploy') {
|
|
||||||
steps {
|
|
||||||
sshPublisher(
|
|
||||||
publishers: [
|
|
||||||
sshPublisherDesc(
|
|
||||||
configName: 'DebianServer [codiki]',
|
|
||||||
transfers: [
|
|
||||||
sshTransfer(
|
|
||||||
cleanRemote: false,
|
|
||||||
excludes: '',
|
|
||||||
execCommand: '',
|
|
||||||
execTimeout: 120000,
|
|
||||||
flatten: false,
|
|
||||||
makeEmptyDirs: false,
|
|
||||||
noDefaultExcludes: false,
|
|
||||||
patternSeparator: '[, ]+',
|
|
||||||
remoteDirectory: '',
|
|
||||||
remoteDirectorySDF: false,
|
|
||||||
removePrefix: '',
|
|
||||||
sourceFiles: 'codiki-backend.tar,codiki-frontend.tar,docker-compose.yml'
|
|
||||||
),
|
|
||||||
sshTransfer(
|
|
||||||
cleanRemote: false,
|
|
||||||
excludes: '',
|
|
||||||
execCommand: """
|
|
||||||
cd /opt/codiki
|
|
||||||
sudo /usr/bin/docker load < /opt/codiki/codiki-backend.tar
|
|
||||||
sudo /usr/bin/docker load < /opt/codiki/codiki-frontend.tar
|
|
||||||
sudo /usr/bin/docker compose down
|
|
||||||
sudo /usr/bin/docker compose up --detach
|
|
||||||
""",
|
|
||||||
execTimeout: 120000,
|
|
||||||
flatten: false,
|
|
||||||
makeEmptyDirs: false,
|
|
||||||
noDefaultExcludes: false,
|
|
||||||
patternSeparator: '[, ]+',
|
|
||||||
remoteDirectory: '',
|
|
||||||
remoteDirectorySDF: false,
|
|
||||||
removePrefix: '',
|
|
||||||
sourceFiles: ''
|
|
||||||
)
|
|
||||||
],
|
|
||||||
usePromotionTimestamp: false,
|
|
||||||
useWorkspaceInPromotion: false,
|
|
||||||
verbose: true
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -32,6 +32,8 @@ subprojects {
|
|||||||
testImplementation("org.assertj:assertj-core:3.27.4")
|
testImplementation("org.assertj:assertj-core:3.27.4")
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-api")
|
testImplementation("org.junit.jupiter:junit-jupiter-api")
|
||||||
testImplementation("org.junit.jupiter:junit-jupiter-params")
|
testImplementation("org.junit.jupiter:junit-jupiter-params")
|
||||||
|
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
||||||
|
testImplementation("org.junit.platform:junit-platform-launcher")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType<Test> {
|
tasks.withType<Test> {
|
||||||
|
|||||||
-3
@@ -27,7 +27,4 @@ class KeyGeneratorTest {
|
|||||||
assertThat(validationRegex.matcher(result).matches()).isTrue();
|
assertThat(validationRegex.matcher(result).matches()).isTrue();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Whitespace-only changes.
+1
-1
@@ -29,7 +29,7 @@ public class SecurityConfiguration {
|
|||||||
public SecurityFilterChain securityFilterChain(
|
public SecurityFilterChain securityFilterChain(
|
||||||
HttpSecurity httpSecurity,
|
HttpSecurity httpSecurity,
|
||||||
JwtAuthenticationFilter jwtAuthenticationFilter
|
JwtAuthenticationFilter jwtAuthenticationFilter
|
||||||
) {
|
) throws Exception {
|
||||||
httpSecurity
|
httpSecurity
|
||||||
.csrf(AbstractHttpConfigurer::disable)
|
.csrf(AbstractHttpConfigurer::disable)
|
||||||
.httpBasic(Customizer.withDefaults())
|
.httpBasic(Customizer.withDefaults())
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id("io.spring.dependency-management") version "1.1.7"
|
id("io.spring.dependency-management") version "1.1.7"
|
||||||
// kotlin("plugin.jpa") version "2.1.20"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// implementation(kotlin("stdlib"))
|
|
||||||
implementation(project(":codiki-application"))
|
implementation(project(":codiki-application"))
|
||||||
implementation(project(":codiki-domain"))
|
implementation(project(":codiki-domain"))
|
||||||
implementation("org.springframework:spring-context")
|
implementation("org.springframework:spring-context")
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package org.codiki.infrastructure.configuration;
|
package org.codiki.infrastructure.configuration;
|
||||||
|
|
||||||
import org.springframework.boot.persistence.autoconfigure.EntityScan;
|
import org.springframework.boot.autoconfigure.domain.EntityScan;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
application:
|
||||||
|
security:
|
||||||
|
jwt:
|
||||||
|
secretKey: "secret-key"
|
||||||
|
expirationDelayInMinutes: 30
|
||||||
|
refreshToken:
|
||||||
|
expirationDelayInDays: 7
|
||||||
|
pictures:
|
||||||
|
path: /opt/codiki/pictures/
|
||||||
|
temp-path: /opt/codiki/pictures/temp/
|
||||||
|
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
org.springframework.security: DEBUG
|
||||||
|
|
||||||
|
server:
|
||||||
|
http2:
|
||||||
|
enabled: true
|
||||||
|
error:
|
||||||
|
whitelabel:
|
||||||
|
enabled: false # Disable html error responses.
|
||||||
|
include-stacktrace: never
|
||||||
|
|
||||||
|
spring:
|
||||||
|
datasource:
|
||||||
|
driverClassName: org.postgresql.Driver
|
||||||
|
url: jdbc:postgresql://codiki-database:5432/codiki_db
|
||||||
|
username: codiki_user
|
||||||
|
password: password
|
||||||
|
servlet:
|
||||||
|
multipart:
|
||||||
|
max-file-size: 150MB
|
||||||
|
max-request-size: 151MB
|
||||||
@@ -3,7 +3,7 @@ version: '3.9'
|
|||||||
services:
|
services:
|
||||||
codiki-database:
|
codiki-database:
|
||||||
container_name: "codiki-database"
|
container_name: "codiki-database"
|
||||||
image: "postgres:17"
|
image: "postgres:16"
|
||||||
ports:
|
ports:
|
||||||
- "50001:5432"
|
- "50001:5432"
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
BIN
Binary file not shown.
@@ -0,0 +1,7 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.0-bin.zip
|
||||||
|
networkTimeout=10000
|
||||||
|
validateDistributionUrl=true
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
Vendored
-3
@@ -114,7 +114,6 @@ case "$( uname )" in #(
|
|||||||
NONSTOP* ) nonstop=true ;;
|
NONSTOP* ) nonstop=true ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH="\\\"\\\""
|
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
@@ -172,7 +171,6 @@ fi
|
|||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
if "$cygwin" || "$msys" ; then
|
if "$cygwin" || "$msys" ; then
|
||||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
|
||||||
|
|
||||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
@@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
|||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
-classpath "$CLASSPATH" \
|
|
||||||
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
|
||||||
"$@"
|
"$@"
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-2
@@ -70,11 +70,10 @@ goto fail
|
|||||||
:execute
|
:execute
|
||||||
@rem Setup the command line
|
@rem Setup the command line
|
||||||
|
|
||||||
set CLASSPATH=
|
|
||||||
|
|
||||||
|
|
||||||
@rem Execute Gradle
|
@rem Execute Gradle
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||||
|
|
||||||
:end
|
:end
|
||||||
@rem End local scope for the variables with windows NT shell
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
|||||||
Whitespace-only changes.
@@ -20,7 +20,7 @@ http {
|
|||||||
server_name codiki.org;
|
server_name codiki.org;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
|
|
||||||
# Fallback to default language if no preference defined by browser
|
# Fallback to default language if no preference defined by browser
|
||||||
if ($accept_language ~ "^$") {
|
if ($accept_language ~ "^$") {
|
||||||
set $accept_language "fr";
|
set $accept_language "fr";
|
||||||
}
|
}
|
||||||
@@ -44,11 +44,11 @@ http {
|
|||||||
}
|
}
|
||||||
|
|
||||||
location ~ ^/api {
|
location ~ ^/api {
|
||||||
proxy_pass http://192.168.1.154:50011;
|
proxy_pass http://codiki-backend:8080;
|
||||||
proxy_set_header Host $host:$server_port;
|
proxy_set_header Host $host:$server_port;
|
||||||
proxy_set_header X-Forwarded-Host $server_name;
|
proxy_set_header X-Forwarded-Host $server_name;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user