Skip to content

Commit

Permalink
feat(ci): include build numbers in container envars (#1528)
Browse files Browse the repository at this point in the history
Co-authored-by: Craig Yu <[email protected]>
  • Loading branch information
DerekRoberts and craigyu authored Aug 16, 2024
1 parent 9a045dc commit c9651cd
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ RUN ./mvnw -B package -Pnative -DskipTests
FROM gcr.io/distroless/java-base:nonroot AS deploy
ARG PORT=8090

# Receive build number as argument, retain as environment variable
ARG BUILD_NUMBER
ENV BUILD_NUMBER=${BUILD_NUMBER}

# Copy
WORKDIR /app
COPY --from=build /app/target/nr-spar-backend ./nr-spar-backend
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,9 @@ public SeedlotAclassFormDto getAclassSeedlotFormInfo(@NonNull String seedlotNumb
owner.getOriginalPercentageOwned(),
owner.getOriginalPercentageReserved(),
owner.getOriginalPercentageSurplus(),
owner.getMethodOfPayment().getMethodOfPaymentCode(),
owner.getMethodOfPayment() != null
? owner.getMethodOfPayment().getMethodOfPaymentCode()
: null,
owner.getFundingSourceCode()))
.collect(Collectors.toList());

Expand All @@ -598,9 +600,7 @@ public SeedlotAclassFormDto getAclassSeedlotFormInfo(@NonNull String seedlotNumb
seedlotOrchards.stream().filter(so -> so.getIsPrimary()).toList();

primaryOrchardId =
filteredPrimaryOrchard.isEmpty()
? null
: filteredPrimaryOrchard.get(0).getOrchardId();
filteredPrimaryOrchard.isEmpty() ? null : filteredPrimaryOrchard.get(0).getOrchardId();
}

Optional<String> secondaryOrchardId = Optional.empty();
Expand Down
4 changes: 4 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ RUN npm ci --ignore-scripts --no-update-notifier --omit=dev && \
FROM caddy:2.8.4-alpine
RUN apk add --no-cache ca-certificates curl

# Receive build number as argument, retain as environment variable
ARG BUILD_NUMBER
ENV BUILD_NUMBER=${BUILD_NUMBER}

# Copy files and run formatting
COPY --from=build /app/build/ /app/dist
COPY Caddyfile /etc/caddy/Caddyfile
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,8 @@ const SeedlotReviewContent = () => {
: null
}
{
// this and its related code such as createDraftForPendMutation
// needs to be deleted in the future
(luxon.local().setZone('America/Vancouver').toISODate() ?? '' < '2024-08-17')
? (
<Row className="action-button-row">
Expand Down
4 changes: 4 additions & 0 deletions oracle-api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ RUN ./mvnw package -Pnative -DskipTests -Dskip.unit.tests=true && \
### Deployer
FROM eclipse-temurin:17.0.11_9-jdk-jammy AS deploy

# Receive build number as argument, retain as environment variable
ARG BUILD_NUMBER
ENV BUILD_NUMBER=${BUILD_NUMBER}

# Java vars
ENV LANG=en_CA.UTF-8
ENV LANGUAGE=en_CA.UTF-8
Expand Down

0 comments on commit c9651cd

Please sign in to comment.