이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 9. OpenShift Build Process


When an application developer pushes changes to an application's Git repository, OpenShift Enterprise builds and deploys the application using the updated repository. The build and deploy process changes if the application is scaling or if it uses a builder cartridge.

9.1. Default Build Life Cycle

If no builder cartridge is present, OpenShift Enterprise executes the default build life cycle when an application developer pushes changes to an application Git repository. The default life cycle consists of a build, preparation, distribute, and deploy phase.
In the default build life cycle, OpenShift Enterprise manages the starting and stopping of the application, and moves the updated code into $OPENSHIFT_REPO_DIR. The primary cartridge and application developer action hooks ($OPENSHIFT_REPO_DIR/.openshift/action_hooks) determine specific behaviors during this process.

Build Phase

During this phase, OpenShift Enterprise:
  1. Runs the gear stop command to stop the application.
  2. Runs the control pre-receive command on the primary cartridge.
  3. Runs the control pre-repo-archive command on the primary cartridge.
  4. Creates a new application directory: $OPENSHIFT_HOMEDIR/app-deployments/$date_$time and dependent subdirectories.

    Note

    If your cartridge requires a particular directory structure for dependencies, create a symbolic link for your cartridge directory structure into $OPENSHIFT_DEPENDENCIES_DIR. Use $OPENSHIFT_BUILD_DEPENDENCIES_DIR for build time only dependencies.
  5. Copies $OPENSHIFT_HOMEDIR/app-root/runtime/dependencies from the active application to $OPENSHIFT_HOMEDIR/app-deployments/$date_$time/dependencies.
  6. Removes previous applications starting from the oldest until the number set at $OPENSHIFT_KEEP_DEPLOYMENTS is reached.
  7. Copies the new application source code to $OPENSHIFT_REPO_DIR. This is the only point in the build life cycle when OpenShift Enterprise copies the application source code.
  8. Runs the control pre-build command on the primary cartridge.
  9. Runs the pre-build user action hook, if present.
  10. Runs the control build command on the primary cartridge.
  11. Runs the build user action hook, if present.

Preparation Phase

  1. OpenShift Enterprise runs the prepare user action hook, if present.
  2. The application ID and checksum of application contents are calculated.
  3. OpenShift Enterprise creates $OPENSHIFT_HOMEDIR/app-deployments/by-id/$deployment_id and points to ../app-deployments/$date_time

Distribute Phase

  1. OpenShift Enterprise synchronizes the new application with all child gears if the application is scalable.

Deploy Phase

During this phase, OpenShift Enterprise:
  1. Updates $OPENSHIFT_HOMEDIR/app-root/runtime/repo so it points to ../../app-deployments/$date_$time/repo
  2. Updates $OPENSHIFT_HOMEDIR/app-root/runtime/dependencies so it points to ../../app-deployments/$date_$time/dependencies
  3. Runs the control update-configuration command on the primary cartridge.
  4. Starts all secondary cartridges in the application.
  5. Runs the control deploy command on the primary cartridge.
  6. Runs the deploy user action hook, if present.
  7. Starts the primary cartridge using the gear start command.
  8. Runs the control post-deploy command on the primary cartridge.
  9. Runs the post-deploy user action hook, if present.
Result:

The build is now complete and the application is running.

맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat