This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1. Create service account | |
#. * Service Account Token Creator | |
#. * Artifact Registry Writer | |
# 2. Generate service account key | |
#. * In GitHub project -> Settings -> Secrets -> Actions -> New Repository Secret | |
#. Name: GCP_CREDENTIALS | |
#. Value: key.json contents | |
# 3. Create repo in artifact repository | |
#. * Name: $env.REPOSITORY below | |
#. * Region: $env.GAR_LOCATION below |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gcloud projects get-iam-policy $GCP_PROJECT_NAME --flatten="bindings[].members" --format="value(bindings.role)" --filter="bindings.members=serviceAccount:<projectId>[email protected]" | |
gcloud projects get-iam-policy $GCP_PROJECT_NAME \ | |
--flatten="bindings[].members" \ | |
--format="value(bindings.role)" \ | |
--filter="bindings.members=serviceAccount:<projectId>[email protected]" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
public class IntegrationTestApp { | |
public static void main(String[] args) { | |
ConfigurableApplicationContext appContext = new SpringApplicationBuilder() | |
.initializers((ApplicationContextInitializer<GenericApplicationContext>) context -> | |
context.registerBean(Junit5Runner.class, | |
() -> new Junit5Runner(ExplicitlyDeclaredTest.class)) | |
) | |
.sources(IntegrationTestApp.class) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jivimberg.sqs.published | |
import kotlinx.coroutines.CancellationException | |
import kotlinx.coroutines.CoroutineScope | |
import kotlinx.coroutines.isActive | |
import kotlinx.coroutines.yield | |
import java.lang.Thread.currentThread | |
suspend fun CoroutineScope.repeatUntilCancelled(block: suspend () -> Unit) { | |
while (isActive) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.gradle.caching=true | |
org.gradle.console=verbose | |
org.gradle.parallel=true | |
org.gradle.warning.mode=all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using id 'com.palantir.git-version' version '0.11.0' | |
export V=$(grep build.version rest-api/build/resources/main/META-INF/build-info.properties | cut -d '=' -f2) | |
echo ${V%.dirty} > rest-api/version.txt | |
Due to https://github.com/palantir/gradle-git-version/issues/28 | |
when using submodules, every version was "dirty". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.nio.charset.StandardCharsets; | |
import java.util.List; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.boot.web.client.RestTemplateCustomizer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// read a file in classpath | |
private fun fileToLines(classpathResource: String): List<String> { | |
val output = ByteArrayOutputStream() | |
ClassPathResource(classpathResource).inputStream.use { | |
it.copyTo(output) | |
} | |
return output.toString().split("\n") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convenience annotation for a Spring Boot Test + Junit5 + per class lifecycle | |
*/ | |
@Target(ElementType.TYPE) | |
@Documented | |
@Inherited | |
@Retention(RetentionPolicy.RUNTIME) | |
@ExtendWith(SpringExtension.class) | |
@TestInstance(TestInstance.Lifecycle.PER_CLASS) | |
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SpringBootApplication | |
class BitsApp | |
fun main(args: Array<String>) { | |
val context = SpringApplicationBuilder().initializers( | |
beans { | |
bean { | |
Junit5Runner(listOf( | |
FirstTests::class.java, |
NewerOlder