Skip to content

Commit

Permalink
refactor: cleanups, move common stuff to own module
Browse files Browse the repository at this point in the history
  • Loading branch information
tronghn committed Feb 8, 2022
1 parent e076afd commit 330f378
Show file tree
Hide file tree
Showing 31 changed files with 371 additions and 349 deletions.
39 changes: 11 additions & 28 deletions .github/workflows/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,12 @@ jobs:
- name: Checkout latest code
uses: actions/checkout@v2

- name: Set up JDK 16
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 16

- name: Setup build cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Setup Gradle wrapper cache
uses: actions/cache@v2
Expand All @@ -37,8 +31,11 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: Verify Gradle wrapper checksum
uses: gradle/wrapper-validation-action@v1

- name: Build with Gradle
run: ./gradlew clean azure:build azure:shadowJar
run: ./gradlew clean wonderwalled-azure:build wonderwalled-azure:shadowJar

- name: Login to GitHub Docker Registry
uses: docker/login-action@v1
Expand All @@ -48,12 +45,12 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push the Docker image
working-directory: ./azure
working-directory: ./wonderwalled-azure
run: |
docker build --pull --tag ${IMAGE} .
docker push ${IMAGE}
deploy-dev-gcp:
deploy:
name: Deploy to dev-gcp
needs: build
runs-on: ubuntu-latest
Expand All @@ -64,17 +61,3 @@ jobs:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: .nais/azure.yaml
VARS: .nais/dev/azure.yaml

deploy-prod-gcp:
name: Deploy to prod-gcp
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .nais/azure.yaml
VARS: .nais/prod/azure.yaml
39 changes: 11 additions & 28 deletions .github/workflows/idporten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,12 @@ jobs:
- name: Checkout latest code
uses: actions/checkout@v2

- name: Set up JDK 16
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: 16

- name: Setup build cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

- name: Setup Gradle wrapper cache
uses: actions/cache@v2
Expand All @@ -37,8 +31,11 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: Verify Gradle wrapper checksum
uses: gradle/wrapper-validation-action@v1

- name: Build with Gradle
run: ./gradlew clean idporten:build idporten:shadowJar
run: ./gradlew clean wonderwalled-idporten:build wonderwalled-idporten:shadowJar

- name: Login to GitHub Docker Registry
uses: docker/login-action@v1
Expand All @@ -48,12 +45,12 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push the Docker image
working-directory: ./idporten
working-directory: ./wonderwalled-idporten
run: |
docker build --pull --tag ${IMAGE} .
docker push ${IMAGE}
deploy-dev:
deploy:
name: Deploy to dev-gcp
needs: build
runs-on: ubuntu-latest
Expand All @@ -64,17 +61,3 @@ jobs:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: .nais/idporten.yaml
VARS: .nais/dev/idporten.yaml

deploy-prod:
name: Deploy to prod-gcp
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .nais/idporten.yaml
VARS: .nais/prod/idporten.yaml
2 changes: 1 addition & 1 deletion .nais/azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
cpu: "50m"
memory: "256Mi"
ingresses:
- {{ ingress }}
- https://wonderwalled.dev.intern.nav.no
azure:
application:
enabled: true
Expand Down
1 change: 0 additions & 1 deletion .nais/dev/azure.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .nais/dev/idporten.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .nais/idporten.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
cpu: "50m"
memory: "256Mi"
ingresses:
- {{ ingress }}
- https://wonderwalled.dev.nav.no
idporten:
enabled: true
sidecar:
Expand Down
1 change: 0 additions & 1 deletion .nais/prod/azure.yaml

This file was deleted.

1 change: 0 additions & 1 deletion .nais/prod/idporten.yaml

This file was deleted.

119 changes: 0 additions & 119 deletions azure/src/main/kotlin/io/nais/Wonderwalled.kt

This file was deleted.

18 changes: 9 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
object Versions {
const val konfig = "1.6.10.0"
const val kotlinlogging = "2.0.10"
const val ktor = "1.6.4"
const val logstash = "6.6"
const val logback = "1.2.3"
const val ktor = "1.6.7"
const val logstash = "7.0.1"
const val logback = "1.2.9"
}

plugins {
kotlin("jvm") version "1.5.21"
id("org.jmailen.kotlinter") version "3.6.0"
kotlin("jvm") version "1.6.10"
id("org.jmailen.kotlinter") version "3.7.0"
id("com.github.ben-manes.versions") version "0.39.0"
id("com.github.johnrengelman.shadow") version "7.1.0" apply false
id("com.github.johnrengelman.shadow") version "7.1.1" apply false
}

allprojects {
Expand All @@ -28,8 +28,8 @@ subprojects {
apply(plugin = "com.github.johnrengelman.shadow")

java {
sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks {
Expand All @@ -38,7 +38,7 @@ subprojects {
}
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
jvmTarget = "16"
jvmTarget = "17"
}
}
withType<Jar> {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 330f378

Please sign in to comment.