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:
- Build - Code compiled and bundled
- Upload - Sent to DeviceSDK
- Validate - Checked for errors
- Activate - Made available globally
- Notify - Devices informed of new version
Deployment typically completes in 10-30 seconds.
Version Activation
All Devices (Default)
All devices get new version immediately:
devicesdk deploy
Rollback
Need to revert to a previous version?
Via Dashboard
- Navigate to version history
- Select previous version
- Click “Rollback”
- 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
- Platform Architecture - System overview
- CLI Deploy Command - Deployment options
- Your First Device - Build and deploy