Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Jenkinsfile 3.0 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
  1. pipeline {
  2. agent any
  3. stages {
  4. stage('Trigger google cloud build') {
  5. when { branch 'main' }
  6. steps {
  7. googleCloudBuild credentialsId: 'project-talos', request: file('gcloudbuild.yaml')
  8. }
  9. }
  10. stage('Make docs') {
  11. when { not { branch 'main' } }
  12. steps {
  13. sh '''
  14. #!/bin/bash
  15. WORKING_DIR="$JENKINS_PATH_ON_HOST/workspace/$(basename $WORKSPACE)" . make-docs.sh
  16. '''
  17. }
  18. }
  19. stage('Cache busting') {
  20. when { branch 'main' }
  21. steps {
  22. sh 'gcloud compute url-maps invalidate-cdn-cache $LOAD_BALANCER_NAME --path "/docs/*"'
  23. }
  24. }
  25. stage('Update SDK') {
  26. when {
  27. branch 'main'
  28. anyOf {
  29. changeset 'theme/openapi/spec.yaml'
  30. expression { return currentBuild.number == 1 }
  31. }
  32. }
  33. steps {
  34. script {
  35. withCredentials([
  36. usernamePassword(credentialsId: 'github-jenkins-user',
  37. usernameVariable: 'username',
  38. passwordVariable: 'password')
  39. ]) {
  40. sh 'git config --global credential.helper cache'
  41. sh 'git config --global push.default simple'
  42. sh '''
  43. #!/bin/bash
  44. rm -rf api-clients
  45. git clone https://$username:$password@github.com/DagsHub/api-clients
  46. cd api-clients
  47. bash update_clients.sh
  48. git checkout -b update-clients-$BUILD_NUMBER
  49. git add .
  50. git config user.email "you@example.com"
  51. git config user.name "Jenkins"
  52. git commit -m "Update api clients"
  53. git push --set-upstream origin update-clients-$BUILD_NUMBER
  54. curl \
  55. -X POST \
  56. -H "Accept: application/vnd.github+json" \
  57. -H "Authorization: Bearer $password" \
  58. https://api.github.com/DagsHub/api-clients/pulls \
  59. -d '{"title":"Update API Clients","body":"Automated clients update duo to an update in the [docs](https://dagshub.com/DAGsHub-Official/dagshub-docs)","head":"DagsHub:update-clients-'"$BUILD_NUMBER"'","base":"main"}'
  60. '''
  61. }
  62. }
  63. }
  64. }
  65. }
  66. post {
  67. always {
  68. discordSend title: currentBuild.fullDisplayName, link: currentBuild.absoluteUrl, result: currentBuild.currentResult, webhookURL: "${DISCORD_WEBHOOK}"
  69. }
  70. }
  71. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...