<p><a href="https://docs.gitlab.com/ee/ci/yaml/#stages" rel="nofollow noreferrer">stages</a> are required</p>

<pre><code>stages:
  - stage1

stage1:
  stage: stage1
  script:
    - echo hello
</code></pre>

<p>Could you try the following:</p>

<pre><code>before_script:
  - pushd . &amp;&amp; uru 233 &amp;&amp; popd &amp;&amp; set HOME=c:\ &amp;&amp; ruby -v &amp;&amp; bundle install

stages:
  - rspec
  - rubocop
  - flay

rspec:
  stage: rspec
  script:
    - bundle exec rspec

rubocop:
  stage: rubocop
  script:
    - bundle exec rubocop

flay:
  stage: flay
  script:
    - bundle exec flay *
</code></pre>

CC BY-SA 3.0
2017-09-19T16:07:28.027Z
@Pierre.Vriens the answer has been updated
030
CC BY-SA 3.0
2017-09-19T16:20:30.187Z
Voilà, veel beter!
Pierre.Vriens
CC BY-SA 3.0
2017-09-20T07:16:44.007Z
That doesn't make much sense, if no stages are defined then build/test/deploy stages are available and a job with no stage defined is automatically linked to the test stage.
Tensibai
CC BY-SA 3.0
2017-09-20T10:17:42.447Z
I've since put stages on, since I started keeping artifacts and have a section in deploy to Gitlab Pages (now I have to get the admin to enable pages which is 'low priority'). I will try adding in before_stage again today. We are also changing the nodes and using Docker, though. I'd like to report that Docker never had this problem.
David West
CC BY-SA 3.0
2017-09-19T15:36:02.403Z
2017-09-19T16:05:57.323Z
2017-09-19T16:05:57.323Z
030
<p>I have a Gitlab Runner running locally on my windows box. It works fine for the before script section.</p>

<p>my <code>.gitlab-ci.yml</code> follows:</p>

<pre><code>before_script:
  - pushd . &amp;&amp; uru 233 &amp;&amp; popd &amp;&amp; set HOME=c:\ &amp;&amp; ruby -v &amp;&amp; bundle install

rspec:
  script:
    - bundle exec rspec

rubocop:
  script:
    - bundle exec rubocop

flay:
  script:
    - bundle exec flay *
</code></pre>

<p>It does not do anything after the before script, though. Does not run any of the jobs.</p>

<p>How can I find out what's going on?</p>

<p>I was able to fix it with a super-non-ideal/hacky solution that I don't like:</p>

<pre><code>rspec:
  script:
    - pushd . &amp;&amp; uru 233 &amp;&amp; popd &amp;&amp; set HOME=c:\ &amp;&amp; ruby -v &amp;&amp; bundle install &amp;&amp; bundle exec rspec

rubocop:
  script:
    - pushd . &amp;&amp; uru 233 &amp;&amp; popd &amp;&amp; set HOME=c:\ &amp;&amp; ruby -v &amp;&amp; bundle install &amp;&amp; bundle exec rubocop

flay:
  script:
    - pushd . &amp;&amp; uru 233 &amp;&amp; popd &amp;&amp; set HOME=c:\ &amp;&amp; ruby -v &amp;&amp; bundle install &amp;&amp; bundle exec flay *
</code></pre>

<p>People sending comments have also prompted me to add that in Windows it seems to be stopping at the first array element in every script session.</p>

<p>With a Docker configuration for the runner I can do things like:</p>

<pre><code>my_job_name:
  script:
    - a command
    - another command
</code></pre>

<p>With the windows shell runner it just stops after <code>a command</code> if I do it this way. Stringing the commands together seemed to work, but I would rather not have to put everything on one line.</p>

