All Projects → eliperelman → now-travis

eliperelman / now-travis

Licence: other
No description or website provided.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to now-travis

Now Clear
A utility to delete all zeit now instances that aren't aliased
Stars: ✭ 12 (-76%)
Mutual labels:  now, zeit
Stage Ci
Automatic deploy previews for your PRs using zeit.co/now.
Stars: ✭ 132 (+164%)
Mutual labels:  now, zeit
Now Storage
Use Now static deployments to upload and store files.
Stars: ✭ 91 (+82%)
Mutual labels:  now, zeit
Vercel Builder
Vercel Builder for Nuxt.js
Stars: ✭ 437 (+774%)
Mutual labels:  now, zeit
Now Pipeline
Simple CI pipeline with goal to deploy new version at Zeit Now cloud if tests pass
Stars: ✭ 143 (+186%)
Mutual labels:  now, zeit
Now Builders
Official Now Builders created by the ZEIT team
Stars: ✭ 483 (+866%)
Mutual labels:  now, zeit
Deploy.now
One click deploys to △ now
Stars: ✭ 121 (+142%)
Mutual labels:  now, zeit
Covid19 Brazil Api
API com dados atualizados sobre o status do COVID-19 🦠
Stars: ✭ 300 (+500%)
Mutual labels:  now, zeit
Micro Medium Api
Microservice for fetching the latest posts of Medium with GraphQL.
Stars: ✭ 138 (+176%)
Mutual labels:  now, zeit
Create React App Now
Hello, create-react-app, meet Zeit's awesome now.sh service.
Stars: ✭ 137 (+174%)
Mutual labels:  now, zeit
Vercel Php
▲ Vercel PHP runtime • vercel-php • now-php • 🐘+ λ = ❤
Stars: ✭ 429 (+758%)
Mutual labels:  now, zeit
Now Client
A JavaScript wrapper for the Now Instant API
Stars: ✭ 199 (+298%)
Mutual labels:  now, zeit
Micro Proxy
[DEPRECATED] Simplest proxy server for microservices
Stars: ✭ 358 (+616%)
Mutual labels:  now, zeit
Jwt Example
Playing with user registration, login/logout, auth, etc using JWTs, serverless functions & faunadb as the data store.
Stars: ✭ 22 (-56%)
Mutual labels:  now, zeit
Meteor Now
Instantly deploy your Meteor apps with `meteor-now`
Stars: ✭ 339 (+578%)
Mutual labels:  now, zeit
Now Logs
realtime logging for now - https://logs.now.sh
Stars: ✭ 103 (+106%)
Mutual labels:  now, zeit
notion-custom-domain
📝 Custom domains for your public Notion pages
Stars: ✭ 23 (-54%)
Mutual labels:  now, zeit
now-course
Proyecto para el curso de Now.sh en Platzi
Stars: ✭ 19 (-62%)
Mutual labels:  now, zeit
Nextjs Vercel Firebase
Next.js app using API routes to connect with Firestore.
Stars: ✭ 133 (+166%)
Mutual labels:  now, zeit
Vercel Rust
Community based builder for using rust on the now/zeit platform
Stars: ✭ 168 (+236%)
Mutual labels:  now, zeit

now-travis

Automatically deploy to ∆ Now from Travis pushes. Setting up now-travis can:

  • Automatically create staging deployments for pull requests
  • Automatically deploy and alias upon pushes to master

Warning: Using now-travis has the potential to create many deployments, enough to blow through the allotment on the Free plan. It is recommended to only use this on the Pro or Enterprise accounts.

Setup

In order to use now-travis on a repository, you'll need some keys to authorize it to execute actions in Travis. The following set up will walk you through this process.

First, you'll need to create a New personal access token. Give the token a name, and check the repo scope checkbox. This will only be used to set the status on pull requests with a ∆ Now URL. Be sure to keep this key ready to paste into an upcoming command.

Second, head over to Zeit's API tokens page and create a new token. This will be used to create deployments during pull requests and master pushes.

If your repository doesn't have a .travis.yml file, create an empty one now in the root of the repo.

Now we need to encrypt the API keys we generated into the .travis.yml file. This is done using a CLI tool. You can either install the travis-ci tool or the travis-encrypt npm tool for encrypting these values.

If you are using the travis-ci tool, execute the following command in your terminal, substituting <owner>, <repo_name>, <gh_key>, and <now_key> with the appropriate values:

travis encrypt -r <owner>/<repo_name> GH_TOKEN=<gk_key> NOW_TOKEN=<now_key> --add

If you are using the travis-encrypt tool from npm, execute the following command in your terminal, substituting <owner>, <repo_name>, <gh_key>, and <now_key> with the appropriate values:

travis-encrypt --add -r <owner>/<repo_name> GH_TOKEN=<gk_key> NOW_TOKEN=<now_key>

Your API keys are now encrypted in your .travis.yml file. Next, install now-travis in your project:

# Execute if using npm
npm install --save-dev now-travis

# Execute this instead if you are using yarn
yarn add --dev now-travis

Let's edit the .travis.yml file to automate deployments:

  1. Add after_script to execute now-travis after the build is done and successful. If you use an alias for your production deployments, add that to the NOW_ALIAS environment variable:
after_script:
  - NOW_ALIAS=myalias.com node_modules/.bin/now-travis
  1. Add branches to ensure we only create production deployments when pushing to the master branch:
branches:
  only:
    - master

Deployment

When creating pull requests after a Travis build has been successfully completed, now-travis will create a ∆ Now deployment and update the pull request with the staging URL:

Screenshot

Clicking on the "Details" link will open the page to the staging deployment URL.

If you want to get the staging URL in subsequent steps of your Travis build, e.g running a lighthouse-ci test on the stage build, you can instruct now-travis to write the URL in a file by passing a file argument with the name of the file.

  - NOW_ALIAS=myalias.com node_modules/.bin/now-travis --file=now-staging-url

With this, the staging URL will be written to a file named now-staging-url.

When pushing commits to master, now-travis will deploy the build to ∆ Now and alias the deployment using the value specified in the NOW_ALIAS environment variable. This environment variable is only used on pushes, not pull requests.

Notes

While this module has been tested, it may not work perfectly in every Travis deployment situation. Please test it out and report any issues that may arise.

Again, this package has the ability to create many deployments, potentially more than your Zeit plan allots. Please exercise judgement when installing this. By default, following these instructions for now-travis will create a deployment:

  • When a pull request is opened
  • When a pull request is re-opened
  • When a new commit is pushed to a pull request
  • When a commit is pushed to the master branch
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].