Created
June 4, 2022 14:57
-
-
Save isweluiz/ce9ac5bce972e4cf114a6348da7dccc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Automating push with just a single bash command | |
```bash | |
vim git-push | |
``` | |
```bash | |
echo "Enter your message" | |
read message | |
git add --all . | |
git commit -m"${message}" | |
if [ -n "$(git status - porcelain)" ]; | |
then | |
echo "IT IS CLEAN" | |
else | |
git status | |
echo "Pushing data to remote server!!!" | |
git push -u origin master | |
fi | |
``` | |
```bash | |
chmod +x git-push | |
``` | |
```bash | |
$ sudo ln -s /home/x/Documents/k8s/ansible-rundeck/git-push.sh /usr/local/bin/git-push | |
$ git-push | |
Enter your message | |
New push-script | |
[master b51a5b0] New push-script | |
2 files changed, 12 insertions(+) | |
create mode 100755 git-push.sh | |
rename kubernets-nodes-reboot.yml => playbooks/kubernets-nodes-reboot.yml (100%) | |
IT IS CLEAN | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment