Populating a projects "Deployments" using "deploy_script" section in appveyor.xml

Ben Hastings's Avatar

Ben Hastings

14 Mar, 2019 12:27 PM

Hi,

We're new users to Appveyor and are trying to create a configuration file which will run our tests on Windows & Linux and then deploy to an environment that isn't specified in Appveyors "Environments" section. Because we are deploying to http://pypi.org we need to use the deploy_script section rather than the deploy section.

Is there any way for us to populate the "deployments" section (see attached image) of our project?

Please see our current build script below

environment:
  matrix:
    # Windows w/64 bit Geo & python 3.6
    - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
      PYTHON: "C:\\Python36-x64"

    # Ubuntu - python 3
    - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
      PYTHON: "3.6"

stack: python %PYTHON%

init:
  - python --version
  - cmd: set PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
  - python --version

build: off

test_script:
  - python setup.py test

deploy_script:
  - python --version
  # deploy.sh just does `twine upload` to deploy our project
  - sh: "bash -e deploy.sh"

Thanks,

  1. Support Staff 1 Posted by Owen McDonnell on 14 Mar, 2019 03:50 PM

    Owen McDonnell's Avatar

    I'm not sure what you mean by 'an environment that isn't specified in Appveyors "Environments" section'.
    You mean you need to create one? That can be done with this API call and a deployment can be started to that environment with this API call.

  2. 2 Posted by Ben Hastings on 14 Mar, 2019 03:55 PM

    Ben Hastings's Avatar

    I don't think I can create one that fits my needs. My deployment is just uploading my python package to pypi which I don't think is covered by any of Appveyors environment providers.

    For example, in https://www.appveyor.com/docs/api/environments-deployments/#add-env... the provider is "FTP" which is not what I need to do - and none of the other providers (WebDeploy, Amazon S3 etc) fit my needs.

  3. Support Staff 3 Posted by Owen McDonnell on 14 Mar, 2019 04:43 PM

    Owen McDonnell's Avatar

    If you do not want to do this deployment "inline" from the build itself, then the other alternative i would suggest is a deployment project.

    It may not be quite as nice as having your deployments tab in the same project but it is one way to have custom deployment scripts and keep deployments asynchronous/separate from builds.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Already uploaded files

  • deployments.png 49.5 KB

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

20 Mar, 2019 01:15 PM
20 Mar, 2019 11:09 AM
20 Mar, 2019 10:37 AM
20 Mar, 2019 09:01 AM
20 Mar, 2019 08:51 AM

 

20 Mar, 2019 02:33 AM
19 Mar, 2019 06:21 PM
19 Mar, 2019 06:03 PM
19 Mar, 2019 05:22 PM
19 Mar, 2019 05:08 PM
19 Mar, 2019 05:00 PM