Getting list of tables on servers and counts records
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

52 lines
1.3 KiB

  1. node {
  2. checkout scm
  3. def registry = "registry.blindage.org"
  4. def tag = env.TAG_NAME
  5. def image
  6. def repository = "compare-pg"
  7. def image_name = "${repository}:${tag}"
  8. stage("Tests") {
  9. sh "docker run --rm -v jenkins_jenkins-data:/var/jenkins_home golang:1.14 /bin/sh -c 'cd ${WORKSPACE} && go test -mod vendor -v ./...'"
  10. }
  11. stage("Build binary") {
  12. sh "docker run --rm -v jenkins_jenkins-data:/var/jenkins_home golang:1.14 /bin/sh -c 'cd ${WORKSPACE} && go build -mod vendor'"
  13. }
  14. stage("Build image") {
  15. try {
  16. sh "docker build -t ${image_name} ."
  17. image = docker.image(image_name)
  18. } catch (Exception e) {
  19. error("Failed to build image")
  20. }
  21. }
  22. stage("Build deb package") {
  23. sh "./build/package/build.sh"
  24. archiveArtifacts "compare-pg-${tag}.deb"
  25. sh "mv *.deb /var/packages/"
  26. }
  27. stage("Push Image") {
  28. try {
  29. docker.withRegistry("https://${registry}", "registry") {
  30. image.push()
  31. }
  32. } catch(Exception e) {
  33. error("Failed to push image")
  34. } finally {
  35. sh "docker rmi ${registry}/${image_name} || true"
  36. }
  37. }
  38. stage("Deploy") {
  39. echo "No deploy"
  40. }
  41. }