add sync_latest_es function to update tubearchivist-es:latest container

This commit is contained in:
simon 2022-03-31 14:47:19 +07:00
parent 4eb2fb01d9
commit 607d9b3030
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4

View File

@ -100,6 +100,33 @@ function validate {
} }
# update latest tag compatible es for set and forget
function sync_latest_es {
printf "\nsync new es version:\n"
read -r VERSION
if [[ $(systemctl is-active docker) != 'active' ]]; then
echo "starting docker"
sudo systemctl start docker
fi
sudo docker image pull docker.elastic.co/elasticsearch/elasticsearch:"$VERSION"
sudo docker tag \
docker.elastic.co/elasticsearch/elasticsearch:"$VERSION" \
bbilly1/tubearchivist-es
sudo docker tag \
docker.elastic.co/elasticsearch/elasticsearch:"$VERSION" \
bbilly1/tubearchivist-es:"$VERSION"
sudo docker push bbilly1/tubearchivist-es
sudo docker push bbilly1/tubearchivist-es:"$VERSION"
}
# publish unstable tag to docker # publish unstable tag to docker
function sync_unstable { function sync_unstable {
@ -153,23 +180,23 @@ function sync_docker {
} }
# check package versions in requirements.txt for updates
python version_check.py
if [[ $1 == "blackhole" ]]; then if [[ $1 == "blackhole" ]]; then
sync_blackhole sync_blackhole
elif [[ $1 == "test" ]]; then elif [[ $1 == "test" ]]; then
sync_test "$2" sync_test "$2"
elif [[ $1 == "validate" ]]; then elif [[ $1 == "validate" ]]; then
# check package versions in requirements.txt for updates
python version_check.py
validate "$2" validate "$2"
elif [[ $1 == "docker" ]]; then elif [[ $1 == "docker" ]]; then
sync_docker sync_docker
sync_unstable sync_unstable
elif [[ $1 == "unstable" ]]; then elif [[ $1 == "unstable" ]]; then
sync_unstable sync_unstable
elif [[ $1 == "es" ]]; then
sync_latest_es
else else
echo "valid options are: blackhole | test | validate | docker | unstable" echo "valid options are: blackhole | test | validate | docker | unstable | es"
fi fi