Which command creates a new OpenShift application from a Git repository with a specific build environment variable and context directory?

Prepare for the Red Hat OpenShift Developer II DO288 Exam with our quizzes. Study with flashcards and multiple choice questions, each with hints and explanations. Get ready for your certification!

Multiple Choice

Which command creates a new OpenShift application from a Git repository with a specific build environment variable and context directory?

Explanation:
To build from a Git repository with a defined build environment and a specific subdirectory, OpenShift needs to know which builder image to use, which repository and branch to pull, and where in the repo to look for the application code. The proper pattern is the builder image name followed by a tilde, then the Git repository, and a hash with the branch to build from: <builder-image>~<git-repo>#<branch>. This tells OpenShift exactly which builder to use, which code version to fetch, and which directory in the repo to treat as the build context. The build-env option sets the environment variable npm_config_registry for the build, and the --context-dir option points to the subdirectory within the repo that contains the app. The correct command includes all of these pieces: the build-env variable, the builder-image ~ repository with a specified branch, and the context-dir. The other options miss the branch, omit the builder-image prefix, or omit the context directory, so they don’t specify the exact source and build configuration required.

To build from a Git repository with a defined build environment and a specific subdirectory, OpenShift needs to know which builder image to use, which repository and branch to pull, and where in the repo to look for the application code. The proper pattern is the builder image name followed by a tilde, then the Git repository, and a hash with the branch to build from: ~#. This tells OpenShift exactly which builder to use, which code version to fetch, and which directory in the repo to treat as the build context. The build-env option sets the environment variable npm_config_registry for the build, and the --context-dir option points to the subdirectory within the repo that contains the app.

The correct command includes all of these pieces: the build-env variable, the builder-image ~ repository with a specified branch, and the context-dir. The other options miss the branch, omit the builder-image prefix, or omit the context directory, so they don’t specify the exact source and build configuration required.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy