Page MenuHomeDevCentral

Clone and compile darkbot on Eglide
ClosedPublic

Authored by dereckson on Jan 25 2017, 18:11.
Tags
None
Referenced Files
F2824554: D861.diff
Thu, Apr 18, 08:15
F2822322: D861.diff
Wed, Apr 17, 22:57
F2822128: D861.id2188.diff
Wed, Apr 17, 22:25
Unknown Object (File)
Wed, Apr 17, 19:15
Unknown Object (File)
Sun, Apr 14, 22:09
Unknown Object (File)
Sun, Apr 14, 22:08
Unknown Object (File)
Sun, Apr 14, 06:59
Unknown Object (File)
Sat, Apr 13, 13:48
Subscribers
None

Details

Summary

The darkbot repository contains:

  • source/: the source code
  • dat/: the configuration
  • build/: the built version

As dat/ is handled in Git, we can't clone this repository to be used directly.

So, we're going to clone it and maintain a build in /opt/darkbot.

Then, we'll deploy our own configuration to /opt/odderon.

This change handles the /opt/darkbot clone and compile part.

Ref T1129.

Test Plan

Run /opt/darkbot/build/darkbot.

Diff Detail

Repository
rOPS Nasqueron Operations
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson added inline comments.
roles/shellserver/odderon/code.sls
14

user: odderon or nothing

dereckson edited edge metadata.

www → odderon

Create directory before clone Git

Clone is okay, but the requisite doesn't work, as we doesn't have a stat updating this file through file.managed.

Salt master
$ salt eglide state.apply roles/shellserver/odderon/
[…]
          ID: darkbot_repo
    Function: file.directory
        Name: /opt/darkbot
      Result: True
     Comment: Directory /opt/darkbot updated
     Started: 18:43:45.706455
    Duration: 11.918 ms
     Changes:   
              ----------
              /opt/darkbot:
                  New Dir
----------
          ID: darkbot_repo
    Function: git.latest
        Name: https://devcentral.nasqueron.org/source/darkbot.git
      Result: True
     Comment: https://devcentral.nasqueron.org/source/darkbot.git cloned to /opt/darkbot. Branch 'production' checked out, with remote HEAD (581a257) as a star
ting point.
     Started: 18:43:45.779015
    Duration: 13209.316 ms
     Changes:   
              ----------
              new:
                  https://devcentral.nasqueron.org/source/darkbot.git => /opt/darkbot
              revision:
                  ----------
                  new:
                      581a257c1c021ad7afad89de2bb26c2c90981482
                  old:
                      None
----------
          ID: darkbot_repo
    Function: cmd.run
        Name: sh build.sh
      Result: False
     Comment: The following requisites were not found:
                                 onchanges:
                                     file: /opt/darkbot/.git/refs/heads/production
     Changes:   

Summary for eglide
------------
Succeeded: 4 (changed=2)
Failed:    1
------------
Total states run:     5
Total run time:  13.881 s
ERROR: Minions returned with non-zero exit code

Adjust build code when repo is cloned part.

Works.

It creates the repository or update, then recompile. The build works fine.

Eglide
$ sudo -u odderon ./darkbot         
  * * * * * * * * * * Darkbot v8  Release Candidate 4 * * * * * * * * * * *
  *                       The IRC Talking Robot                           *
  *                                                                       *
  *      Creator/Author       : Jason <jason@superlink.net>               *
This revision is now accepted and ready to land.Jan 25 2017, 19:19
This revision was automatically updated to reflect the committed changes.