Base solution for your next web application

Activities of "ray"

Hi,

I'm trying to figure out how to get my environments configured by following these URL's but ZERO is

slightly set up a little different...

https://blog.angulartraining.com/how-to-manage-different-environments-with-angular-cli-883c26e99d15 https://medium.com/@balramchavan/configure-and-build-angular-application-for-different-environments-

7e94a3c0af23 https://medium.com/@balramchavan/separating-production-and-development-http-urls-using-environment-ts-

file-in-angular-4c2dd0c5a8b0

What i have done is I've created a new environment.01Test.ts file with the code like so...

export const environment = { production: false, hmr: false, appConfig: 'appconfig.01test.json', };

In my appconfig.01test.json i have added these...

"remoteServiceBaseUrl": "URL to my API", "appBaseUrl": "URL to my APP ",

In my package.json i have added this...

"build-01test": "ng build --configuration=01test"

In my angular.json i have added this to the configurations & serve sections...

"01test": { "optimization": true, "outputHashing": "all", "sourceMap": false, "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, "vendorChunk": false, "buildOptimizer": true, "fileReplacements": [ { "replace": "src/environments/environment.ts", "with": "src/environments/environment.01test.ts" } ] }

"01test": { "browserTarget": "abp-zero-template:build::01test" }

In my terminal I then run ...

ng build --configuration 01test

I have an Azure Devops CI/CD setup for Angular and in my CI I have a task called replace tokens

(*/environment.01test.ts) where it detects my target environment file (which points to my test API server

side as mentioned above in appconfig.01test.json), so that when the app gets deployed to IIS it knows the

backend its talking too, I also have an NPM task for command & arguments to 'run build-01test'

Is there anything else i need to configure in ZERO to make all this work properly or have i covered all the

files?

My CI/CD works but when i go to my IIS no files are there and nothing to browse to for angular. Is there anything I need to do with DIST or node_modules to make it work properly?

Thanks

Question

Hi,

I notice that when building my project that no dist folder was created in VSC but i see a dist folder in windows file system, so when I push my code up into my repo i see the dist is not there, so when i'm in the CI build shouldn't I be pointing to the path of dist in one of my agent tasks?

I also saw during my CD at the deploy task that there was a lot if information about node_modules (as if it were trying to upload all of them), shouldn't these be ignored? I also never saw these in VSC (again only in my windows file system)

After my CI/CD runs 100% i go to my on-prem IIS and i see that nothing has actually been deployed, there are no files there.

Is there something i'm missing or forgetting to do as I'm new to Angular?

Thanks.

Hi,

Any ideas on this one as I’m still struggling on this issue in my devops yaml file where it keeps failing on the ‘dotnet publish Release’

I have even tried putting in target conditions in the csproj files in the server side projects but still the same…

Restore completed in 54.54 ms for d:\a\1\s\src\WipTrack.Core.Shared\WipTrack.Core.Shared.csproj. Restore completed in 54.38 ms for d:\a\1\s\src\WipTrack.Application.Shared\WipTrack.Application.Shared.csproj. C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.CrossTargeting.targets(27,5): error : The 'Publish' target is not supported without specifying a target framework. The current project targets multiple frameworks, please specify the framework for the published application. [d:\a\1\s\src\WipTrack.Application.Shared\WipTrack.Application.Shared.csproj]

This is my yaml file, is there anything in here I need to change or anything in the server side solution i need to change?

======================================================================= trigger:

  • master

pool: vmImage: 'windows-2019'

variables: buildConfiguration: 'Release' workingDirectory: '$(Build.SourcesDirectory)/src'

steps:

  • script: dotnet restore ./WipTrack.Web.Host displayName: Restore workingDirectory: $(workingDirectory)

  • script: dotnet build ./WipTrack.Web.Host --configuration $(buildConfiguration) displayName: Build workingDirectory: $(workingDirectory)

  • task: DotNetCoreCLI@2 displayName: Run Unit Tests inputs: command: test projects: '**/Tests/.csproj' arguments: '--configuration $(buildConfiguration) --collect "Code coverage"'

  • task: DotNetCoreCLI@2 displayName: 'dotnet publish $(buildConfiguration)' inputs: command: publish projects: '**/*.csproj' publishWebProjects: false arguments: '--configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)' zipAfterPublish: true workingDirectory: $(workingDirectory)

  • task: PublishBuildArtifacts@1 displayName: 'publish artifacts' =====================================================================================

I tried putting in target conditions in the csproj files for the netstandard projects to include netcore2.2 and teh solution builds fine, but back in devops its still fails with the same error at the dotnet publish

Thanks.

Showing 11 to 13 of 13 entries