Tarantool development patches archive
 help / color / mirror / Atom feed
* [Tarantool-patches] [PATCH v2] gitlab-ci: save sources to new S3 location
@ 2020-09-11 13:02 Alexander V. Tikhonov
  0 siblings, 0 replies; only message in thread
From: Alexander V. Tikhonov @ 2020-09-11 13:02 UTC (permalink / raw)
  To: Kirill Yukhin, Sergey Bronnikov; +Cc: tarantool-patches

Changed S3 location for sources tarballs. Also added ability to
create S3 directory for the tarballs if it was not existed.
---

Github: https://github.com/tarantool/tarantool/tree/avtikhon/src-s3-new

 .gitlab.mk | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/.gitlab.mk b/.gitlab.mk
index 0ce978063..2a7b4d90b 100644
--- a/.gitlab.mk
+++ b/.gitlab.mk
@@ -108,6 +108,7 @@ GIT_DESCRIBE=$(shell git describe HEAD)
 MAJOR_VERSION=$(word 1,$(subst ., ,$(GIT_DESCRIBE)))
 MINOR_VERSION=$(word 2,$(subst ., ,$(GIT_DESCRIBE)))
 BUCKET="$(MAJOR_VERSION).$(MINOR_VERSION)"
+S3_BUCKET_URL="s3://tarantool_repo/sources/$(BUCKET)"
 
 deploy_prepare:
 	[ -d packpack ] || \
@@ -130,8 +131,13 @@ source: deploy_prepare
 	TARBALL_COMPRESSOR=gz packpack/packpack tarball
 
 source_deploy: source
-	aws --endpoint-url "${AWS_S3_ENDPOINT_URL}" s3 cp build/*.tar.gz \
-		"s3://tarantool.${BUCKET}.src/" --acl public-read
+	( aws --endpoint-url "${AWS_S3_ENDPOINT_URL}" s3 ls "${S3_BUCKET_URL}/" || \
+		( rm -rf "${BUCKET}" ; mkdir "${BUCKET}" &&                        \
+			aws --endpoint-url "${AWS_S3_ENDPOINT_URL}"                \
+				s3 mv "${BUCKET}" "${S3_BUCKET_URL}" --recursive   \
+				--acl public-read ) ) &&                           \
+		aws --endpoint-url "${AWS_S3_ENDPOINT_URL}"                        \
+			s3 cp build/*.tar.gz "${S3_BUCKET_URL}/" --acl public-read
 
 # ###################
 # Performance testing
-- 
2.17.1

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-11 13:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 13:02 [Tarantool-patches] [PATCH v2] gitlab-ci: save sources to new S3 location Alexander V. Tikhonov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox