Q
Q
qwead2018-02-09 08:22:56
Continuous Integration
qwead, 2018-02-09 08:22:56

How to save files between stages in GitLab Runner?

There is a simple runner, divided into 2 stages.
How can you save state between stages? So that you can build the application in one step, and deploy it in the next step.


stages:
- build
- deploy
cache:
paths:
- node_modules/
build:
stage: build
script:
- touch 1.txt
- echo 1 >> 1.txt
deploy:
stage: deploy
script:
- touch 2.txt
- echo 2 >> 2.txt

stage: build

Checking cache for default...
Successfully extracted cache
$ touch 1.txt
$ echo 1 >> 1.txt
Creating cache default...
WARNING: node_modules/: no matching files
Archive is up to date!
Created cache
Job succeeded

stage: deploy

Using Shell executor...
Running on razrab...
Fetching changes...
Removing 1.txt

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question