Skip to content

Commit

Permalink
Don't lost GitHub configuration, push on GitHub first
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Nov 1, 2018
1 parent 3b68eb8 commit 39af1f1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 14 deletions.
9 changes: 2 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,13 @@ dockerBuild {
clean()
}
stage('Build') {
checkout scm

// Makes sure jenkins will not build his own commit
// Makes sure Jenkins will not build his own commit
if (sh(returnStdout: true, script: "git show --no-patch --format='%ae' HEAD") == 'ci@camptocamp.com') {
exit(0)
}
sh 'git config user.email ci@camptocamp.com'
sh 'git config user.name CI'
try {
sh 'git branch --delete --force ${BRANCH_NAME}'
} catch (Exception error) {}
sh 'git branch --delete --force ${BRANCH_NAME} || true'
sh 'git checkout -b ${BRANCH_NAME}'
sh 'git remote set-url origin git@github.com:camptocamp/c2cgeoportal.git'

Expand All @@ -59,7 +55,6 @@ dockerBuild {
sh './docker-run travis/short-make build'
}
stage('Tests') {
checkout scm
parallel 'Lint and test c2cgeoportal': {
sh './docker-run travis/empty-make help'
sh 'bash -c "test \\"`./docker-run id`\\" == \\"uid=0(root) gid=0(root) groups=0(root)\\""'
Expand Down
14 changes: 7 additions & 7 deletions travis/publish-docker
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ else
fi
fi

if [ ${COMMIT} == TRUE ]
then
git add travis/ci.yaml
git commit -m "Update the minor version"
git push origin ${BRANCH_NAME}
fi

for IMAGE in geomapfish-build-dev geomapfish-build
do
if [ "${TAG}" != "" ]
Expand Down Expand Up @@ -50,10 +57,3 @@ do
docker push camptocamp/geomapfish-qgisserver:gmf${MAJOR_VERSION}-qgis${QGIS_VERSION}
fi
done

if [ ${COMMIT} == TRUE ]
then
git add travis/ci.yaml
git commit -m "Update the minor version"
git push origin ${BRANCH_NAME}
fi

0 comments on commit 39af1f1

Please sign in to comment.