Skip to content

Commit cdbdee0

Browse files
committed
- add static files for prod build
1 parent 5ae99a4 commit cdbdee0

File tree

2 files changed

+54
-3
lines changed

2 files changed

+54
-3
lines changed

api-gateway/k8s/deployment.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ spec:
1616
spec:
1717
containers:
1818
- name: api-gateway
19-
image: ghcr.io/ubaid4j/cloud-native-app-spring-boot/api-gateway:0.0.3-SNAPSHOT
19+
image: ghcr.io/ubaid4j/cloud-native-app-spring-boot/api-gateway:0.0.3-snapshot
2020
imagePullPolicy: IfNotPresent
2121
env:
2222
- name: SPRING_PROFILES_ACTIVE
@@ -37,5 +37,4 @@ spec:
3737
volumes:
3838
- name: api-gateway-config-volume
3939
configMap:
40-
name: api-gateway-config
41-
40+
name: api-gateway-config

api-gateway/pom.xml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
<properties>
1818
<java.version>21</java.version>
19+
<node.version>v21.1.0</node.version>
20+
<npm.version>10.2.0</npm.version>
1921
<spring-cloud.version>2023.0.0</spring-cloud.version>
2022
</properties>
2123

@@ -67,13 +69,63 @@
6769
</image>
6870
</configuration>
6971
</plugin>
72+
<plugin>
73+
<groupId>com.github.eirslett</groupId>
74+
<artifactId>frontend-maven-plugin</artifactId>
75+
<executions>
76+
<execution>
77+
<id>install-node-and-npm</id>
78+
<configuration>
79+
<nodeVersion>${node.version}</nodeVersion>
80+
</configuration>
81+
<goals>
82+
<goal>install-node-and-npm</goal>
83+
</goals>
84+
</execution>
85+
<execution>
86+
<id>npm install</id>
87+
<goals>
88+
<goal>npm</goal>
89+
</goals>
90+
</execution>
91+
<execution>
92+
<id>webapp build test</id>
93+
<goals>
94+
<goal>npm</goal>
95+
</goals>
96+
<phase>test</phase>
97+
<configuration>
98+
<arguments>run webapp:test</arguments>
99+
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
100+
</configuration>
101+
</execution>
102+
<execution>
103+
<id>webapp build prod</id>
104+
<goals>
105+
<goal>npm</goal>
106+
</goals>
107+
<phase>generate-resources</phase>
108+
<configuration>
109+
<arguments>run build</arguments>
110+
<environmentVariables>
111+
<APP_VERSION>${project.version}</APP_VERSION>
112+
</environmentVariables>
113+
<npmInheritsProxyConfigFromMaven>false</npmInheritsProxyConfigFromMaven>
114+
</configuration>
115+
</execution>
116+
</executions>
117+
</plugin>
70118
</plugins>
71119
</pluginManagement>
72120
<plugins>
73121
<plugin>
74122
<groupId>org.springframework.boot</groupId>
75123
<artifactId>spring-boot-maven-plugin</artifactId>
76124
</plugin>
125+
<plugin>
126+
<groupId>com.github.eirslett</groupId>
127+
<artifactId>frontend-maven-plugin</artifactId>
128+
</plugin>
77129
</plugins>
78130
</build>
79131

0 commit comments

Comments
 (0)