Adds a utility binary and adds tasks to the windows node
This commit is contained in:
parent
6555b6c8f0
commit
92df8e4dcd
3 changed files with 104 additions and 14 deletions
48
Jenkinsfile
vendored
48
Jenkinsfile
vendored
|
@ -1,7 +1,6 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent any
|
||||||
label 'linux'
|
|
||||||
}
|
|
||||||
options {
|
options {
|
||||||
buildDiscarder(
|
buildDiscarder(
|
||||||
logRotator(
|
logRotator(
|
||||||
|
@ -11,8 +10,10 @@ pipeline {
|
||||||
}
|
}
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
agent {
|
||||||
stage('Build') {
|
label 'linux'
|
||||||
|
}
|
||||||
|
stage('Build on linux') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
// Use bash as the shell for these commands
|
// Use bash as the shell for these commands
|
||||||
|
@ -26,20 +27,14 @@ pipeline {
|
||||||
|
|
||||||
mkdir -p out
|
mkdir -p out
|
||||||
dart compile exe -o out/dbikc bin/dbikc.dart
|
dart compile exe -o out/dbikc bin/dbikc.dart
|
||||||
|
dart compile exe -o out/mkfsreport bin/mkfsreport.dart
|
||||||
|
|
||||||
tar -cvf docs.tgz doc/api/*
|
tar -cvf docs.tgz doc/api/*
|
||||||
|
|
||||||
|
flutter pub publish -f --skip-validation
|
||||||
'''
|
'''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
stage('Deploy') {
|
|
||||||
steps {
|
|
||||||
sh 'flutter pub publish -f --skip-validation'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
|
@ -48,4 +43,29 @@ pipeline {
|
||||||
deleteDir()
|
deleteDir()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
stage('Build on Windows') {
|
||||||
|
agent {
|
||||||
|
label 'windows'
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
bat "dart pub get"
|
||||||
|
bat "mkdir out"
|
||||||
|
bat "dart compile exe -o out/dbikc.exe bin/dbikc.dart"
|
||||||
|
bat "dart compile exe -o out/mkfsreport.exe bin/mkfsreport.dart"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
archiveArtifacts artifacts: "out\\*.exe", fingerprint: true
|
||||||
|
deleteDir()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
67
bin/mkfsreport.dart
Normal file
67
bin/mkfsreport.dart
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
/*
|
||||||
|
Make File System Report
|
||||||
|
|
||||||
|
This tool will generate a HTML report for the base path specified.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import 'dart:ffi';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:libac_dart/argparse/Args.dart';
|
||||||
|
import 'package:libac_dart/argparse/Builder.dart';
|
||||||
|
import 'package:libac_dart/argparse/CLIHelper.dart';
|
||||||
|
import 'package:libac_dart/argparse/types/Bool.dart';
|
||||||
|
import 'package:libac_dart/argparse/types/String.dart';
|
||||||
|
import 'package:libac_dart/consts.dart';
|
||||||
|
import 'package:libac_dart/utils/IOTools.dart';
|
||||||
|
|
||||||
|
Future<int> main(List<String> args) async {
|
||||||
|
String VERSION = "1.0.082424.0001";
|
||||||
|
|
||||||
|
Arguments defaults = ArgumentsBuilder.builder()
|
||||||
|
.withArgument(BoolArgument(
|
||||||
|
name: "asc",
|
||||||
|
description: "Operate in ascending mode, smallest size listed first"))
|
||||||
|
.withArgument(StringArgument(
|
||||||
|
name: "path",
|
||||||
|
value: "/",
|
||||||
|
description: "The path to generate a report for"))
|
||||||
|
.withArgument(
|
||||||
|
BoolArgument(name: "help", description: "Hey look! It's me!"))
|
||||||
|
.withArgument(StringArgument(
|
||||||
|
name: "o",
|
||||||
|
value: "file.html",
|
||||||
|
description:
|
||||||
|
"Where to place the report. If not specified, stdout is used"))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
Arguments parsed = await CLIHelper.parseArgs(args, Arguments());
|
||||||
|
String helpTest =
|
||||||
|
"Make File System Report\nVersion: $VERSION\nUsing LibAC Version: ${Constants.VERSION}\nAuthor: Tara Piccari\n\n${CLIHelper.makeArgCLIHelp(defaults)}";
|
||||||
|
|
||||||
|
if (parsed.count == 0 || !parsed.hasArg("path") || parsed.hasArg("help")) {
|
||||||
|
print(helpTest);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ascending = false;
|
||||||
|
if (parsed.hasArg("asc")) ascending = true;
|
||||||
|
StringArgument pathArg = parsed.getArg("path") as StringArgument;
|
||||||
|
print("> Analyzing files...");
|
||||||
|
await getDirectorySize(pathArg.value,
|
||||||
|
cacheSize: true, recursive: true, verbose: parsed.hasArg("o"));
|
||||||
|
FileInformationCache FIC = FileInformationCache.obtain();
|
||||||
|
String report =
|
||||||
|
await FIC.generateHTMLReport(ascending: ascending, VERSION: VERSION);
|
||||||
|
|
||||||
|
if (parsed.hasArg("o")) {
|
||||||
|
prnt("> Generating report...\r");
|
||||||
|
StringArgument outputPath = parsed.getArg("o") as StringArgument;
|
||||||
|
await File(outputPath.value).writeAsString(report);
|
||||||
|
prnt("\r> Task Completed\n");
|
||||||
|
} else {
|
||||||
|
print(report);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
3
lib/consts.dart
Normal file
3
lib/consts.dart
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
class Constants {
|
||||||
|
static const VERSION = "1.2.082424+0001";
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue