DevOps Classroomnotes 08/Jul/2023

Azure DevOps Workshop

Workflow

  • Day build workflow
  • Nightly Build workflow

Day build workflow

  • Branch name: workshop-develop
  • reference use nopCommerce Refer Here
  • Manual steps:
# dotnet-sdk 7.0
dotnet build src/NopCommerce.sln
  • activity 1
    • figure out where the packages are getting built src/Presentation/Nop.Web/bin/Debug/net7.0
    • we need copy these packages into artifacts
  • activity 2:
    • configure agent pool
      • dotnet 7
    • Write a pipeline with a build stage to build the code using dotnet build src/NopCommerce.sln
    • publish the artifacts to nopreleaseartifacts
  • Pipeline so far
---

trigger:
  - workshop-develop


stages:
  - stage: buildstage
    displayName: Build flea commerce
    pool:
      vmImage: ubuntu-22.04
    jobs:
      - job: buildJob
        displayName: Build and Publish
        steps:
          - task: DotNetCoreCLI@2
            inputs:
              command: build
              projects: src/NopCommerce.sln
          - task: CopyFiles@2
            inputs:
              contents: 'src/Presentation/Nop.Web/bin/Debug/net7.0/**'
              targetFolder: $(Build.ArtifactStagingDirectory)
          - task: PublishBuildArtifacts@1
            inputs:
              pathToPublish: $(Build.ArtifactStagingDirectory)
              artifactName: nopreleaseartifacts
  # artifacts src/Presentation/Nop.Web/bin/Debug/net7.0

  • The build resulted in the following output

Stage – 2: Deploying what we build – Variant I

  • Workflow
    • Try to create a linux vm (AWS/Azure) using terraform
      • Agent:
        • AWS: Softwares required
          • Terraform
          • aws cli and configure
        • Azure: Softwares required
          • Terraform
          • azure cli and configure

Stages – Variant II (Container)

  • Stage – I
    • Build a fleaCommerce docker container image
      docker image build -t <name>:<tag> .
    • push it to docker hub
      docker image push <name>:<tag>
  • Solution:
---

trigger:
  - workshop-develop


stages:
  - stage: buildstage
    displayName: Build flea commerce
    pool:
      vmImage: ubuntu-22.04
    jobs:
      - job: buildJob
        displayName: Build and Publish
        steps:
         - task: Docker@2
           inputs:
             command: 'buildAndPush'
             Dockerfile: '**/Dockerfile'
             containerRegistry: 'mydockerhub'
             repository: 'shaikkhajaibrahim/fleacommerce'
             tags: latest
  • Stage – II
    • create a kubernetes cluster from terraform and configure kubectl (optional)
    • Execute kubernetes deployment kubectl apply -f <something.yaml>
Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a comment

Turn on JavaScript to leave a comment.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Social Network Integration by Acurax Social Media Branding Company
Exit mobile version
%%footer%%