CC BY-SA 3.0
2017-09-20T07:21:06.317Z
Why do you chain commands with && ? May you share a log of one of your job  failing ?
Tensibai
CC BY-SA 3.0
2017-09-20T10:13:23.963Z
So that if a command fails it stops. I could use `;` and just have it move on, but If don't want that.  BTW I have things set up so my prompt us more like `bash`. Usually in vanilla Windows I see people using one `&`
David West
CC BY-SA 3.0
2017-09-20T10:19:11.843Z
@Tensibai I'll look for the logs.
David West
CC BY-SA 3.0
2017-09-20T10:48:10.443Z
or you could use an array in gitlab and don't need a so long and ugly line also
Tensibai
CC BY-SA 3.0
2017-09-20T10:50:05.750Z
I did originally it seemed to be stopping at the first element in every array.
David West
CC BY-SA 3.0
2017-09-20T10:51:06.087Z
Check your syntaxes then, either there's a problem with it or your runner is buggy. (check for tabs set instead of spaces mainly)
Tensibai
CC BY-SA 3.0
2017-09-20T10:59:22.660Z
I have a feeling that it does the equivalent of a Linux `exit 0` after it completes a command in every section. It was telling me my builds were passing and then I realized it didn't run anything past the first line with the windows shell runner. So I smooshed everything to one line. Then it worked, but it looked hacky. So I can I changed the runner so it runs inside a Ruby:2.3 Docker container.
David West
CC BY-SA 3.0
2017-09-20T12:47:43.017Z
Without any log I can't tell, run the pipeline in debug and share it if you want a better feedback, could be 1 bug in the windows runner
Tensibai
<gitlab>
Gitlab Runner not running scripts with Windows shell configuration
David West
# Gitlab Runner not running scripts with Windows shell configuration

(Asked by: username_0 on 2017-09-19)

I have a Gitlab Runner running locally on my windows box. It works fine for the before script section.
my .gitlab-ci.yml follows:
before_script:
  - pushd . && uru 233 && popd && set HOME=c:\ && ruby -v && bundle install

rspec:
  script:
    - bundle exec rspec

rubocop:
  script:
    - bundle exec rubocop

flay:
  script:
    - bundle exec flay *

It does not do anything after the before script, though. Does not run any of the jobs.
How can I find out what's going on?
I was able to fix it with a super-non-ideal/hacky solution that I don't like:
rspec:
  script:
    - pushd . && uru 233 && popd && set HOME=c:\ && ruby -v && bundle install && bundle exec rspec

rubocop:
  script:
    - pushd . && uru 233 && popd && set HOME=c:\ && ruby -v && bundle install && bundle exec rubocop

flay:
  script:
    - pushd . && uru 233 && popd && set HOME=c:\ && ruby -v && bundle install && bundle exec flay *

People sending comments have also prompted me to add that in Windows it seems to be stopping at the first array element in every script session.
With a Docker configuration for the runner I can do things like:
my_job_name:
  script:
    - a command
    - another command

With the windows shell runner it just stops after a command if I do it this way. Stringing the commands together seemed to work, but I would rather not have to put everything on one line.

**Tags:** gitlab

> **Comments:**
> **username_1**: Why do you chain commands with && ? May you share a log of one of your job  failing ?  
> **username_0**: So that if a command fails it stops. I could use `;` and just have it move on, but If don't want that.  BTW I have things set up so my prompt us more like `bash`. Usually in vanilla Windows I see people using one `&`  
> **username_0**: @username_1 I'll look for the logs.  
> **username_1**: or you could use an array in gitlab and don't need a so long and ugly line also  
> **username_0**: I did originally it seemed to be stopping at the first element in every array.  
> **username_1**: Check your syntaxes then, either there's a problem with it or your runner is buggy. (check for tabs set instead of spaces mainly)  
> **username_0**: I have a feeling that it does the equivalent of a Linux `exit 0` after it completes a command in every section. It was telling me my builds were passing and then I realized it didn't run anything past the first line with the windows shell runner. So I smooshed everything to one line. Then it worked, but it looked hacky. So I can I changed the runner so it runs inside a Ruby:2.3 Docker container.  
> **username_1**: Without any log I can't tell, run the pipeline in debug and share it if you want a better feedback, could be 1 bug in the windows runner  

---

## 1 answers

### Answer by username_2 on 2017-09-19. Score: 4 | Accepted answer

stages are required
stages:
  - stage1

stage1:
  stage: stage1
  script:
    - echo hello

Could you try the following:
before_script:
  - pushd . && uru 233 && popd && set HOME=c:\ && ruby -v && bundle install

stages:
  - rspec
  - rubocop
  - flay

rspec:
  stage: rspec
  script:
    - bundle exec rspec

rubocop:
  stage: rubocop
  script:
    - bundle exec rubocop

flay:
  stage: flay
  script:
    - bundle exec flay *

> **Comments:**
> **username_2**: @username_3 the answer has been updated  
> **username_3**: Voilà, veel beter!  
> **username_1**: That doesn't make much sense, if no stages are defined then build/test/deploy stages are available and a job with no stage defined is automatically linked to the test stage.  
> **username_0**: I've since put stages on, since I started keeping artifacts and have a section in deploy to Gitlab Pages (now I have to get the admin to enable pages which is 'low priority'). I will try adding in before_stage again today. We are also changing the nodes and using Docker, though. I'd like to report that Docker never had this problem.  

---

