feat: Use caching in pipeline
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -64,3 +64,6 @@ legalconsenthub/.api-client-middleware
|
|||||||
### TestContainers persistent data ###
|
### TestContainers persistent data ###
|
||||||
legalconsenthub-backend/postgres-data/
|
legalconsenthub-backend/postgres-data/
|
||||||
|
|
||||||
|
### Docker BuildKit cache ###
|
||||||
|
.buildx-cache/
|
||||||
|
|
||||||
|
|||||||
@@ -155,6 +155,8 @@ frontend_job() {
|
|||||||
--tag "gitea.lugnas.de/denis/legalconsenthub:latest" \
|
--tag "gitea.lugnas.de/denis/legalconsenthub:latest" \
|
||||||
--tag "gitea.lugnas.de/denis/legalconsenthub:$GIT_SHA" \
|
--tag "gitea.lugnas.de/denis/legalconsenthub:$GIT_SHA" \
|
||||||
--file ./Dockerfile \
|
--file ./Dockerfile \
|
||||||
|
--cache-from type=local,src="$SCRIPT_DIR/.buildx-cache/frontend" \
|
||||||
|
--cache-to type=local,dest="$SCRIPT_DIR/.buildx-cache/frontend",mode=max \
|
||||||
--push \
|
--push \
|
||||||
..
|
..
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
@@ -209,11 +211,14 @@ backend_job() {
|
|||||||
log_success "Tests passed"
|
log_success "Tests passed"
|
||||||
|
|
||||||
log_info "Building Docker image..."
|
log_info "Building Docker image..."
|
||||||
|
mkdir -p "$SCRIPT_DIR/.buildx-cache/backend"
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform linux/amd64 \
|
--platform linux/amd64 \
|
||||||
--tag "gitea.lugnas.de/denis/legalconsenthub-backend:latest" \
|
--tag "gitea.lugnas.de/denis/legalconsenthub-backend:latest" \
|
||||||
--tag "gitea.lugnas.de/denis/legalconsenthub-backend:$GIT_SHA" \
|
--tag "gitea.lugnas.de/denis/legalconsenthub-backend:$GIT_SHA" \
|
||||||
--file ./Dockerfile \
|
--file ./Dockerfile \
|
||||||
|
--cache-from type=local,src="$SCRIPT_DIR/.buildx-cache/backend" \
|
||||||
|
--cache-to type=local,dest="$SCRIPT_DIR/.buildx-cache/backend",mode=max \
|
||||||
--push \
|
--push \
|
||||||
..
|
..
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user