From b0669f65c0486f247decd6f40d4e7b95e1f7fedf Mon Sep 17 00:00:00 2001 From: surtur Date: Sat, 26 Dec 2020 17:06:03 +0100 Subject: [PATCH] chore: target 3.1.* + connected simplification * global.json sdk value will now match 3.1.whatever * rm the now-redundant sed both from the ci pipeline and Dockerfile* * limit ci pipeline runs to single build for an event. e.g. on a pr, run a single build instead of both a pr build and a push build * edit Makefile to force --no-cache builds --- .drone.yml | 18 +++++++----------- Dockerfile | 4 ---- Dockerfile.dev | 4 ---- Makefile | 4 ++-- global.json | 2 +- 5 files changed, 10 insertions(+), 22 deletions(-) diff --git a/.drone.yml b/.drone.yml index b85f58e..15d6a8d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,19 +7,17 @@ platform: os: linux arch: amd64 -steps: -- name: sed-tgt-version - pull: always - image: bash - commands: - - sed -i 's/3.1.110/3.1.404/' global.json - # since we're running 3.1.404 here in the CI, this is necessary +trigger: + ref: + - refs/heads/master + - refs/heads/feature-* + - refs/pull/*/head + - refs/tags/* +steps: - name: debug pull: always image: mcr.microsoft.com/dotnet/core/sdk:3.1-alpine - depends_on: - - sed-tgt-version commands: - dotnet restore - dotnet build . @@ -27,8 +25,6 @@ steps: - name: release pull: always image: mcr.microsoft.com/dotnet/core/sdk:3.1-alpine - depends_on: - - sed-tgt-version commands: - dotnet restore - dotnet publish -c Release -o out diff --git a/Dockerfile b/Dockerfile index 51f7da3..6e0cc77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,14 +5,10 @@ ENV UNAME unpriv RUN adduser -D -u ${UID} -g ${GID} -H ${UNAME} -h /src WORKDIR /src -COPY global.json ./ -RUN sed -i 's/3.1.110/3.1.404/' global.json - COPY *.csproj ./ RUN dotnet restore COPY . ./ -RUN sed -i 's/3.1.110/3.1.404/' global.json RUN dotnet publish -c Release -o bin/out FROM mcr.microsoft.com/dotnet/aspnet:3.1 diff --git a/Dockerfile.dev b/Dockerfile.dev index 777491b..9aa1753 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -5,14 +5,10 @@ ENV UNAME unpriv RUN adduser -D -u ${UID} -g ${GID} -H ${UNAME} -h /src WORKDIR /src -COPY global.json ./ -RUN sed -i 's/3.1.110/3.1.404/' global.json - COPY *.csproj ./ RUN dotnet restore COPY . ./ -RUN sed -i 's/3.1.110/3.1.404/' global.json RUN dotnet build -c Debug -o bin/out RUN chown -R ${UID}:${GID} ./ /root/ USER ${UNAME} diff --git a/Makefile b/Makefile index 540f9e6..de90dd9 100644 --- a/Makefile +++ b/Makefile @@ -35,13 +35,13 @@ dockerbuild: docker build \ --build-arg VCS_REF=`git rev-parse --short HEAD` \ --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ - -t $(dtag) -f $(dfile) . + -t $(dtag) -f $(dfile) --no-cache . dockerdevbuild: docker build \ --build-arg VCS_REF=`git rev-parse --short HEAD` \ --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ - -t $(dtagdev) -f $(dfiledev) . + -t $(dtagdev) -f $(dfiledev) --no-cache . dockerrun: @echo ====================== diff --git a/global.json b/global.json index 8afc0f0..a90a85c 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "3.1.404" + "version": "3.1.*" } }