8000 Save installed version into config file by sksat · Pull Request #48 · sksat/compose-cd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Save installed version into config file #48

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 4 commits into from
Jan 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions compose-cd
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='3'
COMPOSE_CD_VER_PATCH='4'
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 @@ -452,7 +460,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