Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better micro-infrastructure with Gradle composite builds #146

Merged
merged 49 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e21244f
Locally building
gchristov Feb 23, 2024
417178e
Locally running
gchristov Feb 24, 2024
70af72e
Locally running tests
gchristov Feb 25, 2024
fcac839
Add kotlinUpgradeYarnLock
gchristov Feb 25, 2024
aba4301
Remove yarn lock files
gchristov Feb 25, 2024
a10399a
Readd
gchristov Feb 25, 2024
7387893
Rename jobs
gchristov Feb 25, 2024
1468f8e
Remove gradle cache
gchristov Feb 25, 2024
d157d00
remove yarn lock files
gchristov Feb 25, 2024
0167258
try single service
gchristov Feb 25, 2024
8207955
Fix ci docker and readd yarn lock files
gchristov Feb 25, 2024
3467beb
Ignore infra for now
gchristov Feb 25, 2024
32ebfb1
remove lockfiles and collect generated ones
gchristov Feb 25, 2024
bcf325a
Try with auto generated lock files
gchristov Feb 25, 2024
5167320
Attempt another
gchristov Feb 25, 2024
f713940
Customise CI file for search service
gchristov Feb 25, 2024
8b492c8
Another CI update
gchristov Feb 25, 2024
e337fcf
Add self-destruct moduke
gchristov Feb 25, 2024
3bc7ef1
Add statistics module
gchristov Feb 25, 2024
de04b1f
Add slack module
gchristov Feb 25, 2024
e50622a
Add landing page module
gchristov Feb 25, 2024
be73d6b
Typo
gchristov Feb 25, 2024
74dac19
Add proxy web module
gchristov Feb 25, 2024
5d2cd5a
Readd root gradle project config
gchristov Feb 25, 2024
e70f8d5
Fix local run
gchristov Feb 25, 2024
aeb3365
Attempt to see if we can install a yaml merge tool via homebrew
gchristov Feb 25, 2024
6b5e46d
Another attempt
gchristov Feb 25, 2024
de438aa
Oups forgot the actual run script
gchristov Feb 25, 2024
d67db9f
Undo change
gchristov Feb 25, 2024
173a910
Re-enable infra preview
gchristov Feb 25, 2024
9687c65
Pulumi micro-stack architecture
gchristov Feb 26, 2024
7220cf4
Add CI check for common
gchristov Feb 26, 2024
1ac50ef
Tidy up common CI
gchristov Feb 27, 2024
23546c1
Second attempt
gchristov Feb 27, 2024
012af73
Tidy up landing page ci
gchristov Feb 27, 2024
0f34f24
Tidy up proxy ci
gchristov Feb 27, 2024
e745d51
Tidy up search ci
gchristov Feb 27, 2024
7d3e481
Tidy up self-destruct ci
gchristov Feb 27, 2024
1de7915
Tidy up slack ci
gchristov Feb 27, 2024
d3668c6
no anchors
gchristov Feb 27, 2024
84411fa
Tidy up statistics ci
gchristov Feb 27, 2024
525bc99
Duplicate secrets in service test jobs
gchristov Feb 27, 2024
a47cff4
Deploy CI pipelines
gchristov Feb 27, 2024
406f53a
Swap checks to test CI deployment
gchristov Feb 27, 2024
334885d
Fix check names
gchristov Feb 27, 2024
2a1effd
Revert "Swap checks to test CI deployment"
gchristov Feb 27, 2024
fe04d65
Tidy up
gchristov Feb 27, 2024
ac8bd37
Remove old Pulumi stack
gchristov Feb 27, 2024
def5bb8
Update readme
gchristov Feb 27, 2024
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
Next Next commit
Locally building
  • Loading branch information
gchristov committed Feb 23, 2024
commit e21244f0bedf883b750d7e5acd23494e1f5322a9
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ node_modules/
.gradle
.idea

# Firebase
.firebase/
firebase-debug.log*
firebase-debug.*.log*

secrets.properties
credentials-gcp-app.json
credentials-gcp-infra.json
5 changes: 5 additions & 0 deletions common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
allprojects {
repositories {
mavenCentral()
}
}
5 changes: 4 additions & 1 deletion common/firebase/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
plugins {
id("node-module-plugin")
}
}

group = "com.gchristov.thecodinglove.common"
version = "0.0.1"
5 changes: 5 additions & 0 deletions common/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Gradle
org.gradle.caching=true

#Kotlin
kotlin.code.style=official
3 changes: 3 additions & 0 deletions common/kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ plugins {
id("base-node-plugin")
}

group = "com.gchristov.thecodinglove.common"
version = "0.0.1"

