Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 45 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
# since we don't need sudo, travis recommend xenial
dist: xenial

language: node_js

os: linux
# we don't need previous commits, so don't need default depth of 50
git:
depth: 1

matrix:
include:
- node_js: '8'
- node_js: '10'
# have to enable branch build to trigger on git tag but
# we don't want the same job to run twice on pull request
branches:
only:
- master
- dev
- /^v.*$/ # Ensure to build release tags of format v1.0.0-1

sudo: false
stages:
- test
- name: publish
if: tag IS present # https://docs.travis-ci.com/user/conditions-v1

install:
- npm install
script:
- npm run test:ci
- npm install

after_success:
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
jobs:
include:
- stage: test
name: "Unit Tests on Node 8"
node_js: "8"
script:
- npm run test:ci
after_success:
- npm run test:coverage
- cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage
- name: "Unit Tests on Node 10"
node_js: "10"

deploy:
provider: npm
email: $NPM_EMAIL_ACCOUNT
api_key:
secure: Iu5Q2uuiF+jRWkNRtX77YElMwyEopzKD+iHQQkT7HheH12AwDAW/PZiwLRhBTif8kvHmIIwPhjey6i7QwmJFUmpb433299WF+tinRhy5mBFntdaNmgS2Wvv/hOFJza2XdOeIsKA+s+zPAGArfLonmvQX5QKVmJI7/W+hyqJT0FjtTMqxPyJ00ENuDeZdUEcsaoDAwu1XTA6bj5ILnguR+smeGoZscpp8nwTv27fA+GWLFGf08pPAyuHSwc1/lRxSbLlw/f0ZqnCclGU+SF2EV4/9+xxcPWqtJdJfURR/LaOkg3Q5o4aILRjNJNCbpRkrc5lEcPEvBPLrI6e7F9ssg08aHniaMvdD5B9TsgGqV6sxZX/KvMIHWfzBRLuCzY2bPE8Wbw+ZI/yi9+89NZdRikAMyWocvg4tx1OsQRcrRltsXqQrZyw45IR5oSv0kLx54xrslXu8jjP08jQEpnBncJp883DX6DmO42TRP4QYHsQ8BB5hHQ2qmVoKMydkLy0Kdvq7e+9v/pZHEMsR/HOwz1S5xYsSeqwqoq4u/H+hPFWu3GVJXbsVLHZuaDU3fBRMtJOcjujPszrvN/cNt2JryTT1EYPJotmpURqu/n9vPLMzoi1wIKPrZiAcEzh8MLlM93MyG/yuPeHZOvMuwCVtOXd3KKH8sEJvbTVUtKIvQXw=
on:
tags: true
repo: serverless/serverless-azure-functions
branch: master
- stage: publish
name: "NPM release for dev" # rename before merge to master
node_js: "8"
before_deploy:
- npm run build
deploy:
- provider: npm
email: "sls-az@microsoft.com"
api_key:
secure: hFgX3Ru3/CnT90d5WYXZ6Yr91zsHw+D+ZxaDdimtjMSjhZjKgA6HJ82A9SlpVRIm0WcwVYyBX8nd2j4d+Gkcefd8B4tt/UHOxuzFmt9Q5GvyjdKgA0jzY4XqjUogh142IUJUABRodmh8Wr7mHWCXhNNJu17UUyEf+KRliz72Orp36JEmozdgf+CpzVyzGUL2OLBZSmkjpFTUS4clOVhzwj0G2IHNB7qcupAVQ+r3DOjiU1N4+KkT+yrWH1esqOZYWVcqyVTUgkrfLU1eyaP8IemS+nT3Y9l0VxXY6nnZ4fkENbrivaN5cgp/GPSFb6QSiMbwImaPgxhyj2sIb1ydnoza5lR83b5Tsaa5E90gUbU23kms9J0Qi+6WLaI63kdfvQidl2A5UVpDr+lVusg0gfibkMUo4Jbof67o9coAu+WO80qS0jdn9cAg3gX6Xx9c7fUdHrFfxw4TBxjfI0SO7gJwbZvLZsZ9WsTT/SflIUQL72MhiYTQNIk7ewIVQXjb6eDuZS0tgSu3Gb0W7CIsVW7fwMmMvlEfzkzH119YYVUwwBCACfCgyXaFaamJ1tLHRlp1yjDjkBMZLlbOh18cSrTBu86+RBSX+I1jRvNoUxSTtzZjCI9i7sv9lEP2zq5EEMbA8qjCguu48knqQIrzsPNVCysKrNI964aVb8k4MyY=
skip_cleanup: true
tag: beta # tag all npm publish from dev branch with "beta" TODO: remove before merge to master
on: # https://docs.travis-ci.com/user/deployment/#conditional-releases-with-on
tags: true
repo: serverless/serverless-azure-functions
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,33 @@ This will remove the `{functionName}` directory and remove the function from `se

*Note: Add & remove currently only support HTTP triggered functions. For other triggers, you will need to update `serverless.yml` manually

### Running Function App Locally (`offline` plugin)

In order to run a Azure Function App locally, the `azure-functions-core-tools` package needs to be installed from NPM. Since it is only used for local development, we did not include it in the `devDependencies` of `package.json`. To install globally, run:

```bash
npm i azure-functions-core-tools -g
```

Then, at the root of your project directory, run:

```bash
# Builds necessary function bindings files
sls offline
# Starts the function app
npm start
```

The build process will generate a directory for each of your functions, which will contain a file titled `function.json`. This will contain a relative reference to your handler file & exported function from that file as long as they are referenced correctly in `serverless.yml`.

The `npm start` script just runs `func host start`, but we included the `npm` script for ease of use.

To clean up files generated from the build, you can simply run:

```bash
sls offline cleanup
```

### Deploy, test, and diagnose your Azure service

1. Deploy your new service to Azure! The first time you do this, you will be asked to authenticate with your Azure account, so the `serverless` CLI can manage Functions on your behalf. Simply follow the provided instructions, and the deployment will continue as soon as the authentication process is completed.
Expand Down
Loading