hal / hal-core
Core domain entities and shared resources for Hal UI and Agent.
This package's canonical repository appears to be gone and the package has been frozen as a result.
Requires
- php-64bit: ~7.0
- ext-libsodium: ~1.0
- ext-pdo: *
- ext-pdo_mysql: *
- ext-pdo_pgsql: *
- ext-pdo_sqlite: *
- ext-zlib: *
- doctrine/orm: ~2.5.6
- ql/mcp-common: ~1.1
Requires (Dev)
- mockery/mockery: ~0.9
- phpunit/phpunit: ~5.7
- robmorgan/phinx: ~0.6
- symfony/config: ~2.8 || ~3.0
- symfony/dependency-injection: ~2.8 || ~3.0
- symfony/yaml: ~2.8 || ~3.0
This package is auto-updated.
Last update: 2021-07-12 04:49:15 UTC
README
Hal Core Components
Core domain entities and shared resources for Hal UI and Agent.
- Hal Doctrine Entities
- Phinx Database Migrations
- Crypto for Encrypted Properties
The ORM used by Hal is Doctrine and migrations are handled with Phinx.
Database
Doctrine Protips
- Do not cache one-to-many relations!
Handling migrations
Configuration for the migration tool is stored in phinx.yml
. This project contains phinx.yml.dist with default
settings for dev only. Make sure to copy this file to phinx.yml
and add additional settings for managing other environments.
The included script bin/phinx
will run Phinx and also an env file phinx.secrets
. Phinx will automatically replace
environment variables prepended with PHINX_
.
See the following for an example, which stores production database password in phinx.secrets
:
phinx.secrets
:
#!/usr/bin/env sh export PHINX_PROD_PASSWORD='my-secret-password'
phinx.yml
:
# include other config from phinx.yml.dist here environments: prod: adapter: 'pgsql' host: 'prod_database_server' name: 'prod_database_name' user: 'prod_database_username' pass: '%%PHINX_PROD_PASSWORD%%' port: 5432 charset: 'utf8'
Check out the official Phinx documentation for handling configuration: docs.phinx.org
Set up Postgres DB for development
cp phinx.yml.dist phinx.yml
createdb hal
createuser hal --superuser
bin/phinx migrate
Hal Domain Model
Applications
-
An application in the system. Contains information about source code location.
-
Applications are owned by Organizations.
-
Value stored in Hal's encrypted configuration dictionary.
System
-
Denormalized event for record-keeping.
-
Configuration value used by the Hal platform. For Hal internal system use only.
Jobs
-
Build job. Builds are run with a
commit
for a specificenvironment
. -
Release job. Releases are run with a
build
for a specifictarget
. -
Any event that occurs during a build or release. Contains parameters or data such as shell output or configuration parameters.
-
Metadata published by a build or release. Information that may be searched or analyzed for further use.
-
An action or process that can be triggered by a job. Currently only used to auto-kickoff a release after a successful build.
Deployment Management
-
An environment in the system.
-
Groups are collection of targets, used to control permissions or simply naturally organize them. Groups typically have a
type
andname
such as "Grouprsync
for servermydevserver
" -
Configuration for a group in a environment. Applications can have many targets for a single group or environment. Example: "Target for CodeDeploy
group
with CodeDeploy application nametest-app
and S3 bucketdev-releases
". -
Security credentials used to connect to a target such as access tokens or private keys.
User Management
-
A user in the system.
-
User permission. Permissions can be assigned per environment, application, organization, or globally.
-
User specific settings such as their favorite applications.
-
Tokens can be created by users to access the API.