Export the variables in the environment file to BLT_ENV.
export BLT_ENV=path_to_maia_agent/environment.yml
Verify that it is possible to check out a repository with the MAIA Agent command checkout.
bundle exec maia checkout -c component_name
The code in the component with component_name should be cloned to the path defined in SRC_ROOT.
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.
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
rm -rf /tmp/run_dir
mkdir /tmp/run_dir
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
mkdir -p /tmp/repo/first
cd /tmp/run_dir/repo/first
git init
git checkout -b master
cp <path_to_example>/code/* > first
git add .
git commit -a -m "First commit"
export BLT_ENV=<path_to_example>/environment.yml
cd /tmp/run_dir
cat > Gemfile
source 'https://maiadev.t2data.com/gems'
gem 'maia-agent'
bundle config --local path .bundle
bundle install
cd /tmp/run_dir
bundle exec maia git_scan -r first
A commit should appear (with a warning triangle) in the Latest Commits widget.
Open the Commits page from the Main menu, to see the commit with track: 'first:master' and comment: 'First commit' (with a warning triangle).
bundle exec maia checkout -c first -t master
A clone of the repo should be created at /tmp/run_dir/src
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
bundle exec maia test -c first -t master
Open the Test executions page from the Main menu to see one successful test run.
Log file:
/opt/data/t2maia/var/log/maia_core/production_XXX.log
Enable debug in maia_agent:
Add option -d
/opt/data/t2maia/bin/ipv stop
/opt/data/t2maia/bin/ipv reset
/opt/data/t2maia/bin/ipv start