This commit introduces the `Strata.Excel.Core` project, a .NET library built on ClosedXML for robust Excel document generation and data import. Key features include: - **Export:** Flexible data export to Excel, supporting custom formatting, titles, subtitles, humanized headings, and batched processing for large datasets. Includes `ExcelContentResult` and `ZipFileContentResult` for ASP.NET Core integration. - **Import:** Utilities to easily import data from Excel worksheets into C# objects. - **Test Utilities:** Comprehensive helpers for comparing Excel workbooks in tests, handling resource extraction, and performing load tests. - **Build Infrastructure:** Sets up a Dockerfile for building the library, including SonarQube and Dependency-Check scanning. - **Project Structure:** Establishes `.gitignore`, `.dockerignore`, `nuget.config`, and a `README.md` with usage instructions and versioning guidelines. This foundational commit provides a reusable and well-tested framework for Excel operations within Strata applications.
90 lines
2.7 KiB
Docker
90 lines
2.7 KiB
Docker
ARG PROJECT=Strata.Excel.Core
|
|
ARG VERSION=0.0.0
|
|
ARG SONARURL=''
|
|
ARG SONARLOGIN=''
|
|
ARG SONARBRANCH=''
|
|
|
|
###############
|
|
# Build image #
|
|
###############
|
|
FROM ecr.ops.stratanetwork.net/strata.microsoft.dotnet.sdk:6.0 AS build
|
|
ARG PROJECT
|
|
ARG VERSION
|
|
ARG SONARLOGIN
|
|
ARG SONARURL
|
|
ARG SONARBRANCH
|
|
|
|
RUN apt-get --allow-releaseinfo-change update && apt-get install -y libgdiplus
|
|
|
|
WORKDIR /src
|
|
|
|
# Copy project files and restore
|
|
COPY ["${PROJECT}.sln", "${PROJECT}.sln"]
|
|
COPY src/**/*.csproj ./
|
|
RUN for file in $(ls *.csproj); do mkdir -p src/${file%.*}/ && mv $file src/${file%.*}/; done
|
|
COPY tests/**/*.csproj ./
|
|
RUN for file in $(ls *.csproj); do mkdir -p tests/${file%.*}/ && mv $file tests/${file%.*}/; done
|
|
|
|
RUN dotnet restore "${PROJECT}.sln" \
|
|
--source https://api.nuget.org/v3/index.json \
|
|
--source https://proget.sdt.local/nuget/nuget/v3/index.json
|
|
|
|
|
|
# Copy files and build
|
|
COPY . .
|
|
|
|
RUN if [ "${SONARLOGIN}" != "" ] ; then dotnet sonarscanner begin \
|
|
/k:"${PROJECT}" \
|
|
/d:sonar.scm.provider=git \
|
|
/d:sonar.host.url="${SONARURL}" \
|
|
/d:sonar.login="${SONARLOGIN}" \
|
|
${SONARBRANCH} \
|
|
/d:sonar.cs.opencover.reportsPaths="/src/cover.xml" \
|
|
/d:sonar.dependencyCheck.jsonReportPath=/src/buildlogs/dependency-check-report.json \
|
|
/d:sonar.dependencyCheck.htmlReportPath=/src/buildlogs/dependency-check-report.html \
|
|
/v:sonar.projectVersion="${VERSION}"; fi
|
|
|
|
|
|
RUN dotnet build "${PROJECT}.sln" \
|
|
--configuration Release \
|
|
--no-restore
|
|
|
|
# Run unit tests
|
|
RUN dotnet test "${PROJECT}.sln" \
|
|
--configuration Release \
|
|
--no-restore \
|
|
--no-build \
|
|
--verbosity=normal \
|
|
-p:CollectCoverage=true \
|
|
-p:CoverletOutputFormat="opencover" \
|
|
-p:CoverletOutput=/src/cover.xml
|
|
|
|
RUN dotnet pack "src/Strata.Excel.Core/Strata.Excel.Core.csproj" \
|
|
--configuration Release \
|
|
--no-restore \
|
|
--no-build \
|
|
--include-symbols \
|
|
--include-source \
|
|
--output /pack \
|
|
-property:PackageVersion=${VERSION}
|
|
|
|
RUN dotnet pack "src/Strata.Excel.TestUtilities/Strata.Excel.TestUtilities.csproj" \
|
|
--configuration Release \
|
|
--no-restore \
|
|
--no-build \
|
|
--include-symbols \
|
|
--include-source \
|
|
--output /pack \
|
|
-property:PackageVersion=${VERSION}
|
|
|
|
|
|
RUN if [ "${SONARLOGIN}" != "" ] ; then \
|
|
/dc/dependency-check/bin/dependency-check.sh -f JSON -f HTML -s . -o ./buildlogs \
|
|
--suppression ./sonarsuppressions.xml \
|
|
--noupdate --nodeAuditSkipDevDependencies --disableNodeJS \
|
|
--dbDriverName "com.microsoft.sqlserver.jdbc.SQLServerDriver" \
|
|
--connectionString "jdbc:sqlserver://ddensqldevops01.sdt.local;Database=DependencyCheck;encrypt=true;trustServerCertificate=true;" \
|
|
--dbUser "dcuser" --dbPassword "${SONARLOGIN}" && \
|
|
dotnet sonarscanner end /d:sonar.login="${SONARLOGIN}"; \
|
|
fi
|