Issues with gitlab-ci stages -


i've been working on setting automated rpm build , i'd perform simple test on spec file before proceeding build steps. problem having job seems jump deploy stage. here relevant snippet .gitlab-ci.yml:

stages:   - test   - build   - deploy  job1:   stage: test   script:     # test spec file     - su - newbuild -c "rpmbuild --nobuild -vv ~/rpmbuild/specs/package.spec"    stage: build   script:     # install our required packages     - yum -y install openssl-devel freetype-devel fontconfig-devel libicu-devel sqlite-devel libpng-devel libjpeg-devel ruby      # initialize submodules build     - git submodule update --init      # build rpm     - su - newbuild -c "rpmbuild -ba --target=`uname -m` -vv ~/rpmbuild/specs/package.spec"    stage: deploy   script:     # move rpm/srpm     - mkdir -pv $build_dir/$releasever/{srpms,x86_64}     - 'for f in $work_dir/rpmbuild/rpms/x86_64/*;  cp -v "$f" $build_dir/$releasever/x86_64; done'     - 'for f in $work_dir/rpmbuild/srpms/*; cp -v "$f" $build_dir/$releasever/srpms; done'      # create repo     - createrepo -dvp $build_dir/$releasever      # update latest     - 'if [ $ci_build_ref_name == "master" ]; rm $project_dir/latest; ln -sv $(basename $build_dir) $project_dir/latest; fi'     - 'if [ $ci_build_ref_name == "devel" ]; rm $project_dir/latest-dev; ln -sv $(basename $build_dir) $project_dir/latest-dev; fi'    tags:     - repos 

i've not found questions or online documentation explain me appreciated!

you have stages in 1 job not work. need split individual jobs 3 different stages.

quote documentation:

first jobs of build executed in parallel.

if jobs of build succeeds, test jobs executed in parallel.

if jobs of test succeeds, deploy jobs executed in parallel.

if jobs of deploy succeeds, commit marked success.

if of previous jobs fails, commit marked failed , no jobs of further stage executed.

something should work:

stages:   - test   - build   - deploy  do_things_on_stage_test:   script:     - things   stage: test   do_things_on_stage_build:   script:     - things   stage: build   do_things_on_stage_deploy:   script:     - things   stage: deploy 

Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -