2019-07-03 01:20:46 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
echo imapsync_docker_timestamp_dockerfile
|
2021-08-04 21:14:36 +02:00
|
|
|
imapsync_docker_timestamp_dockerfile()
|
|
|
|
{
|
2019-07-03 01:20:46 +02:00
|
|
|
DATE_CURRENT=`date +%Y_%m_%d_%H_%M_%S`
|
|
|
|
echo $DATE_CURRENT
|
|
|
|
sed -i -e "/just_a_comment_to_force_update/s/comment_to_force_update.*/comment_to_force_update $DATE_CURRENT/" Dockerfile
|
|
|
|
ci -l -f -m"Changing timestamp to $DATE_CURRENT with imapsync_docker_timestamp_dockerfile" Dockerfile
|
|
|
|
}
|
|
|
|
|
|
|
|
echo imapsync_docker_build
|
2021-08-04 21:14:36 +02:00
|
|
|
imapsync_docker_build()
|
|
|
|
{
|
2020-04-11 01:15:57 +02:00
|
|
|
docker build -t gilleslamiral/imapsync . \
|
|
|
|
&& imapsync_docker_add_tag_version && echo Build SUCCEEDED || echo Build FAILED
|
|
|
|
|
|
|
|
echo
|
2019-07-03 01:20:46 +02:00
|
|
|
#docker run gilleslamiral/imapsync imapsync --testslive
|
|
|
|
#docker run gilleslamiral/imapsync imapsync --testslive6
|
|
|
|
# docker run gilleslamiral/imapsync imapsync --testslive6 --nossl2
|
|
|
|
}
|
|
|
|
|
2021-08-04 21:14:36 +02:00
|
|
|
echo imapsync_docker_version
|
|
|
|
imapsync_docker_version()
|
|
|
|
{
|
|
|
|
docker run gilleslamiral/imapsync imapsync --version
|
|
|
|
}
|
|
|
|
|
2020-04-11 01:15:57 +02:00
|
|
|
echo imapsync_docker_add_tag_version
|
2021-08-04 21:14:36 +02:00
|
|
|
imapsync_docker_add_tag_version()
|
|
|
|
{
|
2020-04-11 01:15:57 +02:00
|
|
|
docker images gilleslamiral/imapsync
|
|
|
|
echo
|
2021-08-04 21:14:36 +02:00
|
|
|
version=`imapsync_docker_version`
|
2020-04-11 01:15:57 +02:00
|
|
|
echo $version
|
|
|
|
docker tag gilleslamiral/imapsync:latest gilleslamiral/imapsync:$version
|
|
|
|
docker images gilleslamiral/imapsync
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-03 01:20:46 +02:00
|
|
|
echo imapsync_docker_testslive
|
2021-08-04 21:14:36 +02:00
|
|
|
imapsync_docker_testslive()
|
|
|
|
{
|
2020-04-11 01:15:57 +02:00
|
|
|
echo docker run gilleslamiral/imapsync imapsync --testslive
|
2019-07-03 01:20:46 +02:00
|
|
|
docker run gilleslamiral/imapsync imapsync --testslive
|
|
|
|
}
|
|
|
|
|
|
|
|
echo imapsync_docker_testslive6
|
2021-08-04 21:14:36 +02:00
|
|
|
imapsync_docker_testslive6()
|
|
|
|
{
|
2020-04-11 01:15:57 +02:00
|
|
|
echo docker run gilleslamiral/imapsync imapsync --testslive6 --ssl1 --ssl2
|
2019-07-03 01:20:46 +02:00
|
|
|
docker run gilleslamiral/imapsync imapsync --testslive6 --ssl1 --ssl2
|
|
|
|
}
|
|
|
|
|
|
|
|
echo imapsync_docker_tests
|
2021-08-04 21:14:36 +02:00
|
|
|
imapsync_docker_tests()
|
|
|
|
{
|
2020-04-11 01:15:57 +02:00
|
|
|
echo docker run gilleslamiral/imapsync imapsync --tests
|
2019-07-03 01:20:46 +02:00
|
|
|
docker run gilleslamiral/imapsync imapsync --tests
|
|
|
|
}
|
|
|
|
|
2021-08-04 21:14:36 +02:00
|
|
|
echo imapsync_docker_envfile
|
|
|
|
imapsync_docker_envfile()
|
|
|
|
{
|
|
|
|
docker run --env-file ./secret.txt gilleslamiral/imapsync imapsync \
|
|
|
|
--host1 test1.lamiral.info --user1 test1 \
|
|
|
|
--host2 test2.lamiral.info --user2 test2 --justlogin
|
|
|
|
}
|
|
|
|
|
2019-07-03 01:20:46 +02:00
|
|
|
echo docker_delete_all_images
|
2021-08-04 21:14:36 +02:00
|
|
|
docker_delete_all_images()
|
|
|
|
{
|
2019-07-03 01:20:46 +02:00
|
|
|
docker rm `docker ps -a -q`
|
|
|
|
docker rmi `docker images -q`
|
|
|
|
}
|
|
|
|
|
2020-04-11 01:15:57 +02:00
|
|
|
echo docker_system_prune
|
|
|
|
docker_system_prune()
|
|
|
|
{
|
|
|
|
docker system prune
|
|
|
|
}
|
|
|
|
|
2019-07-03 01:20:46 +02:00
|
|
|
echo docker_delete_dandling_images
|
2021-08-04 21:14:36 +02:00
|
|
|
docker_delete_dandling_images()
|
|
|
|
{
|
2019-07-03 01:20:46 +02:00
|
|
|
docker images
|
|
|
|
dandling_images=`docker images -f dangling=true -q`
|
|
|
|
exited_containers=`docker ps -a -f status=exited -q`
|
|
|
|
test -n "$exited_containers" && docker rm $exited_containers
|
|
|
|
test -n "$dandling_images" && docker rmi $dandling_images
|
|
|
|
docker images
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
echo imapsync_docker_rebuild_from_scratch
|
2021-08-04 21:14:36 +02:00
|
|
|
imapsync_docker_rebuild_from_scratch()
|
|
|
|
{
|
2019-07-03 01:20:46 +02:00
|
|
|
delete_all_images
|
|
|
|
docker images
|
|
|
|
imapsync_docker_build
|
|
|
|
}
|
|
|
|
|
|
|
|
echo imapsync_docker_upload
|
2021-08-04 21:14:36 +02:00
|
|
|
imapsync_docker_upload()
|
|
|
|
{
|
|
|
|
version=`imapsync_docker_version`
|
|
|
|
# upload only after successful tests
|
|
|
|
set -x \
|
|
|
|
&& rcsdiff imapsync \
|
|
|
|
&& imapsync_docker_testslive \
|
|
|
|
&& imapsync_docker_tests \
|
|
|
|
&& docker run gilleslamiral/imapsync true \
|
|
|
|
&& docker login --username=gilleslamiral --password=`cat $HOME/var/pass/secret.docker` \
|
|
|
|
&& docker push gilleslamiral/imapsync:latest \
|
|
|
|
&& docker push gilleslamiral/imapsync:$version \
|
|
|
|
&& set +x && echo imapsync push SUCCEEDED || echo imapsync push FAILED
|
|
|
|
set +x
|
2019-07-03 01:20:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|