Skip to content

Commit

Permalink
fix: git initialize script and jenkins file
Browse files Browse the repository at this point in the history
  • Loading branch information
alecszaharia committed Dec 19, 2022
1 parent 2b326b7 commit b476a82
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 6 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ pipeline {
sshagent (credentials: ['ssh_with_passphrase_provided']) {
sh("""
if git rev-parse --git-dir > /dev/null 2>&1; then
./jenkins/git-initialize.sh ${params.releaseBranch}
echo "The repo is already cloned"
git checkout .;
git fetch;
git clean -fd;
git checkout ${params.releaseBranch};
git reset --hard origin/${params.releaseBranch};
else
git config --global user.email "[email protected]
git config --global user.name "Jenkins jenkinovici
Expand Down
7 changes: 1 addition & 6 deletions jenkins/git-initialize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
echo -e "\nGiT Cleanup"
echo -e "-----------------------------------------------------------------------------"

git fetch;
git checkout .;
git fetch;
git clean -fd;

echo -e "\nCheckout: $1"
echo -e "-----------------------------------------------------------------------------"

git checkout $1;
git reset --hard origin/$1;

0 comments on commit b476a82

Please sign in to comment.