Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
jobs:
build:
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
HARNESS_ARTIFACT_PASSWORD: ${{secrets.HARNESS_ARTIFACTORY_PASSWORD}}
ORG_GRADLE_PROJECT_harness_artifact_user: '${{secrets.HARNESS_ARTIFACTORY_USER}}'
ORG_GRADLE_PROJECT_harness_artifact_password: '${{secrets.HARNESS_ARTIFACTORY_PASSWORD}}'
name: Build Plugin
runs-on: ubuntu-latest
steps:
Expand All @@ -19,15 +21,12 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: |
11
17
distribution: 'zulu'
cache: 'gradle'
- name: run tests
run: |
./gradlew check aggregatedJacocoReport
./gradlew coveralls
curl -F 'json_file=@build/coveralls/report.json' 'https://coveralls.io/api/v1/jobs'
./gradlew test
- name: build
run: |
./gradlew -PenableCrossCompilerPlugin=true releaseBundle
Expand Down
23 changes: 2 additions & 21 deletions .github/workflows/build_cd_artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
publish_images:
runs-on: ubuntu-latest
env:
GRADLE_ARGS: -Partifactory_user=${{secrets.ARTIFACTORY_USER}} -Partifactory_password=${{secrets.ARTIFACTORY_TOKEN}}
HARNESS_ARTIFACT_PASSWORD: ${{secrets.HARNESS_ARTIFACTORY_PASSWORD}}
GRADLE_ARGS: -Pharness_artifact_user=${{secrets.HARNESS_ARTIFACTORY_USER}} -Pharness_artifact_password=${{secrets.HARNESS_ARTIFACTORY_PASSWORD}}
steps:
- name: checkout code
uses: actions/checkout@v2
Expand All @@ -19,7 +20,6 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: |
11
17
distribution: 'zulu'
cache: 'gradle'
Expand All @@ -33,9 +33,6 @@ jobs:
name: dist
path: build/distributions

- name: install JFrog CLI
uses: jfrog/setup-jfrog-cli@v1

- name: generate variables
id: variables
uses: armory-io/astrolabe-build-defaults@main
Expand All @@ -45,19 +42,3 @@ jobs:
run: |
docker build -t ${{ steps.variables.outputs.artifactory_image_name }} -f build-tools/Dockerfile .

- name: Publish Image To Artifactory
env:
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN_FOR_IMAGE_PUBLISH }}
run: |
jfrog config add deploy --artifactory-url ${{ steps.variables.outputs.artifactory_url }} --access-token ${ARTIFACTORY_TOKEN} --interactive=false

jfrog rt dp ${{ steps.variables.outputs.artifactory_image_name }} ${{ steps.variables.outputs.artifactory_docker_repository }} \
--build-name=${{ steps.variables.outputs.build_name }} \
--build-number=${{ steps.variables.outputs.build_number }}

jfrog rt sp "${{ steps.variables.outputs.artifactory_docker_repository }}/armory/${{ steps.variables.outputs.repo }}/${{ steps.variables.outputs.version }}/manifest.json" "spinnaker-plugin=true"

jfrog rt bag ${{ steps.variables.outputs.build_name }} ${{ steps.variables.outputs.build_number }}

jfrog rt bp ${{ steps.variables.outputs.build_name }} ${{ steps.variables.outputs.build_number }} \
--build-url=${{ steps.variables.outputs.build_url }}
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ jobs:
build:
name: Release Plugin
runs-on: ubuntu-latest
env:
HARNESS_ARTIFACT_PASSWORD: ${{secrets.HARNESS_ARTIFACTORY_PASSWORD}}
ORG_GRADLE_PROJECT_harness_artifact_user: '${{secrets.HARNESS_ARTIFACTORY_USER}}'
ORG_GRADLE_PROJECT_harness_artifact_password: '${{secrets.HARNESS_ARTIFACTORY_PASSWORD}}'
steps:
- name: checkout code
uses: actions/checkout@v2
Expand All @@ -17,7 +21,6 @@ jobs:
uses: actions/setup-java@v3
with:
java-version: |
11
17
distribution: 'zulu'
cache: 'gradle'
Expand Down
10 changes: 9 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ allprojects {

repositories {
mavenCentral()
maven {
url "https://pkg.harness.io/pkg/NK24qb_MQ0aYFnTJmNEjiw/armory-oss-maven/maven"
credentials {
username = "${harness_artifact_user}"
password = "${harness_artifact_password}"
}
}

}

jacoco {
Expand Down Expand Up @@ -96,7 +104,7 @@ subprojects { subProject ->
testImplementation "org.mock-server:mockserver-client-java:5.10.0"
testImplementation "org.mock-server:mockserver-junit-rule:5.10.0"
testImplementation "org.testcontainers:testcontainers:1.14.3"
testImplementation 'io.rest-assured:rest-assured:4.3.0'
testImplementation 'io.rest-assured:rest-assured:5.2.1'
}

group = "io.armory.plugins.metrics"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
package io.armory.plugin.observability.model;

import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
import org.springframework.boot.actuate.autoconfigure.security.reactive.EndpointRequest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.web.SecurityFilterChain;


//To avoid collision with other WebSecurityConfigurerAdapters
@Order(Ordered.HIGHEST_PRECEDENCE + 27)
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
public class SecurityConfig {

private final PluginConfig pluginConfig;

public SecurityConfig(PluginConfig pluginConfig) {
this.pluginConfig = pluginConfig;
}

@Override
protected void configure(HttpSecurity http) throws Exception {
if (pluginConfig.getMetrics().getPrometheus().isEnabled()) {
http.requestMatcher(EndpointRequest.to("aop-prometheus")).authorizeRequests((requests) ->
requests.anyRequest().permitAll());
} else {
http.requestMatcher(EndpointRequest.to("aop-prometheus")).authorizeRequests((requests) ->
requests.anyRequest().denyAll());
}
@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
if (pluginConfig.getMetrics().getPrometheus().isEnabled()) {
http.authorizeHttpRequests(
authorize -> authorize
.requestMatchers("aop-prometheus")
.permitAll().anyRequest()
);
} else {
http.authorizeHttpRequests(
authorize -> authorize
.requestMatchers("aop-prometheus")
.denyAll().anyRequest()
);
}
return http.build();
}
}
22 changes: 11 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
org.gradle.parallel=true

spinnakerGradleVersion=8.32.1
pf4jVersion=3.2.0
korkVersion=7.236.0
pf4jVersion=3.10.0
korkVersion=2025.11.11.00.09.23.main
# The service versions listed below are not needed for the actual plugin to function
# but are being added in order to enable plugin compatibility testing for the plugin
clouddriverVersion=2024.10.29.18.05.56.master
echoVersion=2024.10.15.15.58.45.master
fiatVersion=2024.10.15.15.57.16.master
front50Version=2024.10.16.05.30.03.master
gateVersion=2024.10.28.17.24.37.master
igorVersion=2024.10.15.15.57.55.master
kayentaVersion=2024.10.03.18.18.40.master
orcaVersion=2024.10.15.16.13.18.master
roscoVersion=2024.10.15.16.02.19.master
clouddriverVersion=2025.11.11.00.09.23.main
echoVersion=2025.11.11.00.09.23.main
fiatVersion=2025.11.11.00.09.23.main
front50Version=2025.11.11.00.09.23.main
gateVersion=2025.11.11.00.09.23.main
igorVersion=2025.11.11.00.09.23.main
kayentaVersion=2025.11.11.00.09.23.main
orcaVersion=2025.11.11.00.09.23.main
roscoVersion=2025.11.11.00.09.23.main

targetJava17=true

Expand Down