{{#if this.isRunning}}
Progress: {{this.progressPercentage}}%
{{/if}}
}
```
--------------------------------
### Upgrade All Action
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/api-reference/controllers.md
Handles the transition to the update route for all repositories.
```javascript
@action
upgradeAllButton()
```
```javascript
// User clicks "Upgrade All" button
this.router.transitionTo("update.show", "all");
// Navigates to /admin/update/all
```
--------------------------------
### Initialize WebServerAdapter
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/api-reference/web-server-adapter.md
Creates a new adapter instance bound to an upgrader.
```ruby
adapter = DockerManager::WebServerAdapter.new(upgrader)
```
--------------------------------
### Initialize Repo Instance
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/api-reference/repo-model.md
Creates a new Repo instance with optional initial attributes, handling special transformations for latest and plugin properties.
```javascript
constructor(attributes = {})
```
```javascript
const repo = new Repo({
id: "discourse",
name: "discourse",
version: "abc123...",
latest: { version: "def456..." }
});
```
--------------------------------
### UpdateRoute setupController hook
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/api-reference/controllers.md
Initializes the controller and checks for main branch warnings.
```javascript
setupController(controller, model)
```
--------------------------------
### Manage repository lifecycle and upgrades
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/api-reference/repo-model.md
Demonstrates loading repositories, checking for new versions, initiating upgrades, and polling for progress status.
```javascript
// Load all repositories
const repos = await Repo.findAll();
// Find specific repository
const discourse = await Repo.find("discourse");
// Check for updates
await discourse.findLatest();
if (discourse.hasNewVersion) {
console.log(`Updates available: ${discourse.prettyVersion} → ${discourse.prettyLatestVersion}`);
}
// Initiate upgrade
await discourse.startUpgrade();
// Poll progress
let progress = await discourse.findProgress();
while (progress.status === "running") {
console.log(`Progress: ${progress.percentage}%`);
await new Promise(r => setTimeout(r, 1000));
progress = await discourse.findProgress();
}
// Handle completion
if (progress.status === "complete") {
console.log("Upgrade complete!");
} else if (progress.status === "failed") {
console.log("Upgrade failed!");
}
```
--------------------------------
### Upgrade Store Initialization
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/api-reference/upgrade-store.md
Initializes the upgrade store with progress data fetched from the repository.
```javascript
const progress = await repo.findProgress();
upgradeStore.reset({
consoleOutput: progress.logs,
progressPercentage: progress.percentage,
upgradeStatus: progress.status,
repos: [repo.id]
});
```
--------------------------------
### Initiate Docker Upgrade via POST
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/endpoints.md
Use these requests to trigger an asynchronous upgrade process for a specific repository or all repositories.
```bash
curl -X POST "http://localhost:3000/admin/docker/update" \
-d "path=/var/www/discourse" \
-d "version=abc123..."
```
```bash
curl -X POST "http://localhost:3000/admin/docker/update" \
-d "path=all"
```
--------------------------------
### Create a new Repo instance
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/api-reference/repo-model.md
Use this factory method to instantiate a new Repo object with initial attributes.
```javascript
const repo = Repo.create({ id: "discourse", name: "discourse" });
```
--------------------------------
### Get last percentage
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/api-reference/upgrader.md
Returns the current progress percentage stored in Redis.
```ruby
def last_percentage
```
--------------------------------
### Repo.findAll()
Source: https://github.com/discourse/docker_manager/blob/main/_autodocs/api-reference/repo-model.md
Fetches all available repositories and populates the internal cache.
```APIDOC
## Repo.findAll()
### Description
Retrieves a list of all repositories. This call also updates the module-level `needsImageUpgrade` flag based on the backend response.
### Returns
- **Promise