-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease.sh
executable file
·51 lines (44 loc) · 1.2 KB
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# docker hub info
username=ntaylor22
imagecpu=pavlov-cpu
imagegpu=pavlov-gpu
# ensure up to date
version=$(<VERSION)
if ! git diff-index --quiet HEAD -- # true means local changes
then
echo "You have local changes not on remote. Please commit and push before bumping."
exit
fi
# get new version
echo "Current version number: $version"
read -p "New version number: " new_version
sleep 1
# bump version, push
echo "Committing version change..."
echo $new_version > VERSION
git add VERSION
git commit -m "version $new_version"
git tag -a "$new_version" -m "version $new_version"
git push origin master
git push origin master --tags
echo "Version change committed."
# rebuild images and bump docker versions
echo "Building docker images..."
docker/build --no-cache
echo "Docker images built."
# push images to hub
echo "Pushing docker images..."
docker login -u ntaylor22
docker push ntaylor22/pavlov-gpu:$new_version &
docker push ntaylor22/pavlov-cpu:$new_version &
wait
docker push ntaylor22/pavlov-gpu &
docker push ntaylor22/pavlov-cpu &
wait
echo "Docker images pushed."
# re-run setup and push to pypi
echo "Pushing to pypi..."
python3 setup.py sdist
twine upload dist/*
echo "Pushed to pypi."