Add Jenkinsfile and remove the backend address.
This commit is contained in:
89
Jenkinsfile
vendored
Normal file
89
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
tools {
|
||||
maven 'Maven-3.5.0'
|
||||
jdk 'OpenJdk-1.8.0_181'
|
||||
}
|
||||
|
||||
environment {
|
||||
JAVA_HOME = '/usr/lib/jvm/java-8-openjdk-amd64'
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Configuration') {
|
||||
steps {
|
||||
script {
|
||||
env.MINAGER_VERSION = sh(script: "grep '<version>' pom.xml | head -n 1 | cut -d '>' -f 2 | cut -d '<' -f 1",
|
||||
returnStdout: true).toString().trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Angular build') {
|
||||
steps {
|
||||
dir('src/main/ts') {
|
||||
sh '''
|
||||
npm install
|
||||
ng build --configuration=production
|
||||
'''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('SpringBoot build') {
|
||||
steps {
|
||||
sh 'mvn clean package -DskipTests=true'
|
||||
}
|
||||
}
|
||||
|
||||
stage('Publish') {
|
||||
steps {
|
||||
sh 'mv target/minager*.jar target/minager.jar'
|
||||
sshPublisher(
|
||||
publishers: [
|
||||
sshPublisherDesc(
|
||||
configName: 'DebianServer [clubs]',
|
||||
transfers: [
|
||||
sshTransfer(
|
||||
cleanRemote: false,
|
||||
excludes: '',
|
||||
execCommand: '',
|
||||
execTimeout: 120000,
|
||||
flatten: false,
|
||||
makeEmptyDirs: false,
|
||||
noDefaultExcludes: false,
|
||||
patternSeparator: '[, ]+',
|
||||
remoteDirectory: '',
|
||||
remoteDirectorySDF: false,
|
||||
removePrefix: 'target/',
|
||||
sourceFiles: "**/minager-${env.MINAGER_VERSION}.jar"
|
||||
),
|
||||
sshTransfer(
|
||||
cleanRemote: false,
|
||||
excludes: '',
|
||||
execCommand: """
|
||||
sudo /home/minecraft/minager/bin/minager-jenkins.sh
|
||||
sudo service minager restart
|
||||
""",
|
||||
execTimeout: 120000,
|
||||
flatten: false,
|
||||
makeEmptyDirs: false,
|
||||
noDefaultExcludes: false,
|
||||
patternSeparator: '[, ]+',
|
||||
remoteDirectory: '',
|
||||
remoteDirectorySDF: false,
|
||||
removePrefix: '',
|
||||
sourceFiles: ''
|
||||
)
|
||||
],
|
||||
usePromotionTimestamp: false,
|
||||
useWorkspaceInPromotion: false,
|
||||
verbose: false
|
||||
)
|
||||
]
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ export class AppComponent implements OnInit {
|
||||
) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.http.get(`${environment.apiUrl}/api/version`).subscribe(pApiVersion => {
|
||||
this.http.get(`/api/version`).subscribe(pApiVersion => {
|
||||
this.apiVersion = pApiVersion;
|
||||
this.connectedToApi = true;
|
||||
this.loading = false;
|
||||
|
||||
@@ -3,12 +3,8 @@ import { HttpClient } from '@angular/common/http';
|
||||
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
import { User } from '../core/entities';
|
||||
|
||||
const LOGIN_URL = environment.apiUrl + '/api/account/login';
|
||||
|
||||
@Injectable()
|
||||
export class LoginService {
|
||||
|
||||
@@ -17,6 +13,6 @@ export class LoginService {
|
||||
) {}
|
||||
|
||||
login(user: User): Observable<User> {
|
||||
return this.http.post<User>(LOGIN_URL, user);
|
||||
return this.http.post<User>('/api/account/login', user);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { environment } from '../../environments/environment';
|
||||
|
||||
const SERVER_URL = environment.apiUrl + '/api/server';
|
||||
const SERVER_URL = '/api/server';
|
||||
|
||||
@Injectable()
|
||||
export class ServerService {
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiUrl: 'http://176.188.217.1:54447',
|
||||
appVersion: '1.0.1',
|
||||
title: 'INTÉGRATION'
|
||||
};
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
export const environment = {
|
||||
production: true,
|
||||
apiUrl: 'https://176.188.217.1:54446',
|
||||
appVersion: '1.0.1',
|
||||
title: ''
|
||||
};
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiUrl: 'http://localhost:8080',
|
||||
appVersion: '1.0.1',
|
||||
title: 'LOCAL'
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user