-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: better display in CI + introduce 'ci' context #293
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -287,7 +287,6 @@ function create_default_context(): Context | |
'power_shell' => false, | ||
'user_id' => posix_geteuid(), | ||
'root_dir' => \dirname(__DIR__), | ||
'env' => $_SERVER['CI'] ?? false ? 'ci' : 'dev', | ||
]; | ||
|
||
if (file_exists($data['root_dir'] . '/infrastructure/docker/docker-compose.override.yml')) { | ||
|
@@ -331,7 +330,28 @@ function create_default_context(): Context | |
$data['user_id'] = 1000; | ||
} | ||
|
||
return new Context($data, pty: 'dev' === $data['env']); | ||
return new Context( | ||
$data, | ||
pty: Process::isPtySupported(), | ||
environment: [ | ||
'BUILDKIT_PROGRESS' => 'plain', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's gather all env var here, to simplify CI configuration |
||
] | ||
); | ||
} | ||
|
||
#[AsContext(name: 'ci')] | ||
function create_ci_context(): Context | ||
{ | ||
$c = create_default_context(); | ||
|
||
return $c | ||
->withData([ | ||
// override the default context here | ||
]) | ||
->withEnvironment([ | ||
'COMPOSE_ANSI' => 'never', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The output is cleaner with this option in this CI. And it's much more digest but, it does not work on github 😭 edit: hooo, pretty sure docker version on GH is too old 🤯 Let's keep it for now... |
||
]) | ||
; | ||
} | ||
|
||
/** | ||
|
@@ -353,7 +373,6 @@ function docker_compose(array $subCommand, ?Context $c = null, bool $withBuilder | |
'USER_ID' => variable('user_id'), | ||
'COMPOSER_CACHE_DIR' => variable('composer_cache_dir'), | ||
'PHP_VERSION' => variable('php_version'), | ||
'BUILDKIT_PROGRESS' => 'plain', | ||
]) | ||
; | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does not make sens to have a "env" context when castor already has one.