{"id":297430,"date":"2020-01-21T09:00:21","date_gmt":"2020-01-21T09:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=297430"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=297430","title":{"rendered":"Blazor Client Side \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u041c\u0430\u0433\u0430\u0437\u0438\u043d: \u0427\u0430\u0441\u0442\u044c 2 \u2014 CI\/CD"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/484782\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r8\/ng\/mh\/r8ngmhywqpy8qtndlkiflap2iag.png\"><br \/>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043d\u0430 Blazor. \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b CI\/CD \u0434\u043b\u044f \u043d\u0435\u0433\u043e. \u0417\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442. <a name=\"habracut\"><\/a><\/p>\n<h2>\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435<\/h2>\n<p>  <\/p>\n<ul>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/463197\/\">Blazor + MVVM = Silverlight \u043d\u0430\u043d\u043e\u0441\u0438\u0442 \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0439 \u0443\u0434\u0430\u0440, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0434\u0440\u0435\u0432\u043d\u0435\u0435 \u0437\u043b\u043e \u043d\u0435\u043f\u043e\u0431\u0435\u0434\u0438\u043c\u043e<\/a>  <\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/topic\/edit\/484596\/\">Blazor Client Side \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u041c\u0430\u0433\u0430\u0437\u0438\u043d: \u0427\u0430\u0441\u0442\u044c 1 \u2014 \u0410\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f oidc (oauth2) + Identity Server4<\/a>  <\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/484782\/\">Blazor Client Side \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u041c\u0430\u0433\u0430\u0437\u0438\u043d: \u0427\u0430\u0441\u0442\u044c 2 \u2014 CI\/CD<\/a><\/li>\n<\/ul>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p>  <a href=\"https:\/\/gitlab.com\/VictorWinbringer\/blazoreshop\" rel=\"nofollow\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438<\/a><br \/>  <a href=\"https:\/\/hub.docker.com\/u\/victorcallidus\" rel=\"nofollow\">\u041e\u0431\u0440\u0430\u0437\u044b \u043d\u0430 Docker Registry <\/a><\/p>\n<h2> Dockerfile<\/h2>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Dockerfile c \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u00a0SPA \u043d\u0430 Blazor <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/rg\/5-\/yg\/rg5-ygfwje05l0ajmu2mufikxng.jpeg\">  <\/p>\n<pre><code class=\"bash\">FROM mcr.microsoft.com\/dotnet\/core\/aspnet:3.1-buster-slim AS base WORKDIR \/app EXPOSE 80 EXPOSE 443  FROM mcr.microsoft.com\/dotnet\/core\/sdk:3.1-buster AS build WORKDIR \/src COPY [&quot;src\/BlazorEShop.Spa.BlazorWasm\/Server\/BlazorEShop.Spa.BlazorWasm.Server.csproj&quot;, &quot;src\/BlazorEShop.Spa.BlazorWasm\/Server\/&quot;] COPY [&quot;src\/BlazorEShop.Spa.BlazorWasm\/Client\/BlazorEShop.Spa.BlazorWasm.Client.csproj&quot;, &quot;src\/BlazorEShop.Spa.BlazorWasm\/Client\/&quot;] RUN dotnet restore &quot;src\/BlazorEShop.Spa.BlazorWasm\/Server\/BlazorEShop.Spa.BlazorWasm.Server.csproj&quot; COPY . . WORKDIR &quot;\/src\/src\/BlazorEShop.Spa.BlazorWasm\/Server&quot; RUN dotnet build &quot;BlazorEShop.Spa.BlazorWasm.Server.csproj&quot; -c Release -o \/app\/build  FROM build AS publish RUN dotnet publish &quot;BlazorEShop.Spa.BlazorWasm.Server.csproj&quot; -c Release -o \/app\/publish  FROM base AS final WORKDIR \/app COPY --from=publish \/app\/publish . ENTRYPOINT [&quot;dotnet&quot;, &quot;BlazorEShop.Spa.BlazorWasm.Server.dll&quot;] <\/code><\/pre>\n<h2>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0434\u043b\u044f Gitlab<\/h2>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u0440\u0430\u0437\u0434\u0435\u043b Settings -&gt; CI\/CD \u043d\u0430\u0448\u0435\u0433\u043e \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f. \u0438 \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0430\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0432 Registry<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jy\/zm\/le\/jyzmleln2wc7ddzx4snhu01qz7w.png\"><\/p>\n<ol>\n<li>CI_REGISTRY_PATH \u2014 \u043f\u0443\u0442\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 registry ( \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 registry.hub.docker.com\/victorcallidus)<\/li>\n<li>CI_REGISTRY_USER \u2014 \u043d\u0430\u0448 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 \u0432 resitry<\/li>\n<li>CI_REGISTRY_PASSWORD \u2014 \u043f\u0430\u0440\u043e\u043b\u044c \u043e\u0442 \u043d\u0430\u0448\u0435\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430 \u0432 registry<\/li>\n<\/ol>\n<h2> Gitlab CI\/CD<\/h2>\n<p>  \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0448\u0430\u0440\u0435\u0434 \u0440\u0430\u043d\u043d\u0435\u0440\u044b \u0438\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0441\u0432\u043e\u0439 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u0431\u043e\u0440\u043a\u0438 docker.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/eq\/ao\/vt\/eqaovte-gyzl-noex6exktlnr6o.png\"><\/p>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 \u0444\u0430\u0439\u043b .gitlab-ci.yml \u0441 \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c   <\/p>\n<pre><code class=\"bash\">image: docker:19.03.1  variables:   DOCKER_HOST: tcp:\/\/docker:2375   DOCKER_TLS_CERTDIR: &quot;&quot;   BLAZOR_SPA_LATEST: ${CI_REGISTRY_PATH}blazor-eshop-spa-blazor:latest   BLAZOR_SPA_IMG_TAG: ${CI_REGISTRY_PATH}blazor-eshop-spa-blazor:$CI_COMMIT_REF_SLUG  services:   - docker:19.03.1-dind  stages:   - deploy_latest   - deploy_tag   - test  deploy_tag:   stage: deploy_tag   script:     - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY_PATH     - docker build -t $BLAZOR_SPA_IMG_TAG -f .\/src\/BlazorEShop.Spa.BlazorWasm\/Server\/Dockerfile .     - docker push $BLAZOR_SPA_IMG_TAG   only:     - tags  deploy_latest:   stage: deploy_latest   script:     - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY_PATH     - docker build -t $BLAZOR_SPA_LATEST -f .\/src\/BlazorEShop.Spa.BlazorWasm\/Server\/Dockerfile .     - docker push $BLAZOR_SPA_LATEST   only:     - master      test:     image: mcr.microsoft.com\/dotnet\/core\/sdk:3.1-buster     stage: test     script:         - &quot;dotnet test .\/BlazorEShop.sln&quot; <\/code><\/pre>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 docker-compose<\/h2>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0447\u0435\u0440\u0435\u0437 docker-compose.yml \u043c\u043e\u0436\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c   <\/p>\n<pre><code class=\"bash\">version: '3.4' services:   blazoreshop.spa.blazorwasm.server:     image: victorcallidus\/blazor-eshop-spa-blazor:latest     environment:       - ASPNETCORE_ENVIRONMENT=Production       - ASPNETCORE_URLS=https:\/\/+:443;http:\/\/+:80       - ASPNETCORE_HTTPS_PORT=8003       - ASPNETCORE_Kestrel__Certificates__Default__Password=1234Qwert       - ASPNETCORE_Kestrel__Certificates__Default__Path=\/root\/.aspnet\/https\/blazor-eshop-spa-blazor.pfx       - SsoUri=https:\/\/localhost:8000       - ApiUri=https:\/\/localhost:8001     ports:     # - &quot;7003:80&quot;       - &quot;8003:443&quot;     volumes:       - ${APPDATA}\/Microsoft\/UserSecrets:\/root\/.microsoft\/usersecrets:ro       - ${APPDATA}\/ASP.NET\/Https:\/root\/.aspnet\/https:ro <\/code><\/pre>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/484782\/\"> https:\/\/habr.com\/ru\/post\/484782\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/484782\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/r8\/ng\/mh\/r8ngmhywqpy8qtndlkiflap2iag.png\"><br \/>  \u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440! \u041f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u044e \u0434\u0435\u043b\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043d\u0430 Blazor. \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043b CI\/CD \u0434\u043b\u044f \u043d\u0435\u0433\u043e. \u0417\u0430 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u044f\u043c\u0438 \u0434\u043e\u0431\u0440\u043e \u043f\u043e\u0436\u0430\u043b\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0434 \u043a\u0430\u0442. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-297430","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=297430"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297430\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=297430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=297430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=297430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}