kotlin {
sourceSets {
val commonMain by getting {
Expand Down
5 changes: 4 additions & 1 deletion common/monitoring/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ plugins {
id("build-config-plugin")
}

group = "com.gchristov.thecodinglove.common"
version = "0.0.1"

kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(projects.common.network)
implementation(projects.network)
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion common/network-testfixtures/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ plugins {
id("node-module-plugin")
}

group = "com.gchristov.thecodinglove.common"
version = "0.0.1"

kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(projects.common.network)
implementation(projects.network)
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions common/network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ plugins {
id("node-module-plugin")
}

group = "com.gchristov.thecodinglove.common"
version = "0.0.1"

kotlin {
sourceSets {
val commonMain by getting {
Expand Down
7 changes: 5 additions & 2 deletions common/pubsub-testfixtures/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ plugins {
id("node-module-plugin")
}

group = "com.gchristov.thecodinglove.common"
version = "0.0.1"

kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(projects.common.network)
implementation(projects.common.pubsub)
implementation(projects.network)
implementation(projects.pubsub)
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion common/pubsub/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@ plugins {
id("node-module-plugin")
}

group = "com.gchristov.thecodinglove.common"
version = "0.0.1"

kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(projects.common.network)
implementation(projects.network)
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions common/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pluginManagement {
includeBuild("../gradle-plugins")
}

rootProject.name = "common"

include("firebase")
include("kotlin")
include("monitoring")
include("network")
include("network-testfixtures")
include("pubsub")
include("pubsub-testfixtures")
include("test")
3 changes: 3 additions & 0 deletions common/test/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ plugins {
id("base-node-plugin")
}

group = "com.gchristov.thecodinglove.common"
version = "0.0.1"

kotlin {
sourceSets {
val commonMain by getting {
Expand Down
1 change: 0 additions & 1 deletion gradle-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ repositories {
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.21")
implementation("org.jetbrains.kotlin:kotlin-serialization:1.9.21")
implementation("dev.petuska:npm-publish-gradle-plugin:3.4.1")
implementation("com.codingfeline.buildkonfig:buildkonfig-gradle-plugin:0.15.0")
}
5 changes: 5 additions & 0 deletions gradle-plugins/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#Gradle
org.gradle.caching=true

#Kotlin
kotlin.code.style=official
Binary file added gradle-plugins/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions gradle-plugins/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ class NodeBinaryPlugin : Plugin<Project> {
}
extensions.configure(KotlinMultiplatformExtension::class.java) {
sourceSets.maybeCreate("commonMain").dependencies {
implementation(project(":common:network"))
implementation(project(":common:pubsub"))
implementation(project(":common:monitoring"))
implementation("com.gchristov.thecodinglove.common:network")
implementation("com.gchristov.thecodinglove.common:pubsub")
implementation("com.gchristov.thecodinglove.common:monitoring")
}
sourceSets.maybeCreate("jsMain").dependencies {
// Ideally these would be linked from corresponding submodules but that is currently not supported out
Expand All @@ -28,15 +28,15 @@ class NodeBinaryPlugin : Plugin<Project> {
implementation(npm(Deps.Google.firebaseAdmin.name, Deps.Google.firebaseAdmin.version))
}
sourceSets.maybeCreate("jsTest").dependencies {
implementation(project(":common:network-testfixtures"))
implementation(project(":common:pubsub-testfixtures"))
implementation("com.gchristov.thecodinglove.common:network-testfixtures")
implementation("com.gchristov.thecodinglove.common:pubsub-testfixtures")
}
}
// Copy the output binaries to their final destination
tasks.named("assemble") {
doLast {
copy {
from(file(rootProject.layout.projectDirectory.file("credentials-gcp-app.json")))
from(file(rootProject.layout.projectDirectory.file("../credentials-gcp-app.json")))
into("${binaryRootDirectory()}/productionExecutable")
}
copy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class NodeModulePlugin : Plugin<Project> {
plugins.apply("org.jetbrains.kotlin.plugin.serialization")
extensions.configure(KotlinMultiplatformExtension::class.java) {
sourceSets.maybeCreate("commonMain").dependencies {
api(project(":common:kotlin"))
api(project(":common:test"))
api("com.gchristov.thecodinglove.common:kotlin")
api("com.gchristov.thecodinglove.common:test")
}
sourceSets.maybeCreate("commonTest").dependencies {
api(Deps.Kotlin.coroutinesTest)
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 2 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\:https://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
41 changes: 28 additions & 13 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,11 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,18 +198,28 @@ if "$cygwin" || "$msys" ; then
done
fi

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
5 changes: 5 additions & 0 deletions landing-page-web/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
allprojects {
repositories {
mavenCentral()
}
}
1 change: 0 additions & 1 deletion gradle.properties → landing-page-web/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#Gradle
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.gradle.caching=true

#Kotlin
Expand Down
Loading