Generic

Generic deployment represents universal bash or PowerShell scripts that can be used in any CI system. This approach provides maximum flexibility and allows you to integrate ABCD Lite deployment into any build system or custom automation workflow.

To use Generic deployment, you'll need to install ORAS CLI on your build agent or CI system. ORAS CLI is used for authenticating with the container registry and pushing artifacts.

Installing ORAS CLI

On Linux/macOS:

# Download and install ORAS CLI
VERSION="1.2.3"
curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz"
mkdir -p oras/
tar -zxf oras_${VERSION}_*.tar.gz -C oras/
rm -rf oras_${VERSION}_*.tar.gz

# Add to PATH (optional)
export PATH=$PATH:$(pwd)/oras/

On Windows:

# Download and install ORAS CLI
$VERSION = "1.2.3"
Invoke-WebRequest -Uri "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_windows_amd64.zip" -OutFile "oras.zip"
Expand-Archive -Path "oras.zip" -DestinationPath "oras" -Force
Remove-Item "oras.zip"

# Add to PATH (optional)
$env:PATH += ";$(Get-Location)\oras"

Required Environment Variables

Before running the deployment scripts, ensure you have the following environment variables set:

  • REGISTRY_USERNAME - Login for container registry
  • REGISTRY_PASSWORD - Password or token from container registry with push permissions
  • ABCDLITE_DEPLOY_TOKEN - ABCD Lite deployment token
  • REGISTRY_URL - Container registry URL (e.g., docker.io, myregistry.azurecr.io)
  • ARTIFACT_REPOSITORY - Repository name for artifacts (e.g., acme/venus)
  • ABCD_LITE_URL - ABCD Lite server URL
  • ABCD_LITE_PROJECT_ID - Project identifier from ABCD Lite
  • ABCD_LITE_SITE_NAME - IIS site name for deployment

ORAS CLI Usage

1. Login to Container Registry

# Linux/macOS
oras login $REGISTRY_URL --username $REGISTRY_USERNAME --password $REGISTRY_PASSWORD

# Windows PowerShell
oras login $env:REGISTRY_URL --username $env:REGISTRY_USERNAME --password $env:REGISTRY_PASSWORD

2. Push Artifacts

# Linux/macOS
oras push $REGISTRY_URL/$ARTIFACT_REPOSITORY:$VERSION ./publish-directory/:application/vnd.acme.rocket.docs.layer.v1+tar

# Windows PowerShell
oras push $env:REGISTRY_URL/$env:ARTIFACT_REPOSITORY:$env:VERSION ./publish-directory/:application/vnd.acme.rocket.docs.layer.v1+tar

Getting Script Templates

You can get pre-filled script templates by clicking on the Generic icon near the IIS site name on the project card in the ABCD Lite web interface.

template-generic-bash

template-generic-powershell

Integration Examples

Jenkins Pipeline

stage('Deploy') {
    steps {
        script {
            // Install ORAS CLI
            sh '''
                VERSION="1.2.3"
                curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz"
                mkdir -p oras/
                tar -zxf oras_${VERSION}_*.tar.gz -C oras/
                rm -rf oras_${VERSION}_*.tar.gz
            '''
            
            // Login and push artifacts
            sh '''
                ./oras/oras login $REGISTRY_URL --username $REGISTRY_USERNAME --password $REGISTRY_PASSWORD
                ./oras/oras push $REGISTRY_URL/$ARTIFACT_REPOSITORY:$BUILD_NUMBER ./publish/:application/vnd.acme.rocket.docs.layer.v1+tar
            '''
            
            // Deploy using ABCD Lite
            sh '''
                # Use the script template from web UI
                ./deploy.sh
            '''
        }
    }
}

GitLab CI

deploy:
  stage: deploy
  script:
    # Install ORAS CLI
    - |
      VERSION="1.2.3"
      curl -LO "https://github.com/oras-project/oras/releases/download/v${VERSION}/oras_${VERSION}_linux_amd64.tar.gz"
      mkdir -p oras/
      tar -zxf oras_${VERSION}_*.tar.gz -C oras/
      rm -rf oras_${VERSION}_*.tar.gz
    
    # Login and push artifacts
    - ./oras/oras login $REGISTRY_URL --username $REGISTRY_USERNAME --password $REGISTRY_PASSWORD
    - ./oras/oras push $REGISTRY_URL/$ARTIFACT_REPOSITORY:$CI_COMMIT_SHA ./publish/:application/vnd.acme.rocket.docs.layer.v1+tar
    
    # Deploy using ABCD Lite (script from web UI)
    - ./deploy.sh