Drop current version handling logic for deploy
New logic coming soon. See coop-cloud/organising#47 (comment).
This commit is contained in:
parent
e8651976ca
commit
946d1a068d
55
abra
55
abra
@ -440,24 +440,6 @@ if [ -z "$ABRA_ENV" ] && [ -f .env ] && type direnv > /dev/null 2>&1 && ! direnv
|
|||||||
error "direnv is blocked, run direnv allow"
|
error "direnv is blocked, run direnv allow"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
require_consent_for_update (){
|
|
||||||
if [ "$CONSENT_TO_UPDATE" = "false" ] && \
|
|
||||||
[ -n "$deployed_version" ] && \
|
|
||||||
[ "$ABRA_TYPE_VERSION" != "$deployed_version" ]; then
|
|
||||||
error "This deployment will be an app update from version ${deployed_version} -> ${ABRA_TYPE_VERSION}
|
|
||||||
Please pass the --update option to the deploy to deploy the update"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$CONSENT_TO_UPDATE" = "false" ] && \
|
|
||||||
[ "$ABRA_TYPE_VERSION" = "$deployed_version" ] && \
|
|
||||||
[ "$ABRA_TYPE_DIGEST" != "$deployed_digest" ]; then
|
|
||||||
error "The app version is the same but the image digest has changed from ${deployed_digest} -> ${ABRA_TYPE_DIGEST}
|
|
||||||
This should not happen! This may mean that the upstream app developers are overwriting their image tags
|
|
||||||
Get in touch and let's make the builds stable together: https://docs.cloud.autonomic.zone/contact/
|
|
||||||
Please pass the --update option to deploy the update anyway"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
###### Run-time loading
|
###### Run-time loading
|
||||||
|
|
||||||
load_abra_sh() {
|
load_abra_sh() {
|
||||||
@ -920,36 +902,7 @@ POWERED BY
|
|||||||
sub_app_deploy (){
|
sub_app_deploy (){
|
||||||
require_app_latest "$TYPE"
|
require_app_latest "$TYPE"
|
||||||
|
|
||||||
CONSENT_TO_UPDATE=$abra___update
|
echo "About to deploy:"
|
||||||
|
|
||||||
deployed_version_digest=$(docker service inspect \
|
|
||||||
-f "{{index .Spec.Labels \"coop-cloud.${STACK_NAME}.version\" }}" "${STACK_NAME}_app" 2>/dev/null)
|
|
||||||
deployed_version=$(echo "$deployed_version_digest" | cut -d- -f1)
|
|
||||||
deployed_digest=$(echo "$deployed_version_digest" | cut -d- -f2)
|
|
||||||
|
|
||||||
about_to_deploy_msg="About to deploy:"
|
|
||||||
version_msg=" Version: $(tput setaf 2)${ABRA_TYPE_VERSION} (digest: ${ABRA_TYPE_DIGEST})$(tput sgr0)"
|
|
||||||
|
|
||||||
if [ -n "$deployed_version" ] && [ -n "$deployed_digest" ]; then
|
|
||||||
if [ "$ABRA_TYPE_VERSION" == "$deployed_version" ] && [ "$ABRA_TYPE_DIGEST" == "$deployed_digest" ]; then
|
|
||||||
success "Nothing to deploy right now. Congratulations, you're on the latest version"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
require_consent_for_update
|
|
||||||
|
|
||||||
if [ "$ABRA_TYPE_VERSION" != "$deployed_version" ]; then
|
|
||||||
about_to_deploy_msg="About to deploy (NEW VERSION):"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$ABRA_TYPE_VERSION" != "$deployed_version" ]; then
|
|
||||||
version_msg=" Version: $(tput setaf 2)$deployed_version -> ${ABRA_TYPE_VERSION} (digest: $deployed_digest -> ${ABRA_TYPE_DIGEST})$(tput sgr0)"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
warning "Unable to detect deployed app version, please proceed with caution"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "$about_to_deploy_msg"
|
|
||||||
echo " Server: $(tput setaf 4)${SERVER}$(tput sgr0)"
|
echo " Server: $(tput setaf 4)${SERVER}$(tput sgr0)"
|
||||||
|
|
||||||
if [ "${COMPOSE_FILE/:/}" == "${COMPOSE_FILE}" ]; then
|
if [ "${COMPOSE_FILE/:/}" == "${COMPOSE_FILE}" ]; then
|
||||||
@ -967,10 +920,6 @@ sub_app_deploy (){
|
|||||||
echo " Domain: $(tput setaf 2)${DOMAIN}$(tput sgr0)"
|
echo " Domain: $(tput setaf 2)${DOMAIN}$(tput sgr0)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$ABRA_TYPE_VERSION" ] && [ -n "$ABRA_TYPE_DIGEST" ]; then
|
|
||||||
echo "$version_msg"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo " Stack: $(tput setaf 1)${STACK_NAME}$(tput sgr0)"
|
echo " Stack: $(tput setaf 1)${STACK_NAME}$(tput sgr0)"
|
||||||
|
|
||||||
prompt_confirm
|
prompt_confirm
|
||||||
@ -1694,7 +1643,7 @@ abra() {
|
|||||||
abra___secrets abra___status abra___no_tty abra___app_name \
|
abra___secrets abra___status abra___no_tty abra___app_name \
|
||||||
abra__subcommands_ abra___skip_update abra___skip_check \
|
abra__subcommands_ abra___skip_update abra___skip_check \
|
||||||
abra__backup_file_ abra___verbose abra___debug abra___help \
|
abra__backup_file_ abra___verbose abra___debug abra___help \
|
||||||
abra___update abra___branch abra___volumes abra__provider_ abra___type
|
abra___branch abra___volumes abra__provider_ abra___type
|
||||||
|
|
||||||
if ! type tput > /dev/null 2>&1; then
|
if ! type tput > /dev/null 2>&1; then
|
||||||
tput() {
|
tput() {
|
||||||
|
Loading…
Reference in New Issue
Block a user