aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-docs/build.gradle
blob: 73b3811f8a01006d2bbdc0cb5d65ece8c5117790 (plain)
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
/**
 * This module is building the zip file containing the static web site
 */

sonarqube {
  skipProject = true
}

group = 'com.sonarsource.sonarqube'

clean.doFirst {
  delete "${project.baseDir}/public/"
}

yarn_run {
  environment = [ GATSBY_DOCS_VERSION: version ]
  inputs.property('version', version)
  inputs.dir('src').withPathSensitivity(PathSensitivity.RELATIVE)
  ['gatsby-config.js', 'gatsby-node.js', 'package.json', 'yarn.lock', 'tsconfig.json'].each {
    inputs.file(it).withPathSensitivity(PathSensitivity.RELATIVE)
  }
  outputs.dir('public')
  outputs.cacheIf { true }
  args = ['build']
}

task "yarn_lint-report"() {

}

task zip(type: Zip) {
  def archiveDir = "$version"
  duplicatesStrategy DuplicatesStrategy.EXCLUDE
  baseName "sonar-docs"

  into("${archiveDir}") {
    from tasks.getByName('yarn_run').outputs
  }
}
zip.dependsOn yarn_run
assemble.dependsOn zip

publishing {
  publications {
    docs(MavenPublication) {
      artifactId 'sonar-docs'
      artifact zip
    }
  }
}

artifactory {
  publish {
    contextUrl = System.getenv('ARTIFACTORY_URL')
    repository {
      repoKey = System.getenv('ARTIFACTORY_DEPLOY_REPO_PRIVATE')
      username = System.getenv('ARTIFACTORY_DEPLOY_USERNAME_PRIVATE')
      password = System.getenv('ARTIFACTORY_DEPLOY_PASSWORD_PRIVATE')
    }
  }
}

artifactoryPublish {
  skip = false
  publishPom = false
  publications(publishing.publications.docs)
}