Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ All changes to this project will be documented in this file.

---

## v6.2.4

Release date: **2019-09-20**
[Compare code changes][v6.2.4] (🌳 STABLE)

### What’s changed in aragonCLI

## 💡 Feature updates

- Iterate `aragon run`: add `--client-repo` optional argument

---

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blurb is a placeholder. We need to fill in the correct date & release version before merging.


## v6.2.3

Release date: **2019-08-07**
Expand Down
1 change: 1 addition & 0 deletions docs/Main-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Available options to customize the `run` command:
- `bump`: Type of bump (major, minor or patch) or version number to publish the app.
- `--client`: Whether to start the Aragon client or not. Defaults to `true`.
- `--client-version`: Version of Aragon client used to run your sandboxed app.
- `--client-repo`: Repository of Aragon client to clone and run in your sandboxed app. Defaults to `https://github.com/aragon/aragon`.
- `--client-port`: Port being used by Aragon client.
- `--client-path`: A path pointing to an existing Aragon client installation.
- `--app-init`: Name of the function that will be called to initialize an app. Defaults to `initialize`.
Expand Down
1 change: 1 addition & 0 deletions packages/aragon-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
]
},
"aragon": {
"clientRepo": "https://github.com/aragon/aragon",
"clientVersion": "d8066daad8bf3be6a83f7ee374032995ebd994cf",
"clientPort": "3000",
"defaultGasPrice": "2",
Expand Down
8 changes: 7 additions & 1 deletion packages/aragon-cli/src/commands/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const { findProjectRoot, isPortTaken } = require('../util')

const url = require('url')

const DEFAULT_CLIENT_REPO = pkg.aragon.clientRepo
const DEFAULT_CLIENT_VERSION = pkg.aragon.clientVersion
const DEFAULT_CLIENT_PORT = pkg.aragon.clientPort

Expand Down Expand Up @@ -147,6 +148,10 @@ exports.builder = function(yargs) {
array: true,
default: [],
})
.option('client-repo', {
description: 'Repo of Aragon client used to run your sandboxed app',
default: DEFAULT_CLIENT_REPO,
})
.option('client-version', {
description: 'Version of Aragon client used to run your sandboxed app',
default: DEFAULT_CLIENT_VERSION,
Expand Down Expand Up @@ -196,6 +201,7 @@ exports.handler = function({
httpServedFrom,
appInit,
appInitArgs,
clientRepo,
clientVersion,
clientPort,
clientPath,
Expand Down Expand Up @@ -364,7 +370,7 @@ exports.handler = function({
title: 'Open DAO',
enabled: () => client === true,
task: async (ctx, task) =>
start.task({ clientVersion, clientPort, clientPath }),
start.task({ clientRepo, clientVersion, clientPort, clientPath }),
},
],
listrOpts(silent, debug)
Expand Down
27 changes: 22 additions & 5 deletions packages/aragon-cli/src/commands/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const TaskList = require('listr')
const pkg = require('../../package.json')
const { installDeps } = require('../util')

const DEFAULT_CLIENT_REPO = pkg.aragon.clientRepo
const DEFAULT_CLIENT_VERSION = pkg.aragon.clientVersion
const DEFAULT_CLIENT_PORT = pkg.aragon.clientPort

@macor161 macor161 Sep 23, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a small fix on line 17: exports.command = 'start [client-version]' should be exports.command = 'start [client-repo] [client-version]'

Expand All @@ -19,6 +20,11 @@ exports.describe = 'Start the Aragon GUI (graphical user interface)'

exports.builder = yargs => {
return yargs
.positional('client-repo', {
description:
'Repo of Aragon client used to run your sandboxed app (valid git repository using https or ssh protocol)',
default: DEFAULT_CLIENT_REPO,
})
.positional('client-version', {
description:
'Version of Aragon client used to run your sandboxed app (commit hash, branch name or tag name)',
Expand All @@ -34,7 +40,12 @@ exports.builder = yargs => {
})
}

exports.task = async function({ clientVersion, clientPort, clientPath }) {
exports.task = async function({
clientRepo,
clientVersion,
clientPort,
clientPath,
}) {
const tasks = new TaskList([
{
title: 'Fetching client from aragen',
Expand All @@ -50,7 +61,7 @@ exports.task = async function({ clientVersion, clientPort, clientPath }) {
skip: ctx => !!clientPath,
task: async (ctx, task) => {
task.output = 'Downloading client...'
await downloadClient(ctx, task, clientVersion)
await downloadClient({ ctx, task, clientRepo, clientVersion })
},
enabled: ctx => !ctx.clientFetch,
},
Expand Down Expand Up @@ -87,18 +98,24 @@ exports.task = async function({ clientVersion, clientPort, clientPath }) {

exports.handler = async ({
reporter,
clientRepo,
clientVersion,
clientPort,
clientPath,
}) => {
const task = await exports.task({ clientVersion, clientPort, clientPath })
const task = await exports.task({
clientRepo,
clientVersion,
clientPort,
clientPath,
})
return task
.run()
.then(() =>
reporter.info(
`Aragon client version ${chalk.blue(
`Aragon client from ${chalk.blue(clientRepo)} version ${chalk.blue(
clientVersion
)}, started on port ${chalk.blue(clientPort)}`
)} started on port ${chalk.blue(clientPort)}`
)
)
}
12 changes: 8 additions & 4 deletions packages/aragon-cli/src/lib/start/download-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ import { existsSync, ensureDirSync } from 'fs-extra'
import os from 'os'
import { promisify } from 'util'
const clone = promisify(require('git-clone'))
const pkg = require('../../../package.json')

export async function downloadClient(ctx, task, clientVersion) {
export async function downloadClient({
ctx,
task,
clientRepo = pkg.aragon.clientRepo,
clientVersion,
}) {
const CLIENT_PATH = `${os.homedir()}/.aragon/client-${clientVersion}`
ctx.clientPath = CLIENT_PATH

Expand All @@ -19,7 +25,5 @@ export async function downloadClient(ctx, task, clientVersion) {
ensureDirSync(CLIENT_PATH)

// Clone client
return clone('https://github.com/aragon/aragon', CLIENT_PATH, {
checkout: clientVersion,
})
return clone(clientRepo, CLIENT_PATH, { checkout: clientVersion })
}