title: Issues with gitlab-ci stages
body: <p>I've been working on setting up an automated RPM build and I'd like to perform a simple test on the SPEC file before proceeding with any build steps. The problem I am having is that the job always seems to jump to the deploy stage. Here is the relevant snippet from my .gitlab-ci.yml:</p>
  
  <pre><code>stages:
    - test
    - build
    - deploy
  
  job1:
    stage: test
    script:
      # Test the 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 the submodules to build
      - git submodule update --init
  
      # build the RPM
      - su - newbuild -c "rpmbuild -ba --target=`uname -m` -vv ~/rpmbuild/SPECS/package.SPEC"
  
    stage: deploy
    script:
      # move the RPM/SRPM
      - mkdir -pv $BUILD_DIR/$RELEASEVER/{SRPMS,x86_64}
      - 'for f in $WORK_DIR/rpmbuild/RPMS/x86_64/*; do  cp -v "$f" $BUILD_DIR/$RELEASEVER/x86_64; done'
      - 'for f in $WORK_DIR/rpmbuild/SRPMS/*; do cp -v "$f" $BUILD_DIR/$RELEASEVER/SRPMS; done'
  
      # create the repo
      - createrepo -dvp $BUILD_DIR/$RELEASEVER
  
      # update latest
      - 'if [ $CI_BUILD_REF_NAME == "master" ]; then rm $PROJECT_DIR/latest; ln -sv $(basename $BUILD_DIR) $PROJECT_DIR/latest; fi'
      - 'if [ $CI_BUILD_REF_NAME == "devel" ]; then rm $PROJECT_DIR/latest-dev; ln -sv $(basename $BUILD_DIR) $PROJECT_DIR/latest-dev; fi'
  
    tags:
      - repos
  </code></pre>
  
  <p>I've not found any questions or online documentation to properly explain this to me so any help is appreciated!</p>