From eaa963cf6c36f83736bc4fe4aaabc0661c0dcfd3 Mon Sep 17 00:00:00 2001
From: Roman Tsisyk <roman@tsisyk.com>
Date: Fri, 15 Sep 2017 14:29:47 +0300
Subject: [PATCH] Travis CI: use Docker for source upload

Travis images are broken by design.
---
 .travis.mk  | 17 ++++++++++++-----
 .travis.yml |  3 +--
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/.travis.mk b/.travis.mk
index 49c071ac3f..d211c75f89 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -6,10 +6,6 @@ DOCKER_IMAGE:=packpack/packpack:ubuntu-zesty
 
 all: package
 
-source:
-	git clone https://github.com/packpack/packpack.git packpack
-	TARBALL_COMPRESSOR=gz packpack/packpack tarball
-
 package:
 	git clone https://github.com/packpack/packpack.git packpack
 	./packpack/packpack
@@ -19,6 +15,8 @@ test: test_$(TRAVIS_OS_NAME)
 # Redirect some targets via docker
 test_linux: docker_test_ubuntu
 coverage: docker_coverage_ubuntu
+source: docker_source_ubuntu
+source_deploy: docker_source_deploy_ubuntu
 
 docker_%:
 	mkdir -p ~/.cache/ccache
@@ -40,7 +38,7 @@ deps_ubuntu:
 		libcurl4-openssl-dev binutils-dev \
 		python python-pip python-setuptools python-dev \
 		python-msgpack python-yaml python-argparse python-six python-gevent \
-		lcov ruby
+		lcov ruby awscli
 
 test_ubuntu: deps_ubuntu
 	cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo
@@ -63,3 +61,12 @@ test_osx: deps_osx
 	ulimit -n
 	make -j8
 	cd test && python test-run.py unit/ app/ app-tap/ box/ box-tap/
+
+source_ubuntu:
+	git clone https://github.com/packpack/packpack.git packpack
+	make -f ./packpack/pack/Makefile TARBALL_COMPRESSOR=gz tarball
+
+source_deploy_ubuntu:
+	aws --endpoint-url "${AWS_S3_ENDPOINT_URL}" s3 \
+		cp build/*.tar.gz "s3://tarantool-${TRAVIS_BRANCH}-src/" \
+		--acl public-read
diff --git a/.travis.yml b/.travis.yml
index 82ba39fcec..2b34b47579 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -78,7 +78,6 @@ script:
 
 before_deploy:
   - ls -l build/
-  - pip install awscli --user
 
 deploy:
   # Deploy packages to PackageCloud
@@ -94,7 +93,7 @@ deploy:
       condition: -n "${OS}" && -n "${DIST}" && -n "${PACKAGECLOUD_TOKEN}"
   # Deploy sources to S3
   - provider: script
-    script: aws --endpoint-url "${AWS_S3_ENDPOINT_URL}" s3 cp build/*.tar.gz "s3://tarantool-${TRAVIS_BRANCH}-src/" --acl public-read
+    script: make -f .travis.mk source_deploy
     skip_cleanup: true
     on:
       branch: "1.6"
-- 
GitLab