Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial about how to integration with users' deployment processes #119

Open
EYHN opened this issue Sep 28, 2022 · 0 comments
Open

Tutorial about how to integration with users' deployment processes #119

EYHN opened this issue Sep 28, 2022 · 0 comments
Assignees

Comments

@EYHN
Copy link
Member

EYHN commented Sep 28, 2022

Perfsee can analyze performance of applications after every deployment and send rich performance reports to developers to keep them informed of performance changes in new releases.

Tracking Pull request performance

Deploy test environment for each Pull Request, and perfsee will automatically analyze performance for each pull request and show performance reports in the Pull Request comments.

Integration

Perfsee provides multiple ways to integrate with your existing deployment (pipeline/platform/workflow) with minimal changes.

    • Vercel
    • Netlify
  • https://github.com/EYHN/perfsee-action-test

  • Github Deployments are requests to deploy a specific ref (branch, SHA, tag). GitHub dispatches a deployment event that external services can listen for and act on when new deployments are created. Github Deployments enable developers and organizations to build loosely coupled tooling around deployments, without having to worry about the implementation details of delivering different types of applications.

    Perfsee can be used with Github Deployments by creating a simple github action workflow.

    Create access token

    Follow the tutorial here create an access token.

    In your Github repository, go to Settings > Secrets > Action to save the Access Token you just created as PERFSEE_TOKEN for action use.

    Create same environments on Perfsee and Github

    You need to make sure you have created environments on perfsee with the same name as github, for Github Page usually be github-pages. To check environments, open Settings > Environments in Github repository and Settings > Environments in Perfsee project.

    图片

    Create github action workflow

    Create a new action workflow .github/workflows/after-deploy.yaml in your repository.

    name: After deploy
    
    on: [deployment_status]
    
    jobs:
      lab:
        # only runs this job on successful deploy
        if: github.event.deployment_status.state == 'success'
        runs-on: ubuntu-latest
        steps:
          - name: Run lab
            uses: EYHN/[email protected]
            with:
              project: perfsee
              token: ${{ secrets.PERFSEE_TOKEN }}

    Trigger a deployment

    Create a deployment or deploy a github page, you can see the status of the deployment in your pull request or https://github.com/xxx/xxx/deployments, and when the deployment is done you can see the github action running successfully and the perfsee lab test in your commit.

    Deployment stats:

    图片图片

    Github action and perfsee lab:

    图片
    • Command Line Tool

    After deployment, you can use command line tool to start a lab scan from your automatic deployment script or the terminal. Be aware that the lab scan requires access to your application, make sure the application is ready to use.

    Create access token

    Follow the tutorial here create an access token and save it for later use.

    Installation

    Use the following command to install command-line tools via npm.

    Detail documentation for @perfsee/sdk

    npm install -g @perfsee/sdk

    Trigger a lab scan

    After your application has been deployed, run the following command to start a lab scan.

    In the command you need to provide the access token which you created earlier and the project id, and the git commit hash of this deployment to match the lab snapshot to the commit.

    perfsee take-snapshot --token <access-token> --project <projectId> --hash <commit-hash>

    If success it will log out Created snapshot #1 and you can view the results on the platform.

@EYHN EYHN changed the title Integration with users' deployment processes Tutorial about how to integration with users' deployment processes Oct 17, 2022
@forehalo forehalo pinned this issue Nov 11, 2022
@forehalo forehalo self-assigned this Nov 14, 2022
@forehalo forehalo assigned EYHN and unassigned forehalo Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants