build: auto promote master builds

This commit is contained in:
Bassam Tabbara committed 2017-04-04 17:02:25 -07:00
1 parent 42629f406f
commit 02b6ba11cb
4 files changed
+24 -1

No files matched your search

+9
View File
@@ -71,10 +71,19 @@ publish() {
echo uploading $file to S3
s3_upload ${RELEASE_DIR}/$file
# we will always tag master builds as latest. i.e. auto-promote master
if [[ "${RELEASE_CHANNEL}" == "master" ]]; then
s3_promote_file $file
fi
if [[ ${os} == "linux" ]]; then
file=$(get_archive_name $os $arch "debug")
echo uploading $file to S3
s3_upload ${RELEASE_DIR}/$file
if [[ "${RELEASE_CHANNEL}" == "master" ]]; then
s3_promote_file $file
fi
fi
}
+3 -1
View File
@@ -78,6 +78,8 @@ s3_upload() {
s3_promote_file() {
local filename=$1
aws s3 cp --only-show-errors s3://${RELEASE_S3_BUCKET}/master/${RELEASE_VERSION}/${filename} s3://${RELEASE_S3_BUCKET}/${RELEASE_CHANNEL}/${RELEASE_VERSION}/${filename}
if [[ "${RELEASE_CHANNEL}" != "master" ]]; then
aws s3 cp --only-show-errors s3://${RELEASE_S3_BUCKET}/master/${RELEASE_VERSION}/${filename} s3://${RELEASE_S3_BUCKET}/${RELEASE_CHANNEL}/${RELEASE_VERSION}/${filename}
fi
aws s3 cp --only-show-errors s3://${RELEASE_S3_BUCKET}/master/${RELEASE_VERSION}/${filename} s3://${RELEASE_S3_BUCKET}/${RELEASE_CHANNEL}/current/${filename}
}
+8
View File
@@ -73,6 +73,14 @@ publish_artifact() {
echo pushing docker container ${name}
docker push ${name}
# we will always tag master builds as latest. i.e. auto-promote master
if [[ "${RELEASE_CHANNEL}" == "master" ]]; then
local dst=${registry}$(get_image_name $os $arch $repo master-latest)
echo pushing docker container ${dst}
docker tag ${name} ${dst}
docker push ${dst}
fi
}
publish() {
+4
View File
@@ -12,6 +12,10 @@ EOF
publish() {
s3_upload ${RELEASE_DIR}/version
if [[ "${RELEASE_CHANNEL}" == "master" ]]; then
s3_promote_file version
fi
}
promote() {