Skip to content
Arxo Arxo

GitLab, Jenkins, CircleCI

Create .gitlab-ci.yml:

architecture:
stage: test
image: ubuntu:22.04
cache:
paths:
- .cache/arxo
before_script:
- apt-get update && apt-get install -y curl
- curl -sL "https://github.com/arxohq/arxo/releases/latest/download/arxo-linux-x86_64.tar.gz" | tar xz
- chmod +x arxo && mv arxo /usr/local/bin/
script:
- arxo analyze --fail-fast
artifacts:
when: always
paths:
- architecture-report.json

Create Jenkinsfile:

pipeline {
agent any
stages {
stage('Architecture Analysis') {
steps {
sh 'curl -sL "https://github.com/arxohq/arxo/releases/latest/download/arxo-linux-x86_64.tar.gz" | tar xz && chmod +x arxo && sudo mv arxo /usr/local/bin/'
sh 'arxo analyze --format json --output report.json'
}
}
stage('Archive Reports') {
steps {
archiveArtifacts artifacts: 'report.json', allowEmptyArchive: false
publishHTML([
reportDir: '.',
reportFiles: 'report.html',
reportName: 'Architecture Report'
])
}
}
}
post {
failure {
echo 'Architecture violations detected!'
}
}
}

Create .circleci/config.yml:

version: 2.1
jobs:
analyze:
docker:
- image: ubuntu:22.04
steps:
- checkout
- restore_cache:
keys:
- arxo-{{ checksum ".cache/arxo" }}
- run:
name: Install Arxo
command: |
apt-get update && apt-get install -y curl
curl -sL "https://github.com/arxohq/arxo/releases/latest/download/arxo-linux-x86_64.tar.gz" | tar xz
chmod +x arxo && sudo mv arxo /usr/local/bin/
- run:
name: Analyze Architecture
command: arxo analyze --fail-fast
- save_cache:
key: arxo-{{ checksum ".cache/arxo" }}
paths:
- ~/.cache/arxo
- store_artifacts:
path: architecture-report.json
workflows:
version: 2
build:
jobs:
- analyze