CuBoulder/atlas

Name: atlas

Owner: University of Colorado Boulder

Description: Website inventory and deployment agent for Web Express

Created: 2016-02-17 21:28:25.0

Updated: 2018-03-16 14:40:20.0

Pushed: 2018-04-02 19:24:23.0

Homepage: https://cuboulder.github.io/atlas/

Size: 2704

Language: Python

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Atlas

Atlas is a RESTful API that interacts with servers to deploy and maintain Web Express at University of Colorado Boulder.

Features
API
Getting started
Installing

See Express_local for setting up a local development environment.

Configuration

Configuration is split between various files config_*.py. You need to create config_local.py and config_servers.py files. If you are on anything other than a local development environment, you will also need to create a .mylogin.cnf file to authenticate into MySQL (http://dev.mysql.com/doc/refman/5.7/en/mysql-config-editor.html). The naming convention is [database_user]_[environment].

Populating Atlas

Code items should be created first. Required fields are: git URL, commit hash, Name, Version, and Type (core, profile, module, theme, library). Optional fields are: is_current (allows you to indicate the preferred version of a code item) and a tagging field.

Site items are created with a 'pending' status and can be assigned a specific core and/or profile when created. If a core or profile is not specified, the 'current' version of the default is used.

Deploying Atlas

Currently we use a git pull deployment. When code is changed, you need to restart Celery, Celerybeat and Apache.

Celery Flower is available via to command line to inspect tasks.

ta/environments/atlas/bin/celery -A celery flower --conf=path/to/atlas/config_flower.py

Celery will return a url in the first part of a long response.

70118 22:33:35 command:136] Visit me at http://[YOUR-URL]:5555
Contributing

Pull requests are always welcome. Project is under active development. We are committed to keeping the Express Drupal install profile and Atlas independent of each other.

Best Practices and Notes
Code maintenance

The safest option is always to use POST to create a new item and then to PATCH the site over.

Using Commands
Sample requests
Code items
Drupal core 7.42
 -i -v -X POST -d '{"git_url": "git@github.com:CuBoulder/drupal-7.x.git", "commit_hash": "9ee4a1a2fa3bedb3852d21f2198509c107c48890", "meta":{"version": "7.42", "code_type": "core", "name": "drupal", "is_current": true}}' -H 'Content-Type: application/json' -u 'USERNAME:PASSWORD' https://inventory.local/atlas/code
Express 2.2.5
 -i -v -X POST -d '{"git_url": "git@github.com:CuBoulder/express.git", "commit_hash": "5f1fb979cacff22d6641da3c413696d02f9cc5f5", "meta":{"version": "2.2.5", "code_type": "profile", "name": "express", "is_current": true}}' -H 'Content-Type: application/json' -u 'USERNAME:PASSWORD' https://inventory.local/atlas/code
Site items
Create a Site
 -i -v -X POST -d '{"status": "pending"}' -H 'Content-Type: application/json' -u 'USERNAME:PASSWORD' https://inventory.local/atlas/sites
Patch a Site to 'installed'
 -i -v -X PATCH -d '{"status": "installed"}' -H "If-Match: 4173813fc614292febc79241a8b677266cbed826" -H 'Content-Type: application/json' -u 'USERNAME:PASSWORD' https://inventory.local/atlas/sites/579b8f9a89b0dc0d7d7ce090
Patch a new Profile in (update site to new version of profile)
 -i -v -X PATCH -d '{"code": {"profile": "57adffc389b0dc1631822bce"}}' -H "If-Match: b8c1942d0238559ca9c3333626777ec7ce97f955" -H 'Content-Type: application/json' -u 'USERNAME:PASSWORD' https://inventory.local/atlas/sites/57adff1389b0dc1613d0f948
Delete a site
 -i -v -X DELETE -H "If-Match: 5b3bc91045cca9fdc9a8b50bfb4095ecceb2dcbe" -H 'Content-Type: application/json' -u 'USERNAME:PASSWORD' https://inventory.local/atlas/sites/57adfdb789b0dc1612c23a90

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.