GithubHelp home page GithubHelp logo

codeaffen / phpipam-action Goto Github PK

View Code? Open in Web Editor NEW
1.0 4.0 1.0 1.1 MB

Github action to setup a phpipam instance for testing purpose.

Home Page: https://codeaffen.org/projects/phpipam-action

License: GNU General Public License v3.0

JavaScript 100.00%
github github-actions-docker phpipam nodejs docker-compose github-actions

phpipam-action's Introduction

phpIPAM Action

CI Codacy Badge

This action start a complete phpIPAM instance for api testing purpose in github workflows.
In detail the action start two containers:

  • a mariadb container with a phpipam database
  • a phpipam container with a phpipam installation

After that the action does a few things to prepare the phpipam installation:

  • populate the database with default data
  • activate the api
  • create an app for api connection
  • set required password change for defaut admin to no - this is for local testing purposes

Parameters

We provide the following parameters to configure the phpipam instance database:

  • ipam_version: the phpipam version to install: Default: "latest"
  • ipam_database_host: Database host phpipam connects to. Default: "database"
  • ipam_database_user: Database user phpipam needs to authenticate. Default: "phpipam"
  • ipam_database_pass: Database password phpipam needs to authenticate. Default: "phpipam"
  • ipam_database_name: Database name phpipam uses. Default: "phpipam"
  • database_root_password: Root password for the database. Default: "root"

Note: If you define a database host, the database (ipam_database_name) needs to be created or emptied before the action can be executed.


Usage

The action is hosted in a separate repository and available on github marketplace. To use it you have to add the following to your github workflow:

steps:
  - uses: actions/checkout@v2
  - uses: codeaffen/phpipam-action@v2
    with:
      ipam_version: "1.4x"

If the action finishes successfully you will be able to run your api tests against the phpipam installation.

- name: "Test phpipam api"
  run: |
    curl -k --user Admin:ipamadmin -X POST https://localhost/api/ansible/user/

With the ipam_version parameter you will be able to test against different phpipam versions by using githubs build matrix feature. This is done by defining a job as follows:

jobs:
  matrix_test:
    strategy:
      matrix:
        phpipam: ['1.4x','1.5x']
    steps:
      - uses: actions/checkout@v2
      - name: run phpipam-action
        uses: codeaffen/phpipam-action@v2
        with:
          ipam_version: ${{ matrix.phpipam }}

phpipam-action's People

Contributors

cmeissner avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

cmeissner

phpipam-action's Issues

UnhandledPromiseRejection exception is fired while init database

Describe the bug

While executing init database commands inside the spinned up database container UnhandledPromiseRejection exception is fired.

executing "init database" inside "phpipam"
UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".

Obviously this is cause by a missing try-catch block in execInContainer function.

To Reproduce

Unfortunately I do not find a way to reproduce this issue. It happens sometimes on running actions in repo phpypam.

example workflow definition

Expected behavior

Running the database initialization commands should happens without any issue if the database container is there.

Versions:

  • python-version: ['3.6.x', '3.7.x', '3.8.x', '3.9.x', '3.10.x']
  • phpipan-action: codeaffen/phpipam-action@v2

Additional context
Add any other context about the problem here.

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.