Script Versioning

Script Versioning

Understanding deployment versions and rollback

Version Model

Every deployment creates a new immutable version:

Version 1 → Version 2 → Version 3
  (v1.0)     (v1.1)      (v2.0)

Each version is:

  • Immutable - Cannot be changed after creation
  • Timestamped - Creation time recorded
  • Attributed - Creator tracked
  • Described - Optional deployment message

Creating Versions

Via CLI

devicesdk deploy --message "Add temperature sensor support"

This creates a new version with your message.

Automatic Versioning

DeviceSDK automatically assigns version identifiers:

  • Incrementing version numbers
  • SHA-256 content hash
  • Timestamp

Deployment Process

When you deploy:

  1. Build - Code compiled and bundled
  2. Upload - Sent to your DeviceSDK server
  3. Validate - Checked for errors
  4. Activate - Stored as the new active version on the server
  5. Notify - Connected devices are sent a reboot and pick up the new version on reconnect

Deployment typically completes in 10-30 seconds.

Version Activation

All Devices (Default)

All devices get the new version on their next reconnect:

devicesdk deploy

Rollback

Need to revert to a previous version?

Via Dashboard

  1. Navigate to version history
  2. Select previous version
  3. Click "Rollback"
  4. Confirm rollback

Devices reconnect and receive the previous version.

CI/CD Integration

GitHub Actions

- name: Deploy
  env:
    DEVICESDK_TOKEN: ${{ secrets.DEVICESDK_TOKEN }}
  run: |
    VERSION=$(git describe --tags)
    npx @devicesdk/cli deploy --message "Release $VERSION"

Version Limits

  • Maximum versions: Last 10 versions per device
  • Retention: Forever (unless deleted or expired after 10 new versions)
  • Script size: 1 MB per version

Next Steps