Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into RD-3852
Browse files Browse the repository at this point in the history
  • Loading branch information
torcato committed Jan 12, 2024
2 parents 55781bc + e4df88f commit be90dd6
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/sync-deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
run: |
M2_HOME=/home/sbtuser/.m2/repository
aws s3 sync $M2_HOME s3://$BUCKET/maven --exclude '*' --include '**kiama**'
aws s3 sync $M2_HOME s3://$BUCKET/maven --exclude '*' --include '**jackson**'
aws s3 sync $M2_HOME s3://$BUCKET/maven --exclude '*' --include '**scala-logging**'
aws s3 sync $M2_HOME s3://$BUCKET/maven --exclude '*' --include '**jwt-core**'
cd deps/others
sbt createS3SyncScript
export M2_HOME BUCKET
./s3-sync-deps.sh
3 changes: 2 additions & 1 deletion deps/others/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.jar
manifest.txt
manifest.txt
s3-sync-deps.sh
23 changes: 23 additions & 0 deletions deps/others/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,28 @@ patchDependencies := {
}


val createS3SyncScript = taskKey[Unit]("Create a bash script for syncing dependencies to S3")

val scriptFile = "s3-sync-deps.sh"

createS3SyncScript := {
val dependencies = libraryDependencies.value

val writer = new BufferedWriter(new FileWriter(scriptFile))

try {
writer.write("#!/bin/bash\n\n")
dependencies.foreach { dep =>
writer.write(s"aws s3 sync $$M2_HOME s3://$$BUCKET/maven --exclude '*' --include '**${dep.name}**'\n")
}
} finally {
// Always close the writer to release resources
writer.close()
}

// Make the script executable
new File(scriptFile).setExecutable(true)

// Notify that the task is completed
println(s"Bash script created: $scriptFile")
}

0 comments on commit be90dd6

Please sign in to comment.