File tree 3 files changed +16
-56
lines changed
3 files changed +16
-56
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
set -euo pipefail
3
3
4
- # Opens an interactive bash session inside of a docker container
5
- # for improved isolation during development.
6
- # If the container exists it is restarted if necessary, then reused.
7
-
8
4
main () {
9
- cd " $( dirname " ${0} " ) /../../.."
10
-
11
- local container_name=code-server-dev
12
-
13
- if docker inspect $container_name & > /dev/null; then
14
- echo " -- Starting container"
15
- docker start " $container_name " > /dev/null
16
-
17
- enter
18
- exit 0
19
- fi
20
-
21
- build
22
- run
23
- enter
24
- }
25
-
26
- enter () {
27
- echo " --- Entering $container_name "
28
- docker exec -it " $container_name " /bin/bash
29
- }
5
+ cd " $( dirname " $0 " ) /../../.."
6
+ source ./ci/lib.sh
30
7
31
- run () {
32
- echo " --- Spawning $container_name "
33
8
docker run \
34
9
-it \
35
- --name $container_name \
36
- " -v= $PWD :/code-server " \
37
- " -w=/code-server " \
38
- " -p= 127.0.0.1:8080:8080" \
39
- $( if [[ -t 0 ]] ; then echo -it ; fi ) \
40
- " $container_name "
10
+ --rm \
11
+ -v " $PWD :/src " \
12
+ -w /src \
13
+ -p 127.0.0.1:8080:8080 \
14
+ " $( docker_build ./ci/images/debian8 ) " \
15
+ " $@ "
41
16
}
42
17
43
- build () {
44
- echo " --- Building $container_name "
45
- docker build -t $container_name ./ci/dev/image > /dev/null
18
+ docker_build () {
19
+ docker build " $@ " >&2
20
+ docker build -q " $@ "
46
21
}
47
22
48
23
main " $@ "
Original file line number Diff line number Diff line change @@ -46,14 +46,12 @@ yarn watch
46
46
To develop inside of an isolated docker container:
47
47
48
48
``` shell
49
- ./ci/dev/image/exec.sh
50
-
51
- root@12345:/code-server# yarn
52
- root@12345:/code-server# yarn vscode
53
- root@12345:/code-server# yarn watch
49
+ ./ci/dev/image/exec.sh yarn
50
+ ./ci/dev/image/exec.sh yarn vscode
51
+ ./ci/dev/image/exec.sh yarn watch
54
52
```
55
53
56
- Any changes made to the source will be live reloaded .
54
+ ` yarn watch ` will live reload changes to the source .
57
55
58
56
If changes are made to the patch and you've built previously you must manually
59
57
reset VS Code then run ` yarn vscode:patch ` .
78
76
Build release packages (make sure you run ` ./ci/steps/release.sh ` first):
79
77
80
78
```
81
- ./ci/steps/release-packages.sh
79
+ ./ci/dev/image/exec.sh ./ci/ steps/release-packages.sh
82
80
# The standalone release is in ./release-standalone
83
81
# .deb, .rpm and the standalone archive are in ./release-packages
84
82
```
You can’t perform that action at this time.
0 commit comments