Ich möchte einen separaten Docker-Container haben, der meine App erstellt, und wenn es fertig ist, übergibt es einen 'dist'-Katalog an den zweiten Container, der bereitgestellt wird.Ordner zwischen Builds übergeben - GitLab CI mit Docker
Ich habe versucht, die Artefakte und "Volume" Anweisung, aber es scheint nicht zu funktionieren. Hat jemand irgendwelche Probleme oder Lösungen?
.gitlab-ci.yml
stages:
- build
- push
- deploy
build_app:
stage: build
script:
- ./deployment/build.sh
tags:
- shell
artifacts:
paths:
- /dist
push_app:
stage: push
script:
- ./deployment/push.sh
tags:
- shell
dependencies:
- build_app
deploy_app:
stage: deploy
script:
- ./deployment/deploy.sh
tags:
- shell
build.sh
#!/bin/bash
set -e
echo "Building application"
docker build -t build:latest -f "deployment/build.docker" .
build.docker
RUN mkdir /app
ADD . /app/
WORKDIR /app
//code that creates /dist folder
VOLUME ["/app/dist"]
push.sh
#!/bin/bash
set -e
docker build -t push:latest -f "deployment/push.docker" .
#and other stuff here
push.docker
// the first catalog is not there
ADD /app/dist /web
'sh: 0: kann nicht geöffnet cp ERROR: Build fehlgeschlagen: Exit-Status 1 ' Da stimmt etwas nicht – VanDavv