Преглед изворни кода

move deps installation to vendor.sh script

Wes Morgan пре 12 година
родитељ
комит
20d24a450c
3 измењених фајлова са 32 додато и 7 уклоњено
  1. 1 0
      .gitignore
  2. 2 7
      Dockerfile
  3. 29 0
      vendor.sh

+ 1 - 0
.gitignore

@@ -14,3 +14,4 @@ docs/_templates
 .gopath/
 .dotcloud
 *.test
+vendor/

+ 2 - 7
Dockerfile

@@ -35,7 +35,7 @@ run	apt-get install -y -q mercurial
 # Install Go
 run	curl -s https://go.googlecode.com/files/go1.1.2.linux-amd64.tar.gz | tar -v -C /usr/local -xz
 env	PATH	/usr/local/go/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
-env	GOPATH	/go
+env	GOPATH	/go:/vendor
 env	CGO_ENABLED 0
 run	cd /tmp && echo 'package main' > t.go && go test -a -i -v
 # Ubuntu stuff
@@ -50,15 +50,10 @@ run	/bin/echo -e '[default]\naccess_key=$AWS_ACCESS_KEY\nsecret_key=$AWS_SECRET_
 # Runtime dependencies
 run	apt-get install -y -q iptables
 run	apt-get install -y -q lxc
-# Download dependencies
-run	PKG=github.com/kr/pty REV=27435c699;		 git clone http://$PKG /go/src/$PKG && cd /go/src/$PKG && git checkout -f $REV
-run	PKG=github.com/gorilla/context/ REV=708054d61e5; git clone http://$PKG /go/src/$PKG && cd /go/src/$PKG && git checkout -f $REV
-run	PKG=github.com/gorilla/mux/ REV=9b36453141c;	 git clone http://$PKG /go/src/$PKG && cd /go/src/$PKG && git checkout -f $REV
-run	PKG=github.com/dotcloud/tar/ REV=e5ea6bb21a3294;	 git clone http://$PKG /go/src/$PKG && cd /go/src/$PKG && git checkout -f $REV
-run	PKG=code.google.com/p/go.net/ REV=84a4013f96e0;  hg  clone http://$PKG /go/src/$PKG && cd /go/src/$PKG && hg  checkout    $REV
 volume	/var/lib/docker
 workdir	/go/src/github.com/dotcloud/docker
 # Wrap all commands in the "docker-in-docker" script to allow nested containers
 entrypoint ["hack/dind"]
 # Upload docker source
+add 	vendor	/vendor
 add	.       /go/src/github.com/dotcloud/docker

+ 29 - 0
vendor.sh

@@ -0,0 +1,29 @@
+#!/bin/bash
+
+# Downloads dependencies into vendor/ directory
+if [[ ! -d vendor ]]; then
+  mkdir vendor
+fi
+vendor_dir=${PWD}/vendor
+
+git_clone () {
+  PKG=$1
+  REV=$2
+  if [[ ! -d src/$PKG ]]; then
+    cd $vendor_dir && git clone http://$PKG src/$PKG && cd src/$PKG && git checkout -f $REV
+  fi
+}
+
+git_clone github.com/kr/pty 27435c699
+
+git_clone github.com/gorilla/context/ 708054d61e5
+
+git_clone github.com/gorilla/mux/ 9b36453141c
+
+git_clone github.com/dotcloud/tar/ d06045a6d9
+
+# Docker requires code.google.com/p/go.net/websocket
+PKG=code.google.com/p/go.net REV=84a4013f96e0
+if [[ ! -d src/$PKG ]]; then
+  cd $vendor_dir && hg clone https://$PKG src/$PKG && cd src/$PKG && hg checkout -r $REV
+fi