Git Product home page Git Product logo

test-ssh-action's Introduction

Operous SSH Test Action 🦥

This GitHub Action will trigger an SSH test at Operous and return its results.

Getting Started

To configure the action, you will need to get your server IDs at Operous and write the workflow YAML accordingly.

How get your registered servers IDs

There are two ways you can get your servers IDs:

  • Acessing the server details page as follows:

  • Using the public API to get multiple IDs at once:

    • Create a public API token following this guide;
    • Mount a simple request using the servers query:
      1. curl -X POST \
          -H 'Authorization: Token <Your created token>' \
          -H 'Content-Type: application/json' \
          -d '{"query":"{ servers { name identifier }}"}' \
        'https://app.operous.dev/graphql'
      2. {
          "data": {
            "servers": [
              { "name": "ancient-rock-700", "identifier": "gMAjMO8mkmhsFRxW" },
              {
                "name": "snobbish-friend-3818",
                "identifier": "SnmjBjasb5TgadQk"
              },
              { "name": "tan-cakes-6272", "identifier": "hCkhyiR5eT7kXjs5" },
              { "name": "naive-blow-9270", "identifier": "wDK3idtzjWlsezC9" }
            ]
          }
        }

Mounting the workflow YAML

You can include the action in your workflow to trigger on any event that GitHub actions supports. You'll need to provide the action with your API Token from you Operous account.

In the example below, a push on the main branch will start the SSH test on the registered servers with the provided identifier. The pipeline will only succeed if the tests in all servers are successful.

name: Test action
on:
  push:
    branches:
      - main
jobs:
  test:
    name: "Operous ssh test action"
    runs-on: ubuntu-latest
    steps:
      - name: Run Operous ssh test
        uses: operous/[email protected]
        with:
          accountToken: ${{ secrets.OPEROUS_ACCOUNT_TOKEN }}
          serverIds: "SnmjBjasb5TgadQk,gMAjMO8mkmhsFRxW,hCkhyiR5eT7kXjs5"

Configuration

The with portion of the workflow must be configured before the action will work. You can add these in the with section found in the examples above. Any secrets must be referenced using the bracket syntax and stored in the GitHub repositories Settings/Secrets menu. You can learn more about setting environment variables with GitHub actions here.

Setup

The following configuration options should be set.

Key Value Information
accountToken Your Operous account API token. Follow this guide if you need to create one.
serverIds A list of server identifiers you can get on the server detailed information page at Operous.

Development

  • First install the dependencies with yarn
  • Build and generate the code with yarn build
  • Run the tests with yarn jest

test-ssh-action's People

Contributors

joao10lima avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

joao10lima

test-ssh-action's Issues

Implement Operous ssh test Github action

Objective

As planned in the official Operous product roadmap.
The Operous product must have a GitHub action that allows integration of the Operous ssh test in CI/CD Pipelines.

Implementation

Inputs:

  • The pipeline configuration file must receive two parameters
    • serverIds: A list separated by comma with the respective Operous registered instances identifiers.
    • accountToken: The generated Operous account token.

Behavior:

  • Using the Operous public API, the action will trigger an SSH test run on the informed instances.
  • The action will output the test run result.
  • If any of the instances failed on the test, it will make the whole pipeline fail

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.