Page MenuHomeDevCentral

Clone and compile darkbot on Eglide
ClosedPublic

Authored by dereckson on Jan 25 2017, 18:11.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 06:33
Unknown Object (File)
Sat, Nov 9, 22:41
Unknown Object (File)
Sat, Nov 9, 22:41
Unknown Object (File)
Sat, Nov 9, 22:40
Unknown Object (File)
Tue, Nov 5, 08:37
Unknown Object (File)
Mon, Nov 4, 07:29
Unknown Object (File)
Thu, Oct 31, 14:38
Unknown Object (File)
Sun, Oct 27, 10:38
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
No Lint Coverage
Unit
No Test Coverage
Branch
odderon-code (branched from master)
Build Status
Buildable 1326
Build 1574: arc lint + arc unit

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.