Skip to content

Commit

Permalink
Merge branch 'master' into upgradeTomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmcintosh authored Feb 20, 2024
2 parents d668911 + 4089019 commit 32a6fa5
Show file tree
Hide file tree
Showing 95 changed files with 2,220 additions and 796 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/wrapper-validation-action@v2
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fi
echo "exactly one branch ($BRANCHES)"
echo BRANCH=$BRANCHES >> $GITHUB_ENV
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Pause before dependency bump
run: sleep 600
- name: Trigger dependency bump workflow
uses: peter-evans/repository-dispatch@v2
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.SPINNAKER_GITHUB_TOKEN }}
event-type: bump-dependencies
Expand Down
6 changes: 2 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,12 @@ subprojects {
if (it.name != "kork-bom" && it.name != "spinnaker-dependencies") {
apply plugin: 'java-library'
test {
useJUnitPlatform {
includeEngines "spek2", "junit-vintage", "junit-jupiter"
}
useJUnitPlatform()
}
dependencies {
annotationProcessor(platform(project(":spinnaker-dependencies")))
annotationProcessor("org.springframework.boot:spring-boot-configuration-processor")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine")
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
}
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kotlinVersion=1.4.32
kotlinVersion=1.5.32
org.gradle.parallel=true
spinnakerGradleVersion=8.31.0
spinnakerGradleVersion=8.32.1
targetJava11=true
includeRuntimes=actuator,core,eureka,retrofit,secrets-aws,secrets-gcp,stackdriver,swagger,tomcat,web
4 changes: 3 additions & 1 deletion gradle/kotlin-test.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
apply plugin: "kotlin"

dependencies {
testImplementation(platform(project(":spinnaker-dependencies")))
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"

testImplementation "org.junit.jupiter:junit-jupiter-api"
Expand All @@ -29,13 +30,14 @@ dependencies {
testImplementation "dev.minutest:minutest"
testImplementation "io.mockk:mockk"

testRuntimeOnly(platform(project(":spinnaker-dependencies")))
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
}

compileTestKotlin {
kotlinOptions {
languageVersion = "1.4"
languageVersion = "1.5"
jvmTarget = "11"
}
}
6 changes: 4 additions & 2 deletions gradle/kotlin.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ apply plugin: "kotlin-spring"
apply plugin: "io.gitlab.arturbosch.detekt"

dependencies {
testImplementation(platform(project(":spinnaker-dependencies")))
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.platform:junit-platform-runner"
testImplementation "org.spekframework.spek2:spek-dsl-jvm"
Expand All @@ -28,6 +29,7 @@ dependencies {
testImplementation "dev.minutest:minutest"
testImplementation "io.mockk:mockk"

testRuntimeOnly(platform(project(":spinnaker-dependencies")))
testRuntimeOnly "org.junit.platform:junit-platform-launcher"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
testRuntimeOnly "org.junit.vintage:junit-vintage-engine"
Expand All @@ -37,14 +39,14 @@ dependencies {

compileKotlin {
kotlinOptions {
languageVersion = "1.4"
languageVersion = "1.5"
jvmTarget = "11"
}
}

compileTestKotlin {
kotlinOptions {
languageVersion = "1.4"
languageVersion = "1.5"
jvmTarget = "11"
}
}
Expand Down
2 changes: 2 additions & 0 deletions gradle/lombok.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
dependencies {
compileOnly "org.projectlombok:lombok"
compileOnly(platform(project(":spinnaker-dependencies")))
annotationProcessor "org.projectlombok:lombok"
annotationProcessor(platform(project(":spinnaker-dependencies")))
testCompileOnly "org.projectlombok:lombok"
testCompileOnly(platform(project(":spinnaker-dependencies")))
testAnnotationProcessor(platform(project(":spinnaker-dependencies")))
testAnnotationProcessor "org.projectlombok:lombok"
}
1 change: 1 addition & 0 deletions kork-actuator/kork-actuator.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ apply plugin: "java-library"
apply from: "$rootDir/gradle/kotlin-test.gradle"

dependencies {
compileOnly(platform(project(":spinnaker-dependencies")))
implementation(platform(project(":spinnaker-dependencies")))
implementation "org.springframework.security:spring-security-core"
implementation "org.springframework.boot:spring-boot-starter-security"
Expand Down
1 change: 1 addition & 0 deletions kork-artifacts/kork-artifacts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ dependencies {
testImplementation "org.junit.jupiter:junit-jupiter-api"
testImplementation "org.junit.jupiter:junit-jupiter-params"
testImplementation "org.mockito:mockito-core"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation project(":kork-core")
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,25 @@ To enable artifact storage, simple add this to your `spinnaker-local.yml` file

```yaml
artifact-store:
enabled: true
type: s3
s3:
enabled: true
bucket: some-artifact-store-bucket
```
### Rosco and Helm
If any pipelines are passing artifact references to bake stages as a parameter,
enabling this field will allow those URIs to be expanded to the full
references:
```yaml
artifact-store:
type: s3
helm:
expandOverrides: true
```
## Storage Options
### S3
Expand All @@ -97,7 +110,7 @@ against AWS.
```yaml
artifact-store:
enabled: true
type: s3
s3:
enabled: true
profile: dev # if you want to authenticate using a certain profile
Expand All @@ -119,7 +132,7 @@ Next enable the configuration

```yaml
artifact-store:
enabled: true
type: s3
s3:
enabled: true
url: http://localhost:8333 # this URL will be used to make S3 API requests to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,31 @@
@Builder
@Getter
public class ArtifactReferenceURI {
private final String scheme;
/**
* uriScheme is used as an HTTP scheme to let us further distinguish a String that is a URI to an
* artifact. This is helpful in determining what is an artifact since sometimes we are only given
* a string rather than a full artifact.
*/
private static final String uriScheme = "ref://";

private final List<String> uriPaths;

public String uri() {
return String.format("%s://%s", scheme, paths());
return uriScheme + paths();
}

public String paths() {
return Strings.join(uriPaths, '/');
}

/** Used to determine whether a String is in the artifact reference URI format. */
public static boolean is(String reference) {
return reference.startsWith(uriScheme);
}

public static ArtifactReferenceURI parse(String reference) {
String noSchemeURI =
StringUtils.removeStart(reference, ArtifactStoreURIBuilder.uriScheme + "://");
String noSchemeURI = StringUtils.removeStart(reference, uriScheme);
String[] paths = StringUtils.split(noSchemeURI, '/');
return ArtifactReferenceURI.builder()
.scheme(ArtifactStoreURIBuilder.uriScheme)
.uriPaths(Arrays.asList(paths))
.build();
return ArtifactReferenceURI.builder().uriPaths(Arrays.asList(paths)).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,45 @@
package com.netflix.spinnaker.kork.artifacts.artifactstore;

import com.netflix.spinnaker.kork.artifacts.model.Artifact;
import java.util.concurrent.atomic.AtomicBoolean;
import lombok.Getter;
import lombok.extern.log4j.Log4j2;

/**
* ArtifactStore is an interface that allows for different types of artifact storage to be used
* during runtime
*/
public abstract class ArtifactStore {
/** ensures the singleton has only been set once */
private static final AtomicBoolean singletonSet = new AtomicBoolean(false);
/** ArtifactStore allows for different types of artifact storage to be used during runtime */
@Log4j2
public class ArtifactStore implements ArtifactStoreGetter, ArtifactStoreStorer {
@Getter private static volatile ArtifactStore instance = null;

private final ArtifactStoreGetter artifactStoreGetter;

private final ArtifactStoreStorer artifactStoreStorer;

@Getter private static ArtifactStore instance = null;
public ArtifactStore(
ArtifactStoreGetter artifactStoreGetter, ArtifactStoreStorer artifactStoreStorer) {
this.artifactStoreGetter = artifactStoreGetter;
this.artifactStoreStorer = artifactStoreStorer;
}

/** Store an artifact in the artifact store */
public Artifact store(Artifact artifact) {
return artifactStoreStorer.store(artifact);
}

public abstract Artifact store(Artifact artifact);
/**
* get is used to return an artifact with some id, while also decorating that artifact with any
* necessary fields needed which should be then be returned by the artifact store.
*/
public abstract Artifact get(ArtifactReferenceURI uri, ArtifactDecorator... decorators);
public Artifact get(ArtifactReferenceURI uri, ArtifactDecorator... decorators) {
return artifactStoreGetter.get(uri, decorators);
}

public static void setInstance(ArtifactStore storage) {
if (!singletonSet.compareAndSet(false, true)) {
throw new IllegalStateException("Multiple attempts at setting ArtifactStore's singleton");
}
synchronized (ArtifactStore.class) {
if (instance == null) {
instance = storage;
return;
}

ArtifactStore.instance = storage;
}

public boolean isArtifactURI(String value) {
return value.startsWith(ArtifactStoreURIBuilder.uriScheme + "://");
log.warn("Multiple attempts in setting the singleton artifact store");
}
}
}
Loading

0 comments on commit 32a6fa5

Please sign in to comment.