Compare commits
5 Commits
1.1106-vsc
...
1.1140-vsc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
04adf14146 | ||
|
|
406ec0ba71 | ||
|
|
a2ad3d4ff4 | ||
|
|
4a29cd1664 | ||
|
|
0462a93f11 |
@@ -27,7 +27,6 @@ before_deploy:
|
|||||||
- git config --local user.name "$USER_NAME"
|
- git config --local user.name "$USER_NAME"
|
||||||
- git config --local user.email "$USER_EMAIL"
|
- git config --local user.email "$USER_EMAIL"
|
||||||
- git tag "$VERSION" "$TRAVIS_COMMIT"
|
- git tag "$VERSION" "$TRAVIS_COMMIT"
|
||||||
- if [[ “$TRAVIS_OS_NAME” == “osx” ]]; then yarn task package $VERSION; fi
|
|
||||||
deploy:
|
deploy:
|
||||||
provider: releases
|
provider: releases
|
||||||
file_glob: true
|
file_glob: true
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ const buildServerBinary = register("build:server:binary", async (runner) => {
|
|||||||
logger.info("Building with environment", field("env", {
|
logger.info("Building with environment", field("env", {
|
||||||
NODE_ENV: process.env.NODE_ENV,
|
NODE_ENV: process.env.NODE_ENV,
|
||||||
VERSION: process.env.VERSION,
|
VERSION: process.env.VERSION,
|
||||||
|
OSTYPE: process.env.OSTYPE,
|
||||||
|
TARGET: process.env.TARGET,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
await ensureInstalled();
|
await ensureInstalled();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ cd code-server-{version}-linux-x64
|
|||||||
chmod +x code-server
|
chmod +x code-server
|
||||||
```
|
```
|
||||||
|
|
||||||
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../security/ssl.md)
|
> To ensure the connection between you and your server is encrypted view our guide on [securing your setup](../../security/ssl.md)
|
||||||
|
|
||||||
- Start the code-server
|
- Start the code-server
|
||||||
```
|
```
|
||||||
|
|||||||
6
packages/ide-api/api.d.ts
vendored
6
packages/ide-api/api.d.ts
vendored
@@ -1,6 +1,9 @@
|
|||||||
// tslint:disable no-any
|
// tslint:disable no-any
|
||||||
|
|
||||||
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
||||||
|
import { IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||||
|
import { Action } from 'vs/base/common/actions';
|
||||||
|
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||||
|
|
||||||
export interface EvalHelper { }
|
export interface EvalHelper { }
|
||||||
interface ActiveEvalEmitter {
|
interface ActiveEvalEmitter {
|
||||||
@@ -146,7 +149,10 @@ declare namespace ide {
|
|||||||
export const client: {};
|
export const client: {};
|
||||||
|
|
||||||
export const workbench: {
|
export const workbench: {
|
||||||
|
readonly action: Action,
|
||||||
|
readonly syncActionDescriptor: SyncActionDescriptor,
|
||||||
readonly statusbarService: IStatusbarService;
|
readonly statusbarService: IStatusbarService;
|
||||||
|
readonly actionsRegistry: IWorkbenchActionRegistry;
|
||||||
readonly notificationService: INotificationService;
|
readonly notificationService: INotificationService;
|
||||||
readonly storageService: IStorageService;
|
readonly storageService: IStorageService;
|
||||||
readonly menuRegistry: IMenuRegistry;
|
readonly menuRegistry: IMenuRegistry;
|
||||||
|
|||||||
@@ -6,13 +6,17 @@ import { IStatusbarService, StatusbarAlignment } from "vs/platform/statusbar/com
|
|||||||
import * as paths from "./fill/paths";
|
import * as paths from "./fill/paths";
|
||||||
import product from "./fill/product";
|
import product from "./fill/product";
|
||||||
import "./vscode.scss";
|
import "./vscode.scss";
|
||||||
import { MenuId, MenuRegistry } from "vs/platform/actions/common/actions";
|
import { Action } from 'vs/base/common/actions';
|
||||||
|
import { SyncActionDescriptor, MenuRegistry, MenuId } from 'vs/platform/actions/common/actions';
|
||||||
|
import { Registry } from 'vs/platform/registry/common/platform';
|
||||||
|
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
|
||||||
import { CommandsRegistry } from "vs/platform/commands/common/commands";
|
import { CommandsRegistry } from "vs/platform/commands/common/commands";
|
||||||
import { IFileService, FileOperation } from "vs/platform/files/common/files";
|
import { IFileService, FileOperation } from "vs/platform/files/common/files";
|
||||||
import { ITextFileService } from "vs/workbench/services/textfile/common/textfiles";
|
import { ITextFileService } from "vs/workbench/services/textfile/common/textfiles";
|
||||||
import { IModelService } from "vs/editor/common/services/modelService";
|
import { IModelService } from "vs/editor/common/services/modelService";
|
||||||
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
import { ITerminalService } from "vs/workbench/contrib/terminal/common/terminal";
|
||||||
import { IStorageService } from "vs/platform/storage/common/storage";
|
import { IStorageService } from "vs/platform/storage/common/storage";
|
||||||
|
|
||||||
// NOTE: shouldn't import anything from VS Code here or anything that will
|
// NOTE: shouldn't import anything from VS Code here or anything that will
|
||||||
// depend on a synchronous fill like `os`.
|
// depend on a synchronous fill like `os`.
|
||||||
|
|
||||||
@@ -33,11 +37,12 @@ class VSClient extends IdeClient {
|
|||||||
window.ide = {
|
window.ide = {
|
||||||
client: ideClientInstance,
|
client: ideClientInstance,
|
||||||
workbench: {
|
workbench: {
|
||||||
|
action: Action,
|
||||||
|
syncActionDescriptor: SyncActionDescriptor,
|
||||||
commandRegistry: CommandsRegistry,
|
commandRegistry: CommandsRegistry,
|
||||||
// tslint:disable-next-line:no-any
|
actionsRegistry: Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions),
|
||||||
menuRegistry: MenuRegistry as any,
|
menuRegistry: MenuRegistry,
|
||||||
// tslint:disable-next-line:no-any
|
statusbarService: getService<IStatusbarService>(IStatusbarService),
|
||||||
statusbarService: getService<IStatusbarService>(IStatusbarService) as any,
|
|
||||||
notificationService: getService<INotificationService>(INotificationService),
|
notificationService: getService<INotificationService>(INotificationService),
|
||||||
terminalService: getService<ITerminalService>(ITerminalService),
|
terminalService: getService<ITerminalService>(ITerminalService),
|
||||||
storageService: {
|
storageService: {
|
||||||
|
|||||||
@@ -52,7 +52,15 @@ export type DialogOptions = OpenDialogOptions | SaveDialogOptions;
|
|||||||
|
|
||||||
export const showOpenDialog = (options: OpenDialogOptions): Promise<string> => {
|
export const showOpenDialog = (options: OpenDialogOptions): Promise<string> => {
|
||||||
return new Promise<string>((resolve, reject): void => {
|
return new Promise<string>((resolve, reject): void => {
|
||||||
const dialog = new Dialog(DialogType.Open, options);
|
// Make the default to show hidden files and directories since there is no
|
||||||
|
// other way to make them visible in the dialogs currently.
|
||||||
|
const dialog = new Dialog(DialogType.Open, typeof options.properties.showHiddenFiles === "undefined" ? {
|
||||||
|
...options,
|
||||||
|
properties: {
|
||||||
|
...options.properties,
|
||||||
|
showHiddenFiles: true,
|
||||||
|
},
|
||||||
|
} : options);
|
||||||
dialog.onSelect((e) => {
|
dialog.onSelect((e) => {
|
||||||
dialog.dispose();
|
dialog.dispose();
|
||||||
resolve(e);
|
resolve(e);
|
||||||
@@ -505,9 +513,8 @@ class DialogEntryRenderer implements ITreeRenderer<DialogEntry, string, DialogEn
|
|||||||
*/
|
*/
|
||||||
private humanReadableSize(bytes: number): string {
|
private humanReadableSize(bytes: number): string {
|
||||||
const units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
const units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
||||||
const i = Math.min(Math.floor(Math.log(bytes) / Math.log(1000)), units.length - 1);
|
const i = Math.min(Math.floor(bytes && Math.log(bytes) / Math.log(1000)), units.length - 1);
|
||||||
|
|
||||||
return (bytes / Math.pow(1000, i)).toFixed(2)
|
return (bytes / Math.pow(1000, i)).toFixed(2) + " " + units[i];
|
||||||
+ " " + units[i];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,51 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -euxo pipefail
|
set -euxo pipefail
|
||||||
|
|
||||||
# Variables to be set:
|
# Build using a Docker container using the specified image and version.
|
||||||
# $IMAGE
|
|
||||||
function docker_build() {
|
function docker_build() {
|
||||||
containerID=$(docker create -it -v $(pwd)/.cache:/src/.cache $IMAGE)
|
local image="${1}" ; shift
|
||||||
docker start $containerID
|
local version="${1}" ; shift
|
||||||
docker exec $containerID mkdir -p /src
|
|
||||||
|
|
||||||
function exec() {
|
local containerId
|
||||||
docker exec $containerID bash -c "$@"
|
containerId=$(docker create --network=host --rm -it -v "$(pwd)"/.cache:/src/.cache "${image}")
|
||||||
|
docker start "${containerId}"
|
||||||
|
docker exec "${containerId}" mkdir -p /src
|
||||||
|
|
||||||
|
function docker_exec() {
|
||||||
|
docker exec "${containerId}" bash -c "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
docker cp ./. $containerID:/src
|
docker cp ./. "${containerId}":/src
|
||||||
exec "cd /src && yarn"
|
docker_exec "cd /src && yarn"
|
||||||
exec "cd /src && npm rebuild"
|
docker_exec "cd /src && npm rebuild"
|
||||||
exec "cd /src && NODE_ENV=production VERSION=$VERSION yarn task build:server:binary"
|
docker_exec "cd /src && NODE_ENV=production VERSION=${version} yarn task build:server:binary"
|
||||||
exec "cd /src && yarn task package $VERSION"
|
docker_exec "cd /src && yarn task package ${version}"
|
||||||
docker cp $containerID:/src/release/. ./release/
|
docker cp "${containerId}":/src/release/. ./release/
|
||||||
|
|
||||||
|
docker stop "${containerId}"
|
||||||
}
|
}
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
function main() {
|
||||||
NODE_ENV=production yarn task build:server:binary
|
local version=${VERSION:-}
|
||||||
|
local ostype=${OSTYPE:-}
|
||||||
|
|
||||||
|
if [[ -z "${version}" ]] ; then
|
||||||
|
>&2 echo "Must set VERSION environment variable"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${ostype}" == "darwin"* ]]; then
|
||||||
|
NODE_ENV=production VERSION="${version}" yarn task build:server:binary
|
||||||
|
yarn task package "${version}"
|
||||||
else
|
else
|
||||||
|
local image
|
||||||
if [[ "$TARGET" == "alpine" ]]; then
|
if [[ "$TARGET" == "alpine" ]]; then
|
||||||
IMAGE="codercom/nbin-alpine"
|
image="codercom/nbin-alpine"
|
||||||
else
|
else
|
||||||
IMAGE="codercom/nbin-centos"
|
image="codercom/nbin-centos"
|
||||||
fi
|
fi
|
||||||
docker_build
|
docker_build "${image}" "${version}"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user