-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build backend image with dependencies in there
- Loading branch information
1 parent
4125ed5
commit ffeecc7
Showing
5 changed files
with
153 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package smithy4s_codegen | ||
|
||
import sbt.librarymanagement.ModuleID | ||
import sbt.librarymanagement.Disabled | ||
import java.io.File | ||
import sbt.io.IO | ||
|
||
final case class SmithyClasspathEntry( | ||
module: sbt.ModuleID, | ||
file: File, | ||
relativePath: String | ||
) | ||
object SmithyClasspath { | ||
def toFile( | ||
target: File, | ||
all: Seq[SmithyClasspathEntry], | ||
dockerPath: String | ||
): Unit = { | ||
val entries = all.map { sce => | ||
encodeModule(sce.module) -> ujson.Str(s"$dockerPath/${sce.relativePath}") | ||
}.toMap | ||
val content = ujson.Obj( | ||
"entries" -> ujson.Obj.from(entries) | ||
) | ||
IO.write(target, content.render()) | ||
} | ||
|
||
private def encodeModule(m: ModuleID): String = { | ||
m.crossVersion match { | ||
case Disabled => s"${m.organization}:${m.name}:${m.revision}" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
libraryDependencies += "com.lihaoyi" %% "upickle" % "3.1.3" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
set -eo pipefail | ||
|
||
export BUNDLE_ASSETS="true" | ||
|
||
if [[ "$PUBLISH_OFFICIAL" == "true" ]]; then | ||
BACKEND_PUBLISH="publish" | ||
else | ||
BACKEND_PUBLISH="publishLocal" | ||
fi | ||
|
||
set -u | ||
|
||
(cd modules/frontend; npm i && npm run build) | ||
sbt "backend / Docker / publish" | ||
sbt "backend / Docker / $BACKEND_PUBLISH; backendDependencies / Docker / $BACKEND_PUBLISH" |