8000 Release 0.4 by sksat · Pull Request #49 · sksat/compose-cd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Release 0.4 #49

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Jan 20, 2022
34 changes: 32 additions & 2 deletions compose-cd
8000
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/bin/bash

COMPOSE_CD_VER_MAJOR='0'
COMPOSE_CD_VER_MINOR='4'
COMPOSE_CD_VER_PATCH='0'
COMPOSE_CD_VER_PRE=''

#function docker-compose(){
# local p=`pwd`
# echo "[compose-mock]:$p $1 $2"
Expand All @@ -8,7 +13,10 @@
function version() {
local compose_cd_ver

compose_cd_ver="v0.3.4"
compose_cd_ver="v${COMPOSE_CD_VER_MAJOR}.${COMPOSE_CD_VER_MINOR}.${COMPOSE_CD_VER_PATCH}"
if [ -n "${COMPOSE_CD_VER_PRE}" ]; then
compose_cd_ver="${compose_cd_ver}-${COMPOSE_CD_VER_PRE}"
fi
echo "version: ${compose_cd_ver}"
}

Expand Down Expand Up @@ -58,6 +66,14 @@ function load_global_config() {
fi
# shellcheck disable=SC1091
source /etc/compose-cd/config

# version compatibility check
if [ "${COMPOSE_CD_VER_MAJOR}" != "${VER_MAJOR}" ]; then
notify "major version mismatch!!!: ${COMPOSE_CD_VER_MAJOR} != ${VER_MAJOR}" "[warn] "
fi
if [ "${COMPOSE_CD_VER_MINOR}" != "${VER_MINOR}" ]; then
notify "minor version mismatch!!!: ${COMPOSE_CD_VER_MINOR} != ${VER_MINOR}" "[warn] "
fi
}

function load_config() {
Expand Down Expand Up @@ -218,6 +234,9 @@ ${expand}"
return 2
fi

# non top-level .compose-cd(monorepo): #30
a="$(git rev-parse --show-prefix)${a}"

# exact match
if git diff --name-only "${local_commit}" | grep "^${a}$"; then
is_restart=true
Expand Down Expand Up @@ -449,7 +468,18 @@ function install() {
if [ -z ${discord_webhook+x} ]; then read -rp "Discord webhook URL> " discord_webhook; fi

mkdir -p /etc/compose-cd
echo -e "SEARCH_ROOT=\"${search_root}\"\n\nGIT_PULL_USER=\"${git_pull_user}\"\n\nDISCORD_WEBHOOK=\"${discord_webhook}\"" | tee /etc/compose-cd/config
tee /etc/compose-cd/config <<EOS
VER_MAJOR="${COMPOSE_CD_VER_MAJOR}"
VER_MINOR="${COMPOSE_CD_VER_MINOR}"
VER_PATCH="${COMPOSE_CD_VER_PATCH}"
VER_PRE="${COMPOSE_CD_VER_PRE}"

SEARCH_ROOT="${search_root}"

GIT_PULL_USER="${git_pull_user}"

DISCORD_WEBHOOK="${discord_webhook}"
EOS

load_global_config
notify "notify test" "[test] "
Expand Down
0