Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up CI with Azure Pipelines #43

Merged
merged 3 commits into from
Mar 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .azure/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# 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:
- `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.
37 changes: 37 additions & 0 deletions .azure/azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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: |
**
!**/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'
Loading