Skip to content

Commit

Permalink
Revert "Revert the following:"
Browse files Browse the repository at this point in the history
This reverts commit 90d5544.
  • Loading branch information
marc0der committed Dec 11, 2022
1 parent 753c126 commit 1e0c088
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@ on: pull_request_target
jobs:
build:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:3.2
ports:
- 27017:27017
steps:
- name: Checkout source code
uses: actions/checkout@v2
Expand Down
23 changes: 23 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import com.bmuschko.gradle.docker.tasks.container.*

plugins {
id "java"
id "scala"
id "application"
id "cz.alenkacz.gradle.scalafmt" version "1.16.2"
id 'com.bmuschko.docker-remote-api' version '9.0.1'
}

version = '1.0.2'
Expand All @@ -24,3 +27,23 @@ dependencies {
}

compileScala.dependsOn("checkScalafmt")

task createMongoContainer(type: DockerCreateContainer) {
targetImageId 'mongo:3.2'
containerName = 'mongo'
hostConfig.portBindings = ['27017:27017']
hostConfig.autoRemove = true
}

task startMongoContainer(type: DockerStartContainer) {
dependsOn createMongoContainer
targetContainerId createMongoContainer.containerId
}

task stopMongoContainer(type: DockerStopContainer) {
targetContainerId createMongoContainer.containerId
}

run.dependsOn(startMongoContainer)

run.finalizedBy(stopMongoContainer)

0 comments on commit 1e0c088

Please sign in to comment.