diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..48a120c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,40 @@ +FROM git.zontreck.com/packages/flutter:latest as BUILDER + +WORKDIR /app +COPY ./pubspec.yaml ./ +COPY ./cli ./ +COPY ./lib ./ +COPY ./android ./ +COPY ./linux ./ +COPY ./ios ./ +COPY ./macos ./ +COPY ./test ./ +COPY ./web ./ +COPY ./windows ./ +COPY ./analysis_options.yaml ./ + + +RUN dart pub get +RUN dart fix --apply +RUN dart compile exe -o bugvaultd cli/server.dart + +FROM git.zontreck.com/packages/flutter:latest + +LABEL author Tara Piccari +LABEL email tarapiccari@gmail.com + +ENV BUGVAULT_DATA_DIRECTORY /data + +COPY --from=BUILDER /app/bugvaultd /sbin/bugvaultd + +SHELL ["/bin/bash", "-c"] + +COPY ./docker-entrypoint.sh /entrypoint.sh +RUN chmod +x /entrypoint.sh + +WORKDIR /data +RUN useradd -s /bin/bash -d /data -M bugvault + +USER bugvault:bugvault + +ENTRYPOINT [ "/entrypoint.sh" ] \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index d6229ac..124e04e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -130,5 +130,59 @@ pipeline { } } } + + stage("Build Server") { + agent { + label 'linux' + } + + steps { + script { + sh ''' + #!/bin/bash + + dart pub get + mkdir out + dart compile exe -o out/server cli/server.dart + + mv out/server bugvaultd + ''' + } + } + + post { + always { + archiveArtifacts artifacts: "bugvaultd" + + cleanWs() + } + } + } + + stage("Build Docker") { + agent { + label 'dockermain' + } + + steps { + script { + sh ''' + #!/bin/bash + + docker build -t git.zontreck.com/packages/bugvault:latest "$(pwd)" + docker push git.zontreck.com/packages/bugvault:latest + + docker rmi -f git.zontreck.com/packages/bugvault:latest + docker buildx prune -a -f + ''' + } + } + + post { + always { + cleanWs() + } + } + } } } \ No newline at end of file diff --git a/cli/server.dart b/cli/server.dart new file mode 100644 index 0000000..6c67cb5 --- /dev/null +++ b/cli/server.dart @@ -0,0 +1,9 @@ +Future main(List args) async { + print("Starting BugVault Server..."); + + // Check for settings.dat, which should contain all basic information. + // Then check if any data exists. If not, create data hierarchy + + print("Thank you for choosing BugVault! - Shutting down..."); + return 0; +} diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..4094285 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +echo "Welcome to BugVault - Docker" +/sbin/bugvaultd \ No newline at end of file diff --git a/lib/Constants.dart b/lib/Constants.dart index 7bd6a41..4ee6b9a 100644 --- a/lib/Constants.dart +++ b/lib/Constants.dart @@ -1,4 +1,4 @@ class Constants { - static const VERSION = "1.0.031425+2339"; + static const VERSION = "1.0.031525+0003"; static const APP_NAME = "BugVault"; } diff --git a/pubspec.yaml b/pubspec.yaml index 93ed17c..6631199 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.031425+2339 +version: 1.0.031525+0003 environment: sdk: ^3.7.0 @@ -40,6 +40,7 @@ dependencies: libac_dart: hosted: https://git.zontreck.com/api/packages/Packages/pub/ version: 1.4.20325+1215 + totp: ^0.1.0 dev_dependencies: flutter_test: