From 0866f5d926be15633cc5f162bee0373e1d36a0f0 Mon Sep 17 00:00:00 2001 From: Michael7371 <40476797+Michael7371@users.noreply.github.com> Date: Mon, 24 Feb 2025 15:51:07 -0700 Subject: [PATCH] updates to the azure pipelines for CI --- .azure/README.md | 46 ++++++++++++++++++++++++++++++++++++++ .azure/azure-pipelines.yml | 38 +++++++++++++++++++++++++++++++ azure-pipelines.yml | 19 ---------------- 3 files changed, 84 insertions(+), 19 deletions(-) create mode 100644 .azure/README.md create mode 100644 .azure/azure-pipelines.yml delete mode 100644 azure-pipelines.yml diff --git a/.azure/README.md b/.azure/README.md new file mode 100644 index 00000000..4711f824 --- /dev/null +++ b/.azure/README.md @@ -0,0 +1,46 @@ +# Azure Pipeline Configuration + +This directory contains the Azure DevOps pipeline configuration for the ASN.1 Codec project. + +## Overview + +The pipeline configuration in `azure-pipelines.yml` is primarily used for Continuous Integration (CI) in the CDOT-CV fork of the ASN.1 Codec project. It serves as the first step in a two-stage process: + +1. **Build Pipeline (this configuration)** + - Triggers on changes to the `develop` branch + - Monitors specific project directories for changes: + - `usdot-asn1c/*` + - `src/*` + - `include/*` + - `pugixml/*` + - Copies all source files to the artifact staging directory + - Publishes the source code as an artifact named 'asn1_codec' + +2. **Release Pipeline (configured in Azure DevOps)** + - Uses the published artifact from the build pipeline + - Handles Docker image building and deployment + - Configuration is managed through the Azure DevOps web interface + +## Pipeline Trigger + +The pipeline automatically triggers when: + +- Changes are pushed to the `develop` branch +- Changes occur in any of the monitored project directories + +## Pipeline Steps + +1. **Copy Files** + - Copies project files to the artifact staging directory + - Excludes certain files/directories by default: + - `data` directories + - `docs` directories + - Markdown (`.md`) files + +2. **Publish Artifact** + - Creates an artifact named 'asn1_codec' + - Makes the source code available for the release pipeline + +## Note + +The actual Docker build process and deployment steps are configured in the Azure DevOps release pipeline, which is separate from this build pipeline configuration. The release pipeline picks up the artifact produced by this build pipeline and performs the necessary build and deployment steps. diff --git a/.azure/azure-pipelines.yml b/.azure/azure-pipelines.yml new file mode 100644 index 00000000..b077a0df --- /dev/null +++ b/.azure/azure-pipelines.yml @@ -0,0 +1,38 @@ +# Azure pipeline used to trigger builds of the asn1_codec project +# This pipeline is primarily used for CI in the CDOT-CV fork + +trigger: + branches: + include: + - develop + paths: + include: + - 'usdot-asn1c/*' + - 'src/*' + - 'include/*' + - 'pugixml/*' + +pool: + vmImage: ubuntu-latest + +steps: + # Add checkout step with submodules + - checkout: self + submodules: true + + - task: CopyFiles@2 + inputs: + SourceFolder: '$(Build.SourcesDirectory)' + Contents: | + ** + !**/data/** + !**/docs/** + !**/*.md + TargetFolder: '$(Build.ArtifactStagingDirectory)' + + # Publish the artifacts directory for consumption in publish pipeline + - task: PublishBuildArtifacts@1 + inputs: + PathtoPublish: '$(Build.ArtifactStagingDirectory)' + ArtifactName: 'asn1_codec' + publishLocation: 'Container' diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 27a798ad..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Starter pipeline -# Start with a minimal pipeline that you can customize to build and deploy your code. -# Add steps that build, run tests, deploy, and more: -# https://aka.ms/yaml - -trigger: -- master - -pool: - vmImage: ubuntu-latest - -steps: -- script: echo Hello, world! - displayName: 'Run a one-line script' - -- script: | - echo Add other tasks to build, test, and deploy your project. - echo See https://aka.ms/yaml - displayName: 'Run a multi-line script'