test 2
This commit is contained in:
parent
086f47cab0
commit
013dc5572b
65
Jenkinsfile
vendored
65
Jenkinsfile
vendored
@ -50,32 +50,32 @@ pipeline {
|
|||||||
def remote = [
|
def remote = [
|
||||||
name : 'HostServer',
|
name : 'HostServer',
|
||||||
host : '192.168.0.216',
|
host : '192.168.0.216',
|
||||||
user : '$JOBLINK_LOCAL_USER',
|
user : '${env.JOBLINK_LOCAL_USER}',
|
||||||
password : '$JOBLINK_LOCAL_PASSWD',
|
password : '${env.JOBLINK_LOCAL_PASSWD}',
|
||||||
allowAnyHosts: true,
|
allowAnyHosts: true,
|
||||||
]
|
]
|
||||||
if (env.BRANCH_NAME == 'main') {
|
if (env.BRANCH_NAME == 'main') {
|
||||||
sshRemove(path: '/home/$JOBLINK_LOCAL_USER/builds/main/linux', remote: remote)
|
sshRemove(path: '/home/${env.JOBLINK_LOCAL_USER}/builds/main/linux', remote: remote)
|
||||||
sshCommand remote: remote, command: "mkdir /home/$JOBLINK_LOCAL_USER/builds/main/linux"
|
sshCommand remote: remote, command: "mkdir /home/${env.JOBLINK_LOCAL_USER}/builds/main/linux"
|
||||||
sshPut(from: 'build/linux/x64/release', into: '/home/$JOBLINK_LOCAL_USER/builds/main/linux', remote: remote)
|
sshPut(from: 'build/linux/x64/release', into: '/home/${env.JOBLINK_LOCAL_USER}/builds/main/linux', remote: remote)
|
||||||
sshCommand remote: remote, command: "mv /home/$JOBLINK_LOCAL_USER/builds/main/linux/release/* /home/$JOBLINK_LOCAL_USER/builds/main/linux"
|
sshCommand remote: remote, command: "mv /home/${env.JOBLINK_LOCAL_USER}/builds/main/linux/release/* /home/${env.JOBLINK_LOCAL_USER}/builds/main/linux"
|
||||||
sshCommand remote: remote, command: "rm -R /home/$JOBLINK_LOCAL_USER/builds/main/linux/release/"
|
sshCommand remote: remote, command: "rm -R /home/${env.JOBLINK_LOCAL_USER}/builds/main/linux/release/"
|
||||||
sshRemove(path: '/home/$JOBLINK_LOCAL_USER/builds/main/apk', remote: remote)
|
sshRemove(path: '/home/${env.JOBLINK_LOCAL_USER}/builds/main/apk', remote: remote)
|
||||||
sshCommand remote: remote, command: "mkdir /home/$JOBLINK_LOCAL_USER/builds/main/apk"
|
sshCommand remote: remote, command: "mkdir /home/${env.JOBLINK_LOCAL_USER}/builds/main/apk"
|
||||||
sshPut(from: 'build/app/outputs/apk/release', into: '/home/$JOBLINK_LOCAL_USER/builds/main/apk', remote: remote)
|
sshPut(from: 'build/app/outputs/apk/release', into: '/home/${env.JOBLINK_LOCAL_USER}/builds/main/apk', remote: remote)
|
||||||
sshCommand remote: remote, command: "mv /home/$JOBLINK_LOCAL_USER/builds/main/apk/release/* /home/$JOBLINK_LOCAL_USER/builds/main/apk"
|
sshCommand remote: remote, command: "mv /home/${env.JOBLINK_LOCAL_USER}/builds/main/apk/release/* /home/${env.JOBLINK_LOCAL_USER}/builds/main/apk"
|
||||||
sshCommand remote: remote, command: "rm -R /home/$JOBLINK_LOCAL_USER/builds/main/apk/release/"
|
sshCommand remote: remote, command: "rm -R /home/${env.JOBLINK_LOCAL_USER}/builds/main/apk/release/"
|
||||||
} else {
|
} else {
|
||||||
sshRemove(path: '/home/$JOBLINK_LOCAL_USER/builds/dev/linux', remote: remote)
|
sshRemove(path: '/home/${env.JOBLINK_LOCAL_USER}/builds/dev/linux', remote: remote)
|
||||||
sshCommand remote: remote, command: "mkdir /home/$JOBLINK_LOCAL_USER/builds/dev/linux"
|
sshCommand remote: remote, command: "mkdir /home/${env.JOBLINK_LOCAL_USER}/builds/dev/linux"
|
||||||
sshPut(from: 'build/linux/x64/release', into: '/home/$JOBLINK_LOCAL_USER/builds/dev/linux', remote: remote)
|
sshPut(from: 'build/linux/x64/release', into: '/home/${env.JOBLINK_LOCAL_USER}/builds/dev/linux', remote: remote)
|
||||||
sshCommand remote: remote, command: "mv /home/$JOBLINK_LOCAL_USER/builds/dev/linux/release/* /home/$JOBLINK_LOCAL_USER/builds/dev/linux"
|
sshCommand remote: remote, command: "mv /home/${env.JOBLINK_LOCAL_USER}/builds/dev/linux/release/* /home/${env.JOBLINK_LOCAL_USER}/builds/dev/linux"
|
||||||
sshCommand remote: remote, command: "rm -R /home/$JOBLINK_LOCAL_USER/builds/dev/linux/release/"
|
sshCommand remote: remote, command: "rm -R /home/${env.JOBLINK_LOCAL_USER}/builds/dev/linux/release/"
|
||||||
sshRemove(path: '/home/$JOBLINK_LOCAL_USER/builds/dev/apk', remote: remote)
|
sshRemove(path: '/home/${env.JOBLINK_LOCAL_USER}/builds/dev/apk', remote: remote)
|
||||||
sshCommand remote: remote, command: "mkdir /home/$JOBLINK_LOCAL_USER/builds/dev/apk"
|
sshCommand remote: remote, command: "mkdir /home/${env.JOBLINK_LOCAL_USER}/builds/dev/apk"
|
||||||
sshPut(from: 'build/app/outputs/apk/release', into: '/home/$JOBLINK_LOCAL_USER/builds/dev/apk', remote: remote)
|
sshPut(from: 'build/app/outputs/apk/release', into: '/home/${env.JOBLINK_LOCAL_USER}/builds/dev/apk', remote: remote)
|
||||||
sshCommand remote: remote, command: "mv /home/$JOBLINK_LOCAL_USER/builds/dev/apk/release/* /home/$JOBLINK_LOCAL_USER/builds/dev/apk"
|
sshCommand remote: remote, command: "mv /home/${env.JOBLINK_LOCAL_USER}/builds/dev/apk/release/* /home/${env.JOBLINK_LOCAL_USER}/builds/dev/apk"
|
||||||
sshCommand remote: remote, command: "rm -R /home/$JOBLINK_LOCAL_USER/builds/dev/apk/release/"
|
sshCommand remote: remote, command: "rm -R /home/${env.JOBLINK_LOCAL_USER}/builds/dev/apk/release/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -92,14 +92,14 @@ pipeline {
|
|||||||
name : 'MarinoDev',
|
name : 'MarinoDev',
|
||||||
host : 'marinodev.com',
|
host : 'marinodev.com',
|
||||||
port : 21098,
|
port : 21098,
|
||||||
user : '$JOBLINK_REMOTE_USER',
|
user : '${env.JOBLINK_REMOTE_USER}',
|
||||||
identityFile : '/var/jenkins_home/marinoDevPrivateKey',
|
identityFile : '/var/jenkins_home/marinoDevPrivateKey',
|
||||||
passphrase : '$JOBLINK_REMOTE_PASSWD',
|
passphrase : '${env.JOBLINK_REMOTE_PASSWD}',
|
||||||
allowAnyHosts: true,
|
allowAnyHosts: true,
|
||||||
]
|
]
|
||||||
sshRemove(path: '/home/$JOBLINK_REMOTE_USER/public_html/fbla', remote: remote)
|
sshRemove(path: '/home/${env.JOBLINK_REMOTE_USER}/public_html/fbla', remote: remote)
|
||||||
sshPut(from: '/var/jenkins_home/workspace/fbla-ui_main/build/web/', into: '/home/$JOBLINK_REMOTE_USER/public_html/', remote: remote)
|
sshPut(from: '/var/jenkins_home/workspace/fbla-ui_main/build/web/', into: '/home/${env.JOBLINK_REMOTE_USER}/public_html/', remote: remote)
|
||||||
sshCommand remote: remote, command: "mv /home/$JOBLINK_REMOTE_USER/public_html/web /home/$JOBLINK_REMOTE_USER/public_html/fbla"
|
sshCommand remote: remote, command: "mv /home/${env.JOBLINK_REMOTE_USER}/public_html/web /home/${env.JOBLINK_REMOTE_USER}/public_html/fbla"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,14 +109,13 @@ pipeline {
|
|||||||
def remote = [
|
def remote = [
|
||||||
name : 'HostServer',
|
name : 'HostServer',
|
||||||
host : '192.168.0.216',
|
host : '192.168.0.216',
|
||||||
user : '$JOBLINK_LOCAL_USER',
|
user : "${env.JOBLINK_LOCAL_USER}",
|
||||||
password : '$JOBLINK_LOCAL_PASSWD',
|
password : "${env.JOBLINK_LOCAL_PASSWD}",
|
||||||
allowAnyHosts: true,
|
allowAnyHosts: true,
|
||||||
]
|
]
|
||||||
sh 'echo $JOBLINK_LOCAL_USER $JOBLINK_LOCAL_PASSWD'
|
sshRemove(path: '/home/${env.JOBLINK_LOCAL_USER}/fbla-webserver/webfiles/fbla', remote: remote)
|
||||||
sshRemove(path: '/home/$JOBLINK_LOCAL_USER/fbla-webserver/webfiles/fbla', remote: remote)
|
sshPut(from: 'build/web/', into: '/home/${env.JOBLINK_LOCAL_USER}/fbla-webserver', remote: remote)
|
||||||
sshPut(from: 'build/web/', into: '/home/$JOBLINK_LOCAL_USER/fbla-webserver', remote: remote)
|
sshCommand remote: remote, command: "mv /home/${env.JOBLINK_LOCAL_USER}/fbla-webserver/web /home/${env.JOBLINK_LOCAL_USER}/fbla-webserver/webfiles/fbla"
|
||||||
sshCommand remote: remote, command: "mv /home/$JOBLINK_LOCAL_USER/fbla-webserver/web /home/$JOBLINK_LOCAL_USER/fbla-webserver/webfiles/fbla"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,18 +1,17 @@
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart';
|
|
||||||
import 'package:fbla_api/fbla_api.dart';
|
|
||||||
import 'package:test/test.dart';
|
|
||||||
import 'package:http/http.dart' as http;
|
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:dart_jsonwebtoken/dart_jsonwebtoken.dart';
|
||||||
|
import 'package:fbla_api/fbla_api.dart';
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
final apiAddress = 'https://homelab.marinodev.com';
|
final apiAddress = 'https://homelab.marinodev.com';
|
||||||
SecretKey secretKey = SecretKey(Platform.environment['SECRET_KEY']!);
|
SecretKey secretKey = SecretKey(Platform.environment['JOBLINK_SECRET_KEY']!);
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
final jwt = JWT(
|
final jwt = JWT(
|
||||||
{
|
{'username': 'tmp'},
|
||||||
'username': 'tmp'
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
final token = jwt.sign(secretKey);
|
final token = jwt.sign(secretKey);
|
||||||
|
|
||||||
@ -43,7 +42,8 @@ void main() async{
|
|||||||
"password": "tmp"
|
"password": "tmp"
|
||||||
}
|
}
|
||||||
''';
|
''';
|
||||||
var response = await http.post(Uri.parse('$apiAddress, /fbla-api/createuser'),
|
var response = await http.post(
|
||||||
|
Uri.parse('$apiAddress, /fbla-api/createuser'),
|
||||||
body: json,
|
body: json,
|
||||||
headers: {'Authorization': token}).timeout(const Duration(seconds: 20));
|
headers: {'Authorization': token}).timeout(const Duration(seconds: 20));
|
||||||
expect(response.statusCode, 200);
|
expect(response.statusCode, 200);
|
||||||
@ -70,11 +70,9 @@ void main() async{
|
|||||||
"username": "tmp"
|
"username": "tmp"
|
||||||
}
|
}
|
||||||
''';
|
''';
|
||||||
var response = await http.post(
|
var response = await http.post(Uri.parse('$apiAddress/fbla-api/deleteuser'),
|
||||||
Uri.parse('$apiAddress/fbla-api/deleteuser'),
|
|
||||||
body: json,
|
body: json,
|
||||||
headers: {'Authorization': token}).timeout(const Duration(seconds: 20)
|
headers: {'Authorization': token}).timeout(const Duration(seconds: 20));
|
||||||
);
|
|
||||||
expect(response.statusCode, 200);
|
expect(response.statusCode, 200);
|
||||||
expect(response.body, 'tmp');
|
expect(response.body, 'tmp');
|
||||||
});
|
});
|
||||||
@ -94,7 +92,8 @@ void main() async{
|
|||||||
"locationAddress": "tmp"
|
"locationAddress": "tmp"
|
||||||
}
|
}
|
||||||
''';
|
''';
|
||||||
var response = await http.post(Uri.parse('$apiAddress/fbla-api/createbusiness'),
|
var response = await http.post(
|
||||||
|
Uri.parse('$apiAddress/fbla-api/createbusiness'),
|
||||||
body: json,
|
body: json,
|
||||||
headers: {'Authorization': token}).timeout(const Duration(seconds: 20));
|
headers: {'Authorization': token}).timeout(const Duration(seconds: 20));
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user