-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrelease.sh
executable file
·57 lines (49 loc) · 1.3 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
52
53
54
55
56
57
#!/bin/bash
# docker hub info
username=ntaylor22
imagename=megatron
# 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
# rebuild images and bump docker versions
echo "Building docker images..."
docker/build
echo "Docker images built."
# push images to hub
echo "Pushing docker images..."
echo "Password hint:"
cat creds/docker_hint
docker login -u ntaylor22
docker push ntaylor22/megatron:$new_version &
wait
docker push ntaylor22/megatron &
wait
echo "Docker images pushed."
# get new version
echo "Current version number: $version"
read -p "New version number: " new_version
sleep 1
# change version in setup.py
sed -i "s/$version/$new_version/g" setup.py
# bump version, push
echo "Committing version change..."
echo $new_version > VERSION
git add VERSION setup.py
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."
# re-run setup and push to pypi
python3 setup.py sdist
echo "Pushing to pypi..."
echo "Username is ntaylorwss"
echo "Password hint:"
cat creds/pypi_hint
twine upload dist/*
echo "Pushed to pypi."
echo "Successful release!"