From 52d2bf9d1bef7504fbdf76d18e70e76c877c5e86 Mon Sep 17 00:00:00 2001 From: Sebastian Stehle Date: Tue, 27 Jun 2017 18:35:07 +0200 Subject: [PATCH] Old build scripts --- build.ps1 | 11 +++++++++++ dockerfile.build | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 build.ps1 create mode 100644 dockerfile.build diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 000000000..5e33380b8 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,11 @@ +# Build the image +docker build . -t squidex-build-image -f dockerfile.build + +# Open the image +docker create --name squidex-build-container squidex-build-image + +# Copy the output to the host file system +docker cp squidex-build-container:/out ./publish + +# Cleanup +docker rm squidex-build-container \ No newline at end of file diff --git a/dockerfile.build b/dockerfile.build new file mode 100644 index 000000000..f59227346 --- /dev/null +++ b/dockerfile.build @@ -0,0 +1,51 @@ +FROM microsoft/aspnetcore-build:1.1.2 + +# Install runtime dependencies +RUN apt-get update \ + && apt-get install -y --no-install-recommends ca-certificates bzip2 libfontconfig \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + # Install official PhantomJS release +RUN set -x \ + && apt-get update \ + && apt-get install -y --no-install-recommends \ + && mkdir /srv/var \ + && mkdir /tmp/phantomjs \ + # Download Phantom JS + && curl -L https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 | tar -xj --strip-components=1 -C /tmp/phantomjs \ + # Copy binaries only + && mv /tmp/phantomjs/bin/phantomjs /usr/local/bin \ + # Create symbol link + # Clean up + && apt-get autoremove -y \ + && apt-get clean all \ + && rm -rf /tmp/* /var/lib/apt/lists/* + +RUN phantomjs --version + +COPY src/Squidex/package.json /tmp/package.json +RUN cd /tmp \ +&& npm install \ +&& npm rebuild node-sass + +COPY . . + +WORKDIR / + +# Build Frontend +RUN cp -a /tmp/node_modules /src/Squidex/ \ + && cd /src/Squidex \ + && npm run test:coverage \ + && npm run build:copy \ + && npm run build + +# Test Backend +RUN dotnet restore \ + && dotnet test tests/Squidex.Infrastructure.Tests/Squidex.Infrastructure.Tests.csproj \ + && dotnet test tests/Squidex.Core.Tests/Squidex.Core.Tests.csproj \ + && dotnet test tests/Squidex.Read.Tests/Squidex.Read.Tests.csproj \ + && dotnet test tests/Squidex.Write.Tests/Squidex.Write.Tests.csproj + +# Publish +RUN dotnet publish src/Squidex/Squidex.csproj --output /out/ --configuration Release \ No newline at end of file