-
If you haven't already mirrored your GitHub repo, mirror the GitHub repo
DevOps Project >> Code Repositories >> Mirror repository. -
Each time you make a change to the GitHub repo, synchornize the changes in the OCI code repo
DevOps Project >> Code Repositories >> github_graal-containers >> Synchronize now. -
Create a
Build pipeline. -
From
Build pipelines >> Parameters, add a new parameter with the following details:Name: REGISTRY_NAME Default value: container-registry.oracle.comClick
+to add. -
From
Build pipelines, add aStage >> Managed Buildto the build pipeline. Enter the following details:Stage name: Build the app JAR in the jdk-ee container Description: Build the app JAR in the GraalVM jdk-ee container Build spec file path: devops-build-spec/build_spec_jar_ee.yamlFor the
Primary code repository, select the following values:Source: Connection type: OCI Code Repository From the list of repos, select the "github_graal-containers" repo. Select Branch: main Build source name: gvmNote: The
Build source nameis the name of the folder where the build service will check out the code from the repository.Leave all other values unchanged.
Click
Add. -
Test the build pipeline by clicking the
Start manual runbutton. -
Add artifact. Enter the following details:
Name: jibber-jar-gvmee22-jdk17 Type: Container image repository Enter the fully qualified path to the image in Container Registry: (replace the values based on your region and tenancy namespace) <region-code>.ocir.io/<tenancy-namespace>/<repo-prefix>/jibber-jar-gvmee22-jdk17:${BUILDRUN_HASH} For example, phx.ocir.io/your-tenancy-namespace/gvm/jibber-jar-gvmee22-jdk17:${BUILDRUN_HASH} Replace parameters used in this artifact: Yes, substitute placeholdersClick Add.
-
Add a
Stage >> Deliver artifactsafter the Managed Build stage.Stage name: Push the runtime image containing the app JAR to OCIR Description: Push the runtime image containing the app JAR to OCIR Select artifacts: jibber-jar-gvmee22-jdk17 Associate artifacts with build result: Destination DevOps artifact name: jibber-jar-gvmee22-jdk17 Type: Docker image Build config/result artifact name: Build_output_image (should match the "name" of the "outputArtifacts" from your build_spec_jar_ee.yml file)Click
Add. -
Go to OCIR and create an empty Private Repository named
<repo-prefix>/jibber-jar-gvmee22-jdk17e.g.,gvm/jibber-jar-gvmee22-jdk17in your compartment. -
Test the build pipeline again by clicking the
Start manual runbutton. The runtime image should be pushed to the OCIR repo. -
To test the image on local,
- Update the image and tag in the docker-compose.yml file for the
jibber-jar-gvmee-jdk17service. - As the OCIR repo is private, you will need to docker login to OCIR in your region. Note that OCIR stands for OCI Registry which is different from OCR (Oracle Container Registry).
- If you haven't already logged in, run
docker login <region-code>.ocir.ioe.g.,docker login phx.ocir.ioin a terminal window. When prompted, enter your<tenancy-namespace>/<OCI-user-name>as the Username, and your<auth-token>as the Password. - Run
docker compose up --remove-orphansto start the application on port 8081. - Run
docker ps -ato check status of the running container. - Go to http://localhost:8081/jibber in a browser and you should see a nonsense verse.
- Run
docker compose stopin another terminal window to stop the application.
- Update the image and tag in the docker-compose.yml file for the