ci: use --volumes-from to share job container workspace with kaniko
This commit is contained in:
parent
5a5e61a603
commit
5311eeb1b5
|
|
@ -7,31 +7,42 @@ jobs:
|
||||||
env:
|
env:
|
||||||
DOCKER_HOST: tcp://172.17.0.1:2375
|
DOCKER_HOST: tcp://172.17.0.1:2375
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Build and push Backend (Kaniko)
|
- name: Build and push Backend (Kaniko)
|
||||||
run: |
|
run: |
|
||||||
|
# Find this job container by its known name pattern
|
||||||
|
JOB_CONTAINER=$(docker ps --format '{{.Names}}' | grep 'GITEA-ACTIONS-TASK' | head -1)
|
||||||
|
echo "Using volumes from: $JOB_CONTAINER"
|
||||||
|
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
|
--volumes-from "$JOB_CONTAINER" \
|
||||||
gcr.io/kaniko-project/executor:latest \
|
gcr.io/kaniko-project/executor:latest \
|
||||||
--context=http://192.168.8.248:3000/deepkoluguri/chitfund.git \
|
--context=dir:///workspace/deepkoluguri/chitfund/backend \
|
||||||
--context-sub-path=backend \
|
--dockerfile=Dockerfile \
|
||||||
--git=branch=master,single-branch=true \
|
|
||||||
--destination=192.168.8.250:5000/chitfund-backend:latest \
|
--destination=192.168.8.250:5000/chitfund-backend:latest \
|
||||||
--insecure \
|
--insecure \
|
||||||
--skip-tls-verify \
|
--skip-tls-verify
|
||||||
--insecure-pull
|
|
||||||
|
|
||||||
build-frontend:
|
build-frontend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
DOCKER_HOST: tcp://172.17.0.1:2375
|
DOCKER_HOST: tcp://172.17.0.1:2375
|
||||||
steps:
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Build and push Frontend (Kaniko)
|
- name: Build and push Frontend (Kaniko)
|
||||||
run: |
|
run: |
|
||||||
|
JOB_CONTAINER=$(docker ps --format '{{.Names}}' | grep 'GITEA-ACTIONS-TASK' | head -1)
|
||||||
|
echo "Using volumes from: $JOB_CONTAINER"
|
||||||
|
|
||||||
docker run --rm \
|
docker run --rm \
|
||||||
|
--volumes-from "$JOB_CONTAINER" \
|
||||||
gcr.io/kaniko-project/executor:latest \
|
gcr.io/kaniko-project/executor:latest \
|
||||||
--context=http://192.168.8.248:3000/deepkoluguri/chitfund.git \
|
--context=dir:///workspace/deepkoluguri/chitfund/luckychit \
|
||||||
--context-sub-path=luckychit \
|
--dockerfile=Dockerfile \
|
||||||
--git=branch=master,single-branch=true \
|
|
||||||
--destination=192.168.8.250:5000/chitfund-frontend:latest \
|
--destination=192.168.8.250:5000/chitfund-frontend:latest \
|
||||||
--insecure \
|
--insecure \
|
||||||
--skip-tls-verify \
|
--skip-tls-verify
|
||||||
--insecure-pull
|
|
||||||
Loading…
Reference in New Issue