Skip to content

Commit

Permalink
Merge pull request #1703 from jesperancinha/update-sbt-dependencies
Browse files Browse the repository at this point in the history
Update sbt dependencies
  • Loading branch information
jesperancinha committed Jun 17, 2024
2 parents 32f6550 + 53ebc86 commit 0db4765
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/image-train-filters-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup sdkman
run: |
Expand All @@ -26,7 +26,7 @@ jobs:
sdk install sbt
- name: Set up Node.js
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: '20'

Expand Down
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ before:
bash setup.sh
clean:
if [ -d ~/.cache/coursier ]; then rm -rf ~/.cache/coursier; fi
if [ -d /home/runner/.cache/coursier ]; then rm -rf /home/runner/.cache/coursier; fi
test:
sbt test
mvn-offline:
mvn dependency:go-offline
no-test-sbt:
sbt 'set assembly / test := {}' compile clean assembly
cp -r target service/release
run:
java -jar service/target/scala-2.12/image-train-filters-service.jar
no-test-sbt-run: no-test-sbt run
build: clean build-sbt build-npm
build-cypress:
cd e2e && yarn
Expand All @@ -16,7 +25,6 @@ build-image-train-filters-fe:
yarn; \
npm run build
build-sbt:
mvn dependency:go-offline
sbt compile
sbt clean assembly
cp -r target service/release
Expand Down
3 changes: 2 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ $ yarn build
$ service nginx reload
```

## References
## Resources

- [Akka Configuration Reference](https://doc.akka.io/docs/akka/current/general/configuration-reference.html)
- [SBT release 1.5.0](https://eed3si9n.com/sbt-1.5.0)
- [nginx: multiple websites on one server](https://serverfault.com/questions/845739/nginx-multiple-websites-on-one-server)
- [Set up multiple websites on a Digital Ocean droplet running nginx and node.js](https://coderwall.com/p/rldrxa/set-up-multiple-websites-on-a-digital-ocean-droplet-running-nginx-and-node-js)
Expand Down
29 changes: 13 additions & 16 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,20 @@ lazy val service = project

lazy val commonDependencies = Seq(
"io.spray" %% "spray-json" % "1.3.6",
"org.scalactic" %% "scalactic" % "3.2.9",
"org.scalactic" %% "scalactic" % "3.2.18",
"net.liftweb" %% "lift-json" % "3.5.0",
"com.typesafe.slick" %% "slick" % "3.3.3",
"mysql" % "mysql-connector-java" % "8.0.25",
"ch.qos.logback" % "logback-classic" % "1.2.10",
"com.typesafe.akka" %% "akka-http-core" % "10.2.6",
"com.typesafe.akka" %% "akka-actor" % "2.6.18",
"com.typesafe.akka" %% "akka-stream" % "2.6.18",
"com.typesafe.akka" %% "akka-http" % "10.2.6",
"com.typesafe.akka" %% "akka-http-spray-json" % "10.2.6",
"com.typesafe.akka" %% "akka-http-testkit" % "10.2.6",
"com.typesafe.akka" %% "akka-http-core" % "10.5.3",
"com.typesafe.akka" %% "akka-actor" % "2.8.5",
"com.typesafe.akka" %% "akka-stream" % "2.8.5",
"com.typesafe.akka" %% "akka-http" % "10.5.3",
"com.typesafe.akka" %% "akka-http-spray-json" % "10.5.3",
"com.typesafe.akka" %% "akka-http-testkit" % "10.5.3",
"org.jesperancinha.itf" % "itf-chartizate-java" % "5.0.0" exclude("org.fusesource.jansi", "jansi"),
"org.mockito" %% "mockito-scala" % "1.17.0" % Test,
"org.scalatest" %% "scalatest" % "3.2.9" % Test,
"org.scalatest" %% "scalatest-flatspec" % "3.3.0-SNAP3" % Test,
"org.scalatest" %% "scalatest-wordspec" % "3.3.0-SNAP3" % Test,
"org.scalatest" %% "scalatest-core" % "3.3.0-SNAP3" % Test
"org.mockito" %% "mockito-scala" % "1.17.31" % Test,
"org.scalatest" %% "scalatest" % "3.2.18" % Test,
"org.scalatest" %% "scalatest-flatspec" % "3.2.18" % Test,
"org.scalatest" %% "scalatest-wordspec" % "3.2.18" % Test,
"org.scalatest" %% "scalatest-core" % "3.2.18" % Test
)

lazy val compilerOptions = Seq(
Expand Down Expand Up @@ -84,4 +81,4 @@ lazy val assemblySettings = Seq(
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
)
)
17 changes: 12 additions & 5 deletions deps-updater/update-dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@ const updateLines = report.split('\n').filter(line => line.includes(' -> '));
let buildSbtContent = fs.readFileSync('../build.sbt', 'utf8');
console.log(report)
updateLines.forEach(line => {
const [currentDependency, newVersion] = line.split(' -> ').map(s => s.trim());
const [organization, artifact, oldVersion] = currentDependency.split(':').map(s => s.trim());
console.log(`Found organization: ${organization}, artifact: ${artifact}`);
const regex = new RegExp(`("${organization}" %% "${artifact}" % ").*(",?)`);
buildSbtContent = buildSbtContent.replace(regex, `$1${newVersion}$2`);
if(!line.indexOf("alpha") >-1) {
const [currentDependency, newVersion] = line.split(' -> ').map(s => s.trim());
const [organization, artifact, oldVersion] = currentDependency.split(':').map(s => s.trim());
console.log(`Found organization: ${organization}, artifact: ${artifact}, old version: ${oldVersion}, new possible version ${newVersion}`);
let numericNewVersion = Number(newVersion.split(".").map(seg => seg.padStart(4,'0')).join(''));
let numericOldVersion = Number(oldVersion.split(".").map(seg => seg.padStart(4,'0')).join(''));
console.log(`Parsed new version is ${numericNewVersion} and parsed old version is ${numericOldVersion}`);
if(numericNewVersion > numericOldVersion) {
const regex = new RegExp(`("${organization}" %% "${artifact}" % ").*(",?)`);
buildSbtContent = buildSbtContent.replace(regex, `$1${newVersion}$2`);
}
}
});
fs.writeFileSync('../build.sbt', buildSbtContent);
7 changes: 2 additions & 5 deletions service/src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
akka {
loglevel = DEBUG
event-handlers = ["akka.event.slf4j.Slf4jEventHandler"]
loggers = ["akka.event.Logging$DefaultLogger"]
loglevel = "DEBUG"
logging-filter = "akka.event.slf4j.Slf4jLoggingFilter"
}

akka.http.server.request-timeout = 480 s
Expand All @@ -16,5 +14,4 @@ image-train-filters {
saveFiles = "false"
image-source-path = "/tmp/image-train-filters/sources"
image-destination-path = "/tmp/image-train-filters/destination"
}

}

0 comments on commit 0db4765

Please sign in to comment.