Skip to content
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

Add a command for cloud-build #540

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Add a command for cloud-build #540

wants to merge 2 commits into from

Conversation

joehoyle
Copy link
Member

@joehoyle joehoyle commented Nov 4, 2022

So people can more easily test the builds as if there were in cloud, I've added a command that will run their .build-script using the same build-container that we used in CodeBuild.

So people can more easily test the builds as if there were in cloud, I've added a command that will run their `.build-script` using the same `build-container` that we used in CodeBuild.
Copy link
Member

@rmccue rmccue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to have this build into a temp-/sub-directory instead of overwriting the current dir?

inc/composer/class-command.php Outdated Show resolved Hide resolved
@@ -172,6 +172,8 @@ protected function execute( InputInterface $input, OutputInterface $output ) {
return $this->shell( $input, $output );
} elseif ( $subcommand === 'import-uploads' ) {
return $this->import_uploads( $input, $output );
} elseif ( $subcommand === 'cloud-build' ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: check-build?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just build?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the intention is to test that a build runs without errors, and doesn't actually produce a build that can be deployed to Altis, so build may be a bit misleading.

@kovshenin
Copy link
Contributor

Is it possible to have this build into a temp-/sub-directory instead of overwriting the current dir?

I was going to ask the same and went down a rabbit hole into how to force a volume mount with an overlay filesystem. Turned out to be a bit trickier than I though, but copying into a non-host directory and running the build there would also be okay I suppose.

@rmccue
Copy link
Member

rmccue commented Nov 7, 2022

Turned out to be a bit trickier than I though, but copying into a non-host directory and running the build there would also be okay I suppose.

Yeah, I'd copy it probably.

@joehoyle
Copy link
Member Author

joehoyle commented Nov 9, 2022

Hmm yeah if we want this to be a "readonly" operation, we'd need to do things a bit differently. We could increase the scope to run the "build process" from Altis Cloud (not just the build script), so that would mean: git clone, etc. In a subdir that's cleaned up afterwards or something. We could copy the entire working directory, but we'd want to exclude things like uploads, and existing node_modules could present another area of "not like for like" with production.

@kovshenin
Copy link
Contributor

That's one of the reasons I was hoping to have an overlay filesystem. With git clone it would mean that any changes have to be committed and pushed before testing, and the biggest advantage of having this available in Local Server is being able to test builds before committing your work.

Doing a copy and excluding things in .gitignore may be a good balance.

@rmccue
Copy link
Member

rmccue commented Nov 16, 2022

What if we make it the user's choice? By default, cp -r the working directory; allow a --commit[=HEAD] option.

@kovshenin
Copy link
Contributor

Wouldn't the commit still have to exist in the remote? And if so, wouldn't it likely already have a remote build available/running in Vantage?

@rmccue
Copy link
Member

rmccue commented Nov 17, 2022

Not necessarily, it can use your local commits which may not have been pushed; additionally, you're likely pushing to a feature branch which isn't getting built in Vantage, not one of the deploy branches.

Co-authored-by: Ryan McCue <me@ryanmccue.info>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants