Browse code

builder/parser/dumper: Handle newlines appropriately.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)

Erik Hollensbe authored on 2014/08/30 04:49:16
Showing 20 changed files
... ...
@@ -26,7 +26,7 @@ func main() {
26 26
 		if err != nil {
27 27
 			panic(err)
28 28
 		} else {
29
-			fmt.Print(ast.Dump())
29
+			fmt.Println(ast.Dump())
30 30
 		}
31 31
 	}
32 32
 }
... ...
@@ -2,4 +2,4 @@
2 2
 (maintainer "brimstone@the.narro.ws")
3 3
 (env "GOPATH" "/go")
4 4
 (entrypoint "/usr/local/bin/consuldock")
5
-(run "apt-get update && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean && apt-get install -y --no-install-recommends git golang ca-certificates && apt-get clean && rm -rf /var/lib/apt/lists && go get -v github.com/brimstone/consuldock && mv $GOPATH/bin/consuldock /usr/local/bin/consuldock && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty && apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') && rm /tmp/dpkg.* && rm -rf $GOPATH")
6 5
\ No newline at end of file
6
+(run "apt-get update && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean && apt-get install -y --no-install-recommends git golang ca-certificates && apt-get clean && rm -rf /var/lib/apt/lists && go get -v github.com/brimstone/consuldock && mv $GOPATH/bin/consuldock /usr/local/bin/consuldock && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty && apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') && rm /tmp/dpkg.* && rm -rf $GOPATH")
... ...
@@ -6,4 +6,4 @@
6 6
 (run "cd /tmp && wget https://dl.bintray.com/mitchellh/consul/0.3.1_web_ui.zip -O web_ui.zip && unzip web_ui.zip && mv dist /webui && rm web_ui.zip")
7 7
 (run "apt-get update && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean && apt-get install -y --no-install-recommends unzip wget && apt-get clean && rm -rf /var/lib/apt/lists && cd /tmp && wget https://dl.bintray.com/mitchellh/consul/0.3.1_web_ui.zip -O web_ui.zip && unzip web_ui.zip && mv dist /webui && rm web_ui.zip && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty && apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') && rm /tmp/dpkg.*")
8 8
 (env "GOPATH" "/go")
9
-(run "apt-get update && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean && apt-get install -y --no-install-recommends git golang ca-certificates build-essential && apt-get clean && rm -rf /var/lib/apt/lists && go get -v github.com/hashicorp/consul && mv $GOPATH/bin/consul /usr/bin/consul && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty && apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') && rm /tmp/dpkg.* && rm -rf $GOPATH")
10 9
\ No newline at end of file
10
+(run "apt-get update && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.clean && apt-get install -y --no-install-recommends git golang ca-certificates build-essential && apt-get clean && rm -rf /var/lib/apt/lists && go get -v github.com/hashicorp/consul && mv $GOPATH/bin/consul /usr/bin/consul && dpkg -l | awk '/^ii/ {print $2}' > /tmp/dpkg.dirty && apt-get remove --purge -y $(diff /tmp/dpkg.clean /tmp/dpkg.dirty | awk '/^>/ {print $2}') && rm /tmp/dpkg.* && rm -rf $GOPATH")
... ...
@@ -37,4 +37,4 @@
37 37
 (env "APACHE_LOG_DIR" "/var/log/apache2")
38 38
 (expose "80")
39 39
 (volume "/opt/nagios/var" "/opt/nagios/etc" "/opt/nagios/libexec" "/var/log/apache2" "/usr/share/snmp/mibs")
40
-(cmd "/usr/local/bin/start_nagios")
41 40
\ No newline at end of file
41
+(cmd "/usr/local/bin/start_nagios")
... ...
@@ -22,4 +22,4 @@
22 22
 (workdir "/go/src/github.com/docker/docker")
23 23
 (env "DOCKER_BUILDTAGS" "apparmor selinux")
24 24
 (entrypoint "hack/dind")
25
-(copy "." "/go/src/github.com/docker/docker")
26 25
\ No newline at end of file
26
+(copy "." "/go/src/github.com/docker/docker")
... ...
@@ -2,4 +2,4 @@
2 2
 (maintainer "Erik \\\\Hollensbe <erik@hollensbe.org>\\\"")
3 3
 (run "apt-get \\update && apt-get \\\"install znc -y")
4 4
 (add "\\conf\\\\\"" "/.znc")
5
-(cmd "/usr\\\"/bin/znc" "-f" "-r")
6 5
\ No newline at end of file
6
+(cmd "/usr\\\"/bin/znc" "-f" "-r")
... ...
@@ -8,4 +8,4 @@
8 8
 (expose "8083")
9 9
 (expose "8086")
10 10
 (expose "8090")
11
-(expose "8099")
12 11
\ No newline at end of file
12
+(expose "8099")
... ...
@@ -1 +1 @@
1
-(cmd "\"[\\\"echo\\\", \\\"Phew, I just managed to escaped those double quotes\\\"]\"")
2 1
\ No newline at end of file
2
+(cmd "\"[\\\"echo\\\", \\\"Phew, I just managed to escaped those double quotes\\\"]\"")
... ...
@@ -1 +1 @@
1
-(cmd "'[\"echo\", \"Well, JSON in a string is JSON too?\"]'")
2 1
\ No newline at end of file
2
+(cmd "'[\"echo\", \"Well, JSON in a string is JSON too?\"]'")
... ...
@@ -1 +1 @@
1
-(cmd "['echo','single quotes are invalid JSON']")
2 1
\ No newline at end of file
2
+(cmd "['echo','single quotes are invalid JSON']")
... ...
@@ -1 +1 @@
1
-(cmd "[\"echo\", \"Please, close the brackets when you're done\"")
2 1
\ No newline at end of file
2
+(cmd "[\"echo\", \"Please, close the brackets when you're done\"")
... ...
@@ -1 +1 @@
1
-(cmd "[\"echo\", \"look ma, no quote!]")
2 1
\ No newline at end of file
2
+(cmd "[\"echo\", \"look ma, no quote!]")
... ...
@@ -4,4 +4,4 @@
4 4
 (run "apt-get update")
5 5
 (run "apt-get -y install redis-server redis-tools")
6 6
 (expose "6379")
7
-(entrypoint "/usr/bin/redis-server")
8 7
\ No newline at end of file
8
+(entrypoint "/usr/bin/redis-server")
... ...
@@ -26,4 +26,4 @@
26 26
 (volume "/test3")
27 27
 (workdir "/test")
28 28
 (add "." "/")
29
-(copy "." "copy")
30 29
\ No newline at end of file
30
+(copy "." "copy")
... ...
@@ -11,4 +11,4 @@
11 11
 (run "mkdir /Mail")
12 12
 (run "mkdir /.offlineimap")
13 13
 (run "echo \"export TERM=screen-256color\" >/.zshenv")
14
-(cmd "setsid cron; tmux -2")
15 14
\ No newline at end of file
15
+(cmd "setsid cron; tmux -2")
... ...
@@ -1,4 +1,4 @@
1 1
 (from "ubuntu:14.04")
2 2
 (run "apt-get update && apt-get install libcap2-bin mumble-server -y")
3 3
 (add "./mumble-server.ini" "/etc/mumble-server.ini")
4
-(cmd "/usr/sbin/murmurd")
5 4
\ No newline at end of file
5
+(cmd "/usr/sbin/murmurd")
... ...
@@ -8,4 +8,4 @@
8 8
 (run "mkdir /www")
9 9
 (cmd "/usr/sbin/nginx")
10 10
 (volume "/www")
11
-(expose "80")
12 11
\ No newline at end of file
12
+(expose "80")
... ...
@@ -17,4 +17,4 @@
17 17
 (add "./configs" "/steam/tf2/tf/addons/sourcemod/configs")
18 18
 (run "mkdir -p /steam/tf2/tf/addons/sourcemod/translations/en")
19 19
 (run "cp /steam/tf2/tf/addons/sourcemod/translations/*.txt /steam/tf2/tf/addons/sourcemod/translations/en")
20
-(cmd "cd /steam/tf2 && ./srcds_run -port 27015 +ip 0.0.0.0 +map ctf_2fort -autoupdate -steam_dir /steam -steamcmd_script /steam/script +tf_bot_quota 12 +tf_bot_quota_mode fill")
21 20
\ No newline at end of file
21
+(cmd "cd /steam/tf2 && ./srcds_run -port 27015 +ip 0.0.0.0 +map ctf_2fort -autoupdate -steam_dir /steam -steamcmd_script /steam/script +tf_bot_quota 12 +tf_bot_quota_mode fill")
... ...
@@ -3,4 +3,4 @@
3 3
 (add ".weechat" "/.weechat")
4 4
 (add ".tmux.conf" "/")
5 5
 (run "echo \"export TERM=screen-256color\" >/.zshenv")
6
-(cmd "zsh -c weechat")
7 6
\ No newline at end of file
7
+(cmd "zsh -c weechat")
... ...
@@ -2,4 +2,4 @@
2 2
 (maintainer "Erik Hollensbe <erik@hollensbe.org>")
3 3
 (run "apt-get update && apt-get install znc -y")
4 4
 (add "conf" "/.znc")
5
-(cmd "/usr/bin/znc" "-f" "-r")
6 5
\ No newline at end of file
6
+(cmd "/usr/bin/znc" "-f" "-r")