Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.

fix: offline deploy by moving network error behind debug flag #2719

Merged
merged 1 commit into from Jul 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 0 additions & 34 deletions cli/packages/prisma-cli-core/src/commands/deploy/index.ts
@@ -1,24 +1,18 @@
import { Command, flags, Flags, DeployPayload, Config } from 'prisma-cli-engine'
import { Cluster } from 'prisma-yml'
import chalk from 'chalk'
import { ServiceDoesntExistError } from '../../errors/ServiceDoesntExistError'
import { emptyDefinition } from './emptyDefinition'
import * as chokidar from 'chokidar'
import * as inquirer from 'inquirer'
import * as path from 'path'
import * as fs from 'fs-extra'
import { fetchAndPrintSchema } from './printSchema'
import { Seeder } from '../seed/Seeder'
import * as childProcess from 'child_process'
import * as semver from 'semver'
const debug = require('debug')('deploy')
import { prettyTime, concatName, defaultDockerCompose } from '../../util'
import { spawn } from '../../spawn'
import * as sillyname from 'sillyname'
import { getSchemaPathFromConfig } from './getSchemaPathFromConfig'
import * as findUp from 'find-up'
import { EndpointDialog } from '../../utils/EndpointDialog'
import { isDockerComposeInstalled } from '../../utils/dockerComposeInstalled'
import { spawnSync } from 'npm-run'
import * as figures from 'figures'

Expand Down Expand Up @@ -125,44 +119,16 @@ ${chalk.gray(
cluster = this.definition.getCluster(false)
}

/**
* If no cluster is running locally, don't start anymore but create docker-compose.yml and ask for starting
*/
if (
cluster &&
cluster.local &&
!await cluster.isOnline()
// !fs.readdirSync(this.config.definitionDir).includes('docker-compose.yml')
) {
// if (
// cluster.baseUrl.includes('127.0.0.1') ||
// cluster.baseUrl.includes('localhost')
// ) {
// fs.writeFileSync(
// path.join(this.config.definitionDir, 'docker-compose.yml'),
// dockerComposeYml,
// )
// this.out.log(
// `Created docker-compose.yml with a local prisma server.
// Please run ${chalk.cyan('$ docker-compose up -d')} to start your local prisma.
// Note: prisma local start will be deprecated soon in favor of the direct usage of docker-compose.`,
// )
// const dockerComposeInstalled = await isDockerComposeInstalled()
// if (!dockerComposeInstalled) {
// this.out.log(
// `To install docker-compose, please follow this link: ${chalk.cyan(
// 'https://docs.docker.com/compose/install/',
// )}`,
// )
// }
// process.exit(1)
// } else {
throw new Error(
`Could not connect to server at ${
cluster.baseUrl
}. Please check if your server is running.`,
)
// }
}

/**
Expand Down
3 changes: 1 addition & 2 deletions cli/packages/prisma-yml/src/Environment.ts
Expand Up @@ -72,7 +72,7 @@ export class Environment {
this.saveGlobalRC()
}
} catch (e) {
console.error(e)
debug(e)
}
}
}
Expand Down Expand Up @@ -155,7 +155,6 @@ export class Environment {
}
} catch (e) {
debug(e)
//
}
}
}
Expand Down