Skip to content

Commit de84fff

Browse files
Revert "20371 set up ci for GitHub zenhub sdk (#25)" (#26)
This reverts commit 8dbe474.
1 parent 8dbe474 commit de84fff

File tree

6 files changed

+9
-177
lines changed

6 files changed

+9
-177
lines changed

Jenkinsfile

Lines changed: 0 additions & 102 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This library provides a convenient interface for interacting with GitHub and Zen
1212

1313
We follow [Semantic Versioning 2.0.0][semantic-versioning-2], as we do in most projects at ZIRO.
1414

15-
The version can be found in `version.txt`. YOU MUST BUMP THE VERSION WHEN MAKING CODE CHANGES.
15+
The version can be found in the [gradle build file][gradle-build-file].
1616

1717
We should follow the git-flow process as we do in other projects.
1818

@@ -79,30 +79,7 @@ To publish the SDK, you can run the following command:
7979
./gradlew publish
8080
```
8181

82-
### Development:
83-
8482
To publish a snapshot for use during development, you can run the following command:
8583
```bash
8684
./gradlew publish -Psnapshot
8785
```
88-
89-
This will publish a snapshot of the library to our internal Maven repository at https://repository.goziro.com/ with
90-
the name `<branchName>-SNAPSHOT`
91-
92-
### Merging Your Changes
93-
94-
Other projects ***SHOULD NOT*** be consuming snapshots (aside from locally during development). Instead, they should only consume
95-
proper releases. Publishing and tagging releases is handled by Jenkins. When you merge your changes to `develop`, it triggers a Jenkins
96-
job which builds and tests the repo, then attempts to tag the appropriate commit and publish a release on the nexus repository.
97-
98-
YOU MUST BUMP THE VERSION IN `./version.txt` WHEN MAKING CODE CHANGES FOR THIS SYSTEM TO WORK.
99-
100-
ZIRO-CLI MUST BE UPDATED TO CONSUME THE NEWEST VERSION OF
101-
102-
### Release Notes
103-
Once you merge your changes, CI will publish a new version to Nexus and tag the repo. The last thing to do is to go to:
104-
105-
https://github.com/Stack8/github-zenhub-sdk/releases
106-
107-
And publish a new release. Click draft a new release, and select your tag, the previous tag, and click generate release notes.
108-
Make sure "Set as the latest release" is selected, and publish your release. Now you're good to go!

build.gradle.kts

Lines changed: 8 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
1-
var currentVersion = file("version.txt").readText().trim()
2-
3-
fun getBranchName(): String {
4-
return try {
5-
val process = ProcessBuilder("git", "branch", "--show-current")
6-
.directory(rootDir)
7-
.start()
8-
process.inputStream.bufferedReader().readText().trim()
9-
} catch (e: Exception) {
10-
"unknown"
11-
}
12-
}
1+
var currentVersion = "5.5.0"
132

143
if (project.hasProperty("snapshot")) {
15-
val branchName = getBranchName()
16-
currentVersion = "${branchName}-SNAPSHOT"
4+
currentVersion = "${currentVersion}-SNAPSHOT"
175
}
186

197
plugins {
@@ -50,8 +38,12 @@ publishing {
5038
maven {
5139
url = uri("https://repository.goziro.com/repository/engineering/")
5240
credentials {
53-
username = System.getenv("SONATYPE_USERNAME") ?: ""
54-
password = System.getenv("SONATYPE_PASSWORD") ?: ""
41+
try {
42+
username = System.getenv("SONATYPE_USERNAME") as String
43+
password = System.getenv("SONATYPE_PASSWORD") as String
44+
} catch (e: NullPointerException) {
45+
throw Exception("SONATYPE_USERNAME and SONATYPE_PASSWORD environment variables are not set! Please see the README for instructions on how to do this.", e)
46+
}
5547
}
5648
}
5749
}
@@ -114,19 +106,3 @@ tasks.register("updateSchemas") {
114106
"downloadZenhubApolloSchemaFromIntrospection"
115107
)
116108
}
117-
118-
tasks.register("validatePublishCredentials") {
119-
group = "Publishing"
120-
description = "Validates that publishing credentials are set"
121-
doLast {
122-
val username = System.getenv("SONATYPE_USERNAME")
123-
val password = System.getenv("SONATYPE_PASSWORD")
124-
if (username.isNullOrBlank() || password.isNullOrBlank()) {
125-
throw GradleException("SONATYPE_USERNAME and SONATYPE_PASSWORD environment variables must be set for publishing. Please see the README for instructions.")
126-
}
127-
}
128-
}
129-
130-
tasks.withType<PublishToMavenRepository> {
131-
dependsOn("validatePublishCredentials")
132-
}

src/test/kotlin/github/GitHubClientTest.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
package github
22

33
import kotlin.test.assertEquals
4-
import org.junit.jupiter.api.Assumptions.assumeTrue
5-
import org.junit.jupiter.api.BeforeEach
64
import org.junit.jupiter.api.Test
75

86
class GitHubClientTest {
97
private val gitHubClient = GitHubClient()
108

11-
@BeforeEach
12-
fun checkApiToken() {
13-
assumeTrue(
14-
System.getenv("GITHUB_API_TOKEN") != null,
15-
"GITHUB_API_TOKEN not set - skipping integration tests")
16-
}
17-
189
@Test
1910
fun whenGetFileFromBranchThenFileIsNotEmpty() {
2011
val result = gitHubClient.getFileFromBranch(branch = "develop", filePath = "version.txt")

src/test/kotlin/zenhub/ZenHubClientTest.kt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,11 @@ package zenhub
22

33
import kotlin.test.assertEquals
44
import kotlin.test.assertTrue
5-
import org.junit.jupiter.api.Assumptions.assumeTrue
6-
import org.junit.jupiter.api.BeforeEach
75
import org.junit.jupiter.api.Test
86

97
class ZenHubClientTest {
108
private val zenHubClient = ZenHubClient()
119

12-
@BeforeEach
13-
fun checkApiToken() {
14-
assumeTrue(
15-
System.getenv("ZENHUB_GRAPHQL_TOKEN") != null,
16-
"ZENHUB_GRAPHQL_TOKEN not set - skipping integration tests")
17-
}
18-
1910
@Test
2011
fun whenIssueByInfoThenCorrectIssueIsReturned() {
2112
val issue =

version.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)