# Skipping a deployment with the script provider because this branch is not permitted: develop

**URL:** <https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113>\
**Category:** Deployment\
**Created:** [February 4, 2019, 12:37pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113 "2019-02-04T12:37:53Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zeyad-37](https://avatars.discourse-cdn.com/v4/letter/z/c5a1d2/32.png) [@Zeyad-37](https://travis-ci.community/u/Zeyad-37)\
**Post date:** [February 4, 2019, 12:37pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/1 "2019-02-04T12:37:53Z")

</div>

```auto
language: android
jdk: oraclejdk8
sudo: false

before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
  directories:
  - $HOME/.gradle/caches/
  - $HOME/.gradle/wrapper/
  - $HOME/.android/build-cache

android:
  components:
    # Latest Tools
    - tools
    - platform-tools
    - tools

    # Gradle Tools
    - android-28
    - build-tools-28.0.3

    # Other Dependencies
    - extra-google-m2repository
    - extra-android-m2repository
    - extra-google-android-support
    - extra-google-google_play_services
    - addon-google_apis-google-28

    # Simulator Image
    # - sys-img-${ANDROID_ABI}-${ANDROID_TARGET}

  licenses:
     - 'android-sdk-preview-license-52d11cd2'
     - 'android-sdk-license-.+'
     - 'google-gdk-license-.+'

before_install:
  - yes | sdkmanager "platforms;android-28"
  - mkdir -p "$ANDROID_HOME/licenses"
  - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
  - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
  - chmod +x gradlew
  - ./gradlew dependencies || true
  - gem update --system
  - gem install fastlane --no-document --quiet
  - touch local.properties

script:
  - android list targets
  - ./gradlew --stacktrace jacocoTestCiUnitTestReport

after_success:
  - bash <(curl -s https://codecov.io/bash) -t afaad3fa-936a-4c8e-836e-850c52e3388d

deploy:
  - provider: script
    script: touch local.properties
            ./gradlew fastlaneDeployAlpha
    on:
      branches:
        only:
        - develop
  - provider: script
    script: touch local.properties
            ./gradlew fastlaneDeployRelease
    on:
      branches:
        only:
        - master

```

This my .travis.yml, My builds are succeeding but not deploying.  
In the logs i am getting this warning twice in a row.

```
Skipping a deployment with the script provider because this branch is not permitted: develop

```

Thanks in advance for your help

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [February 4, 2019, 12:56pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/2 "2019-02-04T12:56:55Z")

</div>

Your configuration defines 2 deployments—one for `develop` and one for `master`. There will be a deployment and a warning message if the build runs on either of these branches. All other branches will have 2 warning messages about skipping.

If you believe this is not the case, please point to a build log URL to show it.

---

<div class="post-metadata">

**Author:** ![Zeyad-37](https://avatars.discourse-cdn.com/v4/letter/z/c5a1d2/32.png) [@Zeyad-37](https://travis-ci.community/u/Zeyad-37)\
**Post date:** [February 4, 2019, 2:38pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/3 "2019-02-04T14:38:07Z")

</div>

So my problem is that on develop and master, i receive those warnings and my deployment does not happen.  
The repo i am working on is private.  
[https://travis-ci.com/Glovo/glovo-courier-android/builds/99616978](https://travis-ci.com/Glovo/glovo-courier-android/builds/99616978)

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [February 4, 2019, 3:16pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/4 "2019-02-04T15:16:50Z")

</div>

In your configuration, you have a superfluous `only` key, which invalidates the condition (so the default rule "only on the `master`" applies).

It should look like:

```auto
deploy:
  - provider: script
    script: touch local.properties
            ./gradlew fastlaneDeployAlpha
    on:
      branches: develop

```

Please review [https://docs.travis-ci.com/user/deployment/#conditional-releases-with-on](https://docs.travis-ci.com/user/deployment/#conditional-releases-with-on).

Thanks.

---

<div class="post-metadata">

**Author:** ![Zeyad-37](https://avatars.discourse-cdn.com/v4/letter/z/c5a1d2/32.png) [@Zeyad-37](https://travis-ci.community/u/Zeyad-37)\
**Post date:** [February 4, 2019, 4:14pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/5 "2019-02-04T16:14:07Z")

</div>

```
deploy:
  - provider: script
    script: touch local.properties
            ./gradlew fastlaneDeployAlpha
    on:
      branches: develop
  - provider: script
    script: touch local.properties
            ./gradlew fastlaneDeployRelease
    on:
      branches: master

```

So this is my updated travis file and i am still facing the exact same problem. Successful builds without deployments. Thanks in advance

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [February 4, 2019, 4:57pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/6 "2019-02-04T16:57:14Z")

</div>

Ooops. It is `branch:`, not `branches:` to add the condition.

```auto
on:
  branch: develop

```

---

<div class="post-metadata">

**Author:** ![Zeyad-37](https://avatars.discourse-cdn.com/v4/letter/z/c5a1d2/32.png) [@Zeyad-37](https://travis-ci.community/u/Zeyad-37)\
**Post date:** [February 4, 2019, 5:45pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/7 "2019-02-04T17:45:42Z")

</div>

I applied your fix, but still the same result. This time just a single warning not 2.

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [February 4, 2019, 7:10pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/8 "2019-02-04T19:10:07Z")

</div>

In build #1324, you should see the deployment for the `deploy` one:

```auto
⋮
Installing deploy dependencies
Successfully installed dpl-script-1.10.6
Parsing documentation for dpl-script-1.10.6
Installing ri documentation for dpl-script-1.10.6
Done installing documentation for dpl-script after 0 seconds
1 gem installed

Preparing deploy
Cleaning up git repository with `git stash --all`. If you need build artifacts for deployment, set `deploy.skip_cleanup: true`. See https://docs.travis-ci.com/user/deployment#Uploading-Files-and-skip_cleanup.
Saved working directory and index state WIP on (no branch): cc2ff02 one more trial to fix the deployment step

Deploying application
⋮

```

as well as the skip message for the `master` one:

```auto
Skipping a deployment with the script provider because this branch is not permitted: develop

Done. Your build exited with 0.

```

---

<div class="post-metadata">

**Author:** ![Zeyad-37](https://avatars.discourse-cdn.com/v4/letter/z/c5a1d2/32.png) [@Zeyad-37](https://travis-ci.community/u/Zeyad-37)\
**Post date:** [February 5, 2019, 10:23am UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/9 "2019-02-05T10:23:36Z")

</div>

Thats correct, but the problem is that i didnt find the artefact deployed. That script was working fine when it was just one deployment on develop, once i added the master its not working anymore

---

<div class="post-metadata">

**Author:** ![BanzaiMan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/banzaiman/32/67_2.png) [@BanzaiMan](https://travis-ci.community/u/BanzaiMan)\
**Post date:** [February 5, 2019, 12:50pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/10 "2019-02-05T12:50:51Z")

</div>

Do note that your `script` value is defined with:

```
script: touch local.properties
        ./gradlew fastlaneDeployAlpha

```

which is equivalent to

```
script: touch local.properties ./gradlew fastlaneDeployAlpha

```

I don’t think this is what you want.

---

<div class="post-metadata">

**Author:** ![Zeyad-37](https://avatars.discourse-cdn.com/v4/letter/z/c5a1d2/32.png) [@Zeyad-37](https://travis-ci.community/u/Zeyad-37)\
**Post date:** [February 5, 2019, 3:06pm UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/11 "2019-02-05T15:06:38Z")

</div>

i want to create a file named “local.properties” before the deploy happens, because without creating it the build fails. So how can i have both commands to run sequentially ? Thanks

---

<div class="post-metadata">

**Author:** ![Zeyad-37](https://avatars.discourse-cdn.com/v4/letter/z/c5a1d2/32.png) [@Zeyad-37](https://travis-ci.community/u/Zeyad-37)\
**Post date:** [February 6, 2019, 9:28am UTC](https://travis-ci.community/t/skipping-a-deployment-with-the-script-provider-because-this-branch-is-not-permitted-develop/2113/12 "2019-02-06T09:28:09Z")

</div>

i fixed it

```
deploy:
  - provider: script
    script: ./gradlew fastlaneDeployAlpha
    skip_cleanup: true
    on:
      branch: develop
  - provider: script
    script: ./gradlew fastlaneDeployRelease
    skip_cleanup: true
    on:
      branch: master
```
