This commit is contained in:
FyloZ 2021-02-12 00:48:28 -05:00
parent bd312a76ab
commit 8dfbeee1b1
4 changed files with 9 additions and 4 deletions

View File

@ -66,7 +66,7 @@ package-frontend:
- apk update
- apk add --no-cache zip
- mkdir dist
- docker run --name $PACKAGE_CONTAINER_NAME $CI_REGISTRY_IMAGE_NG gradle buildFrontend
- docker run --name $PACKAGE_CONTAINER_NAME $CI_REGISTRY_IMAGE_NG gradle buildFrontend -PfrontendConfiguration=$FRONTEND_CONFIGURATION
- docker cp $PACKAGE_CONTAINER_NAME:/usr/src/cre/dist/frontend/ dist/
- zip -r $ARTIFACT_NAME.zip dist/
- docker build -t $CI_REGISTRY_IMAGE_FRONTEND -f frontend.Dockerfile --build-arg ARTIFACT_NAME=$ARTIFACT_NAME .

View File

@ -111,6 +111,9 @@ tasks.register("buildBackend") {
tasks.register("buildFrontend") {
val outputDirectory = "dist/frontend"
println("Building Angular frontend to ${projectDir.absolutePath}/$outputDirectory")
val configuration = project.gradle.startParameter.projectProperties["frontendConfiguration"] ?: "production"
println("Using configuration $configuration")
// Creates the output directory if it does not exists.
val outputDirectoryFile = File("${projectDir.absolutePath}/$outputDirectory")
@ -123,7 +126,7 @@ tasks.register("buildFrontend") {
}
exec {
commandLineUniversal("cd src/main/frontend && npm run-script build")
commandLineUniversal("cd src/main/frontend && ng build --configuration=$configuration --output-hashing=none --stats-json --source-map=false")
}
exec {

View File

@ -7,7 +7,9 @@ WORKDIR /usr/src/cre/
RUN apt update
RUN apt install nodejs -y
RUN apt install npm -y
RUN apt install zip -y
RUN npm install -g typescript@3.9.7
RUN npm install -g @angular/cli || true
ENV NG_CLI_ANALYTICS=ci

View File

@ -1,4 +1,4 @@
export const environment = {
production: true,
apiUrl: '/api'
apiUrl: 'https://cre.fyloz.dev/api'
};