Skip to content
Snippets Groups Projects
  • Cam Saul's avatar
    aaf1b601
    Upgrade Liquibase to latest version; remove final Java source file and need... · aaf1b601
    Cam Saul authored
    Upgrade Liquibase to latest version; remove final Java source file and need for `clojure -X:deps prep` (#20611)
    
    * Upgrade Liquibase to latest version
    
    * Try adjusting log
    
    * Fix checksums for the TWO migrations with ID = 32
    
    * FINALLY get Liquibase to use Log4j2
    
    * Set Liquibase ConsoleUIService OutputStream to null OutputStream
    
    * Manually define a package for our H2 proxy class so Java 8 works
    
    * Fix package-name determination code
    
    * Update migrations file spec
    
    * `databasechangelog` shouldn't be upper-case
    
    * Lower-case quartz table names
    
    * More MySQL fixes :wrench:
    
    * Properties for all the Quartz tables :cry:
    
    * Formatting tweaks [ci skip]
    
    * Revert a few more busted changes
    
    * Fix more busted changes
    
    * Bump Liquibase version to 4.8.0 to fix MySQL defaultValueBoolean bug
    
    * OMG I think I finally fixed MySQL
    
    * Remove Java source file and prep-deps code
    
    * Remove two more references to bin/prep.sh
    
    * Minor cleanup
    
    * Revert unneeded changes
    
    * Fix busted indentation
    
    * Don't search inside java/ anymore since it's G-O-N-E
    
    * Appease the namespace linter
    
    * Update src/metabase/db/liquibase/h2.clj
    Upgrade Liquibase to latest version; remove final Java source file and need...
    Cam Saul authored
    Upgrade Liquibase to latest version; remove final Java source file and need for `clojure -X:deps prep` (#20611)
    
    * Upgrade Liquibase to latest version
    
    * Try adjusting log
    
    * Fix checksums for the TWO migrations with ID = 32
    
    * FINALLY get Liquibase to use Log4j2
    
    * Set Liquibase ConsoleUIService OutputStream to null OutputStream
    
    * Manually define a package for our H2 proxy class so Java 8 works
    
    * Fix package-name determination code
    
    * Update migrations file spec
    
    * `databasechangelog` shouldn't be upper-case
    
    * Lower-case quartz table names
    
    * More MySQL fixes :wrench:
    
    * Properties for all the Quartz tables :cry:
    
    * Formatting tweaks [ci skip]
    
    * Revert a few more busted changes
    
    * Fix more busted changes
    
    * Bump Liquibase version to 4.8.0 to fix MySQL defaultValueBoolean bug
    
    * OMG I think I finally fixed MySQL
    
    * Remove Java source file and prep-deps code
    
    * Remove two more references to bin/prep.sh
    
    * Minor cleanup
    
    * Revert unneeded changes
    
    * Fix busted indentation
    
    * Don't search inside java/ anymore since it's G-O-N-E
    
    * Appease the namespace linter
    
    * Update src/metabase/db/liquibase/h2.clj
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
clear-outdated-cpcaches.sh 1.57 KiB
#! /usr/bin/env bash

set -euo pipefail

script_directory=`dirname "${BASH_SOURCE[0]}"`

# This function will clear all the .cpcache directories if any deps.edn file is newer than any of them.
clear_outdated_cpcaches() {
    echo "Clearing outdated .cpcache directories if needed..."

    # switch to project root directory if we're not already there
    cd "$script_directory/.."
    project_root=`pwd`

    cpcaches=`find bin modules -type d -name .cpcache`
    if [ -d .cpcache ]; then
        cpcaches=".cpcache $cpcaches"
    fi
    if [ -z "$cpcaches" ]; then
        echo "No .cpcache directories found; nothing to do"
        return 0
    fi

    deps_edns="deps.edn $(find bin modules -type f -name deps.edn)"

    # find the OLDEST cpcache and NEWEST deps.edn files.
    oldest_cpcache=""
    for cpcache in $cpcaches; do
        if [ -z "$oldest_cpcache" ] || [ "$cpcache" -ot "$oldest_cpcache" ]; then
            oldest_cpcache="$cpcache"
        fi
    done

    newest_deps_edn=""
    for deps_edn in $deps_edns; do
        if [ -z "$newest_deps_edn" ] || [ "$deps_edn" -nt "$newest_deps_edn" ]; then
            newest_deps_edn="$deps_edn"
        fi
    done

    # if the newest deps.edn is newer than the *ANY* of the cpcaches, clear all the cpcaches.
    if [ "$newest_deps_edn" -nt "$oldest_cpcache" ]; then
        echo "$newest_deps_edn is newer than $oldest_cpcache; deleting all .cpcache directories"
        for cpcache in $cpcaches; do
            echo "rm -rf $cpcache"
            rm -rf "$cpcache"
        done
    else
        echo ".cpcache directories are up to date."
    fi
}