Merge build 40 into master
This commit is contained in:
32
Jenkinsfile
vendored
32
Jenkinsfile
vendored
@@ -107,21 +107,23 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Mirror to Gitea') {
|
stage('Mirror to Gitea') {
|
||||||
steps {
|
steps {
|
||||||
withCredentials([usernamePassword(
|
sshagent(['edd05eb6-26b5-4c7b-a5cc-ea2ab899f4fa']) {
|
||||||
credentialsId: 'Jenkins-gitea',
|
withCredentials([usernamePassword(
|
||||||
usernameVariable: 'GITEA_USER',
|
credentialsId: 'Jenkins-gitea',
|
||||||
passwordVariable: 'GITEA_TOKEN')]) {
|
usernameVariable: 'GITEA_USER',
|
||||||
script {
|
passwordVariable: 'GITEA_TOKEN')]) {
|
||||||
sh '''
|
script {
|
||||||
git fetch origin
|
sh '''
|
||||||
git checkout master
|
git fetch origin
|
||||||
git reset --hard origin/master
|
git checkout master
|
||||||
git remote get-url master >/dev/null 2>&1 \
|
git reset --hard origin/master
|
||||||
&& git remote set-url master https://sourcecode.confdroid.com/confdroid/confdroid_ssh.git \
|
git remote get-url master >/dev/null 2>&1 \
|
||||||
|| git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_ssh.git
|
&& git remote set-url master https://sourcecode.confdroid.com/confdroid/confdroid_ssh.git \
|
||||||
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
|
|| git remote add master https://sourcecode.confdroid.com/confdroid/confdroid_ssh.git
|
||||||
push --force master refs/heads/master:refs/heads/master
|
git -c credential.helper="!f() { echo username=${GITEA_USER}; echo password=${GITEA_TOKEN}; }; f" \
|
||||||
'''
|
push --force master refs/heads/master:refs/heads/master
|
||||||
|
'''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user