53 lines
1.3 KiB
YAML
53 lines
1.3 KiB
YAML
version: 0.1
|
|
component: build
|
|
timeoutInSeconds: 1200
|
|
runAs: root
|
|
shell: bash
|
|
|
|
env:
|
|
variables:
|
|
REGISTRY: "icn.ocir.io/idyhsdamac8c/tasteby"
|
|
exportedVariables:
|
|
- IMAGE_TAG
|
|
- BACKEND_IMAGE
|
|
- FRONTEND_IMAGE
|
|
|
|
steps:
|
|
- type: Command
|
|
name: "Set image tag"
|
|
command: |
|
|
IMAGE_TAG="${OCI_BUILD_RUN_ID:0:8}-$(date +%Y%m%d%H%M)"
|
|
BACKEND_IMAGE="${REGISTRY}/backend:${IMAGE_TAG}"
|
|
FRONTEND_IMAGE="${REGISTRY}/frontend:${IMAGE_TAG}"
|
|
echo "IMAGE_TAG=${IMAGE_TAG}"
|
|
echo "BACKEND_IMAGE=${BACKEND_IMAGE}"
|
|
echo "FRONTEND_IMAGE=${FRONTEND_IMAGE}"
|
|
|
|
- type: Command
|
|
name: "Build backend image"
|
|
command: |
|
|
cd backend-java
|
|
docker build --platform linux/arm64 \
|
|
-t "${BACKEND_IMAGE}" \
|
|
-t "${REGISTRY}/backend:latest" \
|
|
.
|
|
|
|
- type: Command
|
|
name: "Build frontend image"
|
|
command: |
|
|
cd frontend
|
|
docker build --platform linux/arm64 \
|
|
--build-arg NEXT_PUBLIC_GOOGLE_MAPS_API_KEY="${NEXT_PUBLIC_GOOGLE_MAPS_API_KEY}" \
|
|
--build-arg NEXT_PUBLIC_GOOGLE_CLIENT_ID="${NEXT_PUBLIC_GOOGLE_CLIENT_ID}" \
|
|
-t "${FRONTEND_IMAGE}" \
|
|
-t "${REGISTRY}/frontend:latest" \
|
|
.
|
|
|
|
outputArtifacts:
|
|
- name: backend-image
|
|
type: DOCKER_IMAGE
|
|
location: ${BACKEND_IMAGE}
|
|
- name: frontend-image
|
|
type: DOCKER_IMAGE
|
|
location: ${FRONTEND_IMAGE}
|