Compare commits
3 Commits
v-0.1-beta
...
master
Author | SHA1 | Date |
---|---|---|
kolaente | e52b76ee3d | |
konrad | 6794595b5a | |
konrad | 40b3658aac |
|
@ -0,0 +1,22 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) [year] [fullname]
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
17
Readme.md
17
Readme.md
|
@ -29,6 +29,23 @@ branch_name=refs/heads/master
|
|||
|
||||
# Troubleshooting
|
||||
|
||||
### "error decoding response"
|
||||
|
||||
Make sure the request is made with "application/x-www-urlencoded"
|
||||
|
||||
### Error 127
|
||||
|
||||
You recive an errormessage like this:
|
||||
|
||||
```
|
||||
2017/04/29 16:51:51 Recived payload, Secret: m3VScr9st09y , Ref: refs/heads/master
|
||||
2017/04/29 16:51:51 Recived corresponding secret: m3VScr9st09y
|
||||
2017/04/29 16:51:51 Starting update...
|
||||
2017/04/29 16:51:51 exit status 127
|
||||
```
|
||||
|
||||
Make sure the `deploy.sh` exists in the same folder as your binary and is executable.
|
||||
|
||||
### Not Cloning - the script runs pretty fast but wont clone
|
||||
|
||||
Check the permissions of your keyfile. They should be 600, otherwise the ssh-agent will ignore the keyfile and won't clone:
|
||||
|
|
|
@ -10,13 +10,14 @@ while getopts ':k:g:d:c:' OPTION ; do
|
|||
esac
|
||||
done
|
||||
|
||||
#echo "-----------------------------"
|
||||
#echo "Started at:"
|
||||
#date
|
||||
#echo "Key: ${KEY}"
|
||||
#echo "Git-Url: ${GIT_URL}"
|
||||
#echo "Deploy-Dir: ${DEPLOY_DIR}"
|
||||
#echo "----------------------------"
|
||||
echo "-----------------------------"
|
||||
echo "Started at:"
|
||||
date
|
||||
echo "Key: ${KEY}"
|
||||
echo "Git-Url: ${GIT_URL}"
|
||||
echo "Deploy-Dir: ${DEPLOY_DIR}"
|
||||
echo "----------------------------"
|
||||
echo ""
|
||||
|
||||
#Check for Key
|
||||
if [ -z "$KEY" ]
|
||||
|
@ -35,15 +36,16 @@ fi
|
|||
#Check for deploy-path
|
||||
if [ -z "$DEPLOY_DIR" ]
|
||||
then
|
||||
echo "You must provide a deploydir path (via -c /path/to/deploy/dir)!"
|
||||
echo "You must provide a deploydir path (via -d /path/to/deploy/dir)!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -Rf /tmp/git-deploy
|
||||
ssh-agent bash -c "ssh-add ${KEY}; git clone ${GIT_URL} /tmp/git-deploy"
|
||||
rm -Rf /tmp/git-deploy/.git
|
||||
rm -Rf ${DEPLOY_DIR}/.* 2> /dev/null
|
||||
rm -Rf ${DEPLOY_DIR}/*
|
||||
mv ${DEPLOY_DIR} ${DEPLOY_DIR}.old
|
||||
#rm -Rf ${DEPLOY_DIR}/.* 2> /dev/null
|
||||
#rm -Rf ${DEPLOY_DIR}/*
|
||||
|
||||
mv -fT /tmp/git-deploy ${DEPLOY_DIR}
|
||||
#cp -urfv /tmp/git-deploy/* ${DEPLOY_DIR}/*
|
||||
|
@ -51,9 +53,10 @@ rm -rf /tmp/git-deploy
|
|||
|
||||
if [ ! -z "$DCONTAINER_NAME" ]
|
||||
then
|
||||
docker restart $DCONTAINER_NAME
|
||||
sudo docker restart $DCONTAINER_NAME
|
||||
fi
|
||||
|
||||
#echo "Finished at:"
|
||||
#date
|
||||
#echo "-----------------------------"
|
||||
echo ""
|
||||
echo "Finished at:"
|
||||
date
|
||||
echo "-----------------------------"
|
Loading…
Reference in New Issue