Results

Simple build and test example

This is an example that you can run on the same host as the MAIA installation. Follow the steps in the example and verify that the installation, on a very basic level, is working ok, . The example can also serve as an template to start developing and integrating to a more advanced solution for you.

Prerequisites:
  • MAIA is installed and running on a host, listening on port 8888

  • MAIA is in init-state ( "empty" with a default admin user and team)

    On the same host:

  • Kafka is installed, running and listens to port 9092

  • ruby is installed, version >= 2.6

  • git is installed

First step:
  • On the MAIA host: create the directory run_dir
rm -rf /tmp/run_dir
mkdir /tmp/run_dir
Setup in MAIA:

login as admin (the username and password is published in the installation log file).

name: testuser

email: testuser@example.com

select local auth and add a password

name: maiatest

in the first tab: add testuser as member of team maiatest

in the Team permissions tab: select the below permissions to the team.

  • Access all records

  • Create commits

  • Create/destroy environments

  • Create artifacts

  • Create test_results and test_suites

Click on 'Reveal', enter testuser password then cut-and-paste the token to the file /tmp/run_dir/api-token

GIT repository
  • Create a GIT repo named 'first'
mkdir -p /tmp/repo/first
cd /tmp/run_dir/repo/first
git init
git checkout -b master
  • Create a commit with the files at the root of the repo
cp <path_to_example>/code/* > first
git add .
git commit -a -m "First commit"
Setup and run MAIA Agent
  • Set environment variable BLT_ENV
export BLT_ENV=<path_to_example>/environment.yml
  • Install MAIA Agent
cd /tmp/run_dir

cat > Gemfile
source 'https://maiadev.t2data.com/gems'
gem 'maia-agent'

bundle config --local path .bundle
bundle install
  • Scan the commit
cd /tmp/run_dir
bundle exec maia git_scan -r first
  • MAIA Dashboard

A commit should appear (with a warning triangle) in the Latest Commits widget.

  • MAIA Commits

Open the Commits page from the Main menu, to see the commit with track: 'first:master' and comment: 'First commit' (with a warning triangle).

  • Checkout the first:master component
bundle exec maia checkout -c first -t master

A clone of the repo should be created at /tmp/run_dir/src

  • Run the build
bundle exec maia build -c first -t master

Open the Built artifacts page from the Main menu to see one artifact with name: first_1.1-XXXXX version: 2.4.0

  • Run test
bundle exec maia test -c first -t master

Open the Test executions page from the Main menu to see one successful test run.

Debugging

Log file:

/opt/data/t2maia/var/log/maia_core/production_XXX.log

Enable debug in maia_agent:

Add option -d

Reset MAIA to init state:
/opt/data/t2maia/bin/ipv stop
/opt/data/t2maia/bin/ipv reset
/opt/data/t2maia/bin/ipv start