-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
425 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,101 +3,39 @@ name: Build, Run and Test Docker Image | |
on: [push] | ||
|
||
jobs: | ||
build-run-test: | ||
build-test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
images: | ||
- artifact: alfresco-elasticsearch-live-indexing-metadata | ||
version: 4.0.1 | ||
name: alfresco-enterprise-search-metadata | ||
path: search/enterprise/common | ||
classifier: -app.jar | ||
group: org.alfresco | ||
- artifact: alfresco-elasticsearch-live-indexing-path | ||
version: 4.0.1 | ||
name: alfresco-enterprise-search-path | ||
path: search/enterprise/common | ||
classifier: -app.jar | ||
group: org.alfresco | ||
- artifact: alfresco-elasticsearch-live-indexing-content | ||
version: 4.0.1 | ||
name: alfresco-enterprise-search-content | ||
path: search/enterprise/common | ||
classifier: -app.jar | ||
group: org.alfresco | ||
|
||
steps: | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 4.1.7 | ||
|
||
- name: Setup .netrc | ||
run: | | ||
echo "machine nexus.alfresco.com" >> ~/.netrc | ||
echo "login ${{ secrets.NEXUS_USERNAME }}" >> ~/.netrc | ||
echo "password ${{ secrets.NEXUS_PASSWORD }}" >> ~/.netrc | ||
- name: Fetch artifacts from nexus | ||
run: ${{ github.workspace }}/scripts/fetch-artifact.sh | ||
working-directory: ${{ github.workspace }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@5927c834f5b4fdf503fca6f4c7eccda82949e1ee # 3.1.0 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@2ad185228a349d19414702819e06df9fa4314287 # 3.4.0 | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # 3.2.0 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Setup .netrc | ||
run: | | ||
echo "machine nexus.alfresco.com" >> ~/.netrc | ||
echo "login ${{ secrets.NEXUS_USERNAME }}" >> ~/.netrc | ||
echo "password ${{ secrets.NEXUS_PASSWORD }}" >> ~/.netrc | ||
|
||
- name: Fetch artifacts from nexus | ||
run: ${{ github.workspace }}/scripts/fetch-artifact.sh ${{ matrix.images.artifact }} ${{ matrix.images.version }} ${{ matrix.images.classifier }} ${{ matrix.images.group }} ${{ matrix.images.path }} | ||
working-directory: ${{ github.workspace }} | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@a254f8ca60a858f3136a2f1f23a60969f2c402dd # 6.4.0 | ||
with: | ||
context: . | ||
tags: ${{ matrix.images.name }}:test | ||
push: false | ||
load: true | ||
file: ${{ github.workspace }}/${{ matrix.images.path }}/Dockerfile | ||
|
||
- name: Run Docker image | ||
run: docker run -d -p 8080:8080 ${{ matrix.images.name }}:test | ||
|
||
- name: Wait for container | ||
run: sleep 30s | ||
- name: Bake Docker images | ||
uses: docker/bake-action@eac74531aa56a9266bfedfe5edb6b851ce2cca2b # v5.4.0 | ||
|
||
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | ||
|
||
- name: Save Docker image | ||
run: docker save ${{ matrix.images.name }}:test -o /tmp/${{ matrix.images.name }}.tar | ||
|
||
- name: Upload image as a tar for next job | ||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # 4.3.4 | ||
with: | ||
name: ${{ matrix.images.name }}-${{ github.run_number }} | ||
path: /tmp/${{ matrix.images.name }}.tar | ||
|
||
compose: | ||
name: docker-compose | ||
needs: build-run-test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@2ad185228a349d19414702819e06df9fa4314287 # 3.4.0 | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # 4.1.8 | ||
with: | ||
path: /tmp | ||
pattern: "*-${{ github.run_number }}" | ||
merge-multiple: true | ||
|
||
- name: Load Docker images | ||
run: | | ||
ls -1 /tmp/*.tar | xargs --no-run-if-empty -L 1 docker load -i | ||
docker image ls -a | ||
- name: Show all images | ||
run: docker images | ||
|
||
- name: Verify docker-compose | ||
uses: Alfresco/alfresco-build-tools/.github/actions/dbp-charts/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,175 @@ | ||
group "default" { | ||
targets = ["content_service", "enterprise-search"] | ||
} | ||
|
||
group "content_service" { | ||
targets = ["repository"] | ||
} | ||
|
||
group "enterprise-search" { | ||
targets = ["search_liveindexing"] | ||
} | ||
|
||
variable "LABEL_VENDOR" { | ||
default = "Hyland Software, Inc." | ||
} | ||
|
||
variable "LABEL_AUTHOR" { | ||
default = "Alfresco OPS-Readiness" | ||
} | ||
|
||
variable "LABEL_SOURCE" { | ||
default = "https://github.com/Alfresco/alfresco-dockerfiles" | ||
} | ||
|
||
variable "CODE_REF" { | ||
default = "local" | ||
} | ||
|
||
variable "PRODUCT_LINE" { | ||
default = "Alfresco" | ||
} | ||
|
||
variable "CREATED" { | ||
default = formatdate("YYYY'-'MM'-'DD'T'hh':'mm':'ss'Z'", timestamp()) | ||
} | ||
|
||
variable "REVISION" { | ||
default = "$GITHUB_RUN_NUMBER" | ||
} | ||
|
||
variable "DISTRIB_NAME" { | ||
default = "rockylinux" | ||
} | ||
|
||
variable "DISTRIB_MAJOR" { | ||
default = "9" | ||
} | ||
|
||
variable "JDIST" { | ||
default = "jre" | ||
} | ||
|
||
variable "IMAGE_BASE_LOCATION" { | ||
default = "docker.io/rockylinux:9" | ||
} | ||
|
||
variable "JAVA_MAJOR" { | ||
default = "17" | ||
} | ||
|
||
variable "LIVEINDEXING" { | ||
default = "metadata" | ||
} | ||
|
||
target "java_base" { | ||
dockerfile = "./java/Dockerfile" | ||
args = { | ||
DISTRIB_NAME = "${DISTRIB_NAME}" | ||
DISTRIB_MAJOR = "${DISTRIB_MAJOR}" | ||
JDIST = "${JDIST}" | ||
IMAGE_BASE_LOCATION = "${IMAGE_BASE_LOCATION}" | ||
JAVA_MAJOR = "${JAVA_MAJOR}" | ||
LABEL_NAME = "${PRODUCT_LINE} Java" | ||
LABEL_VENDOR = "${LABEL_VENDOR}" | ||
CREATED = "${CREATED}" | ||
REVISION = "${REVISION}" | ||
} | ||
labels = { | ||
"org.label-schema.schema-version" = "1.0" | ||
"org.label-schema.name" = "${PRODUCT_LINE} Java" | ||
"org.label-schema.vendor" = "${LABEL_VENDOR}" | ||
"org.label-schema.build-date" = "${CREATED}" | ||
"org.label-schema.url" = "$LABEL_SOURCE" | ||
"org.label-schema.vcs-url" = "$LABEL_SOURCE" | ||
"org.label-schema.vcs-ref" = "$CODE_REF" | ||
"org.opencontainers.image.title" = "${PRODUCT_LINE} Java" | ||
"org.opencontainers.image.description" = "A base image shipping OpenJDK JRE ${JAVA_MAJOR} for Alfresco Products" | ||
"org.opencontainers.image.vendor" = "${LABEL_VENDOR}" | ||
"org.opencontainers.image.created" = "${CREATED}" | ||
"org.opencontainers.image.revision" = "${REVISION}" | ||
"org.opencontainers.image.url" = "$LABEL_SOURCE" | ||
"org.opencontainers.image.source" = "$LABEL_SOURCE" | ||
"org.opencontainers.image.authors" = "${LABEL_AUTHOR}" | ||
} | ||
tags = ["alfresco-base-java:${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] | ||
output = ["type=cacheonly"] | ||
} | ||
|
||
variable "TOMCAT_MAJOR" { | ||
default = "10" | ||
} | ||
|
||
variable "TOMCAT_VERSION" { | ||
default = "10.1.26" | ||
} | ||
|
||
variable "TOMCAT_SHA512" { | ||
default = "0a62e55c1ff9f8f04d7aff938764eac46c289eda888abf43de74a82ceb7d879e94a36ea3e5e46186bc231f07871fcc4c58f11e026f51d4487a473badb21e9355" | ||
} | ||
|
||
variable "TCNATIVE_VERSION" { | ||
default = "1.3.0" | ||
} | ||
|
||
variable "TCNATIVE_SHA512" { | ||
default = "5a6c7337280774525c97e36e24d7d278ba15edd63c66cec1b3e5ecdc472f8d0535e31eac83cf0bdc68810eb779e2a118d6b4f6238b509f69a71d037c905fa433" | ||
} | ||
|
||
target "tomcat_base" { | ||
dockerfile = "./tomcat/Dockerfile" | ||
inherits = ["java_base"] | ||
contexts = { | ||
java_base = "target:java_base" | ||
} | ||
args = { | ||
TOMCAT_MAJOR = "${TOMCAT_MAJOR}" | ||
TOMCAT_VERSION = "${TOMCAT_VERSION}" | ||
TOMCAT_SHA512 = "${TOMCAT_SHA512}" | ||
TCNATIVE_VERSION = "${TCNATIVE_VERSION}" | ||
TCNATIVE_SHA512 = "${TCNATIVE_SHA512}" | ||
LABEL_NAME = "${PRODUCT_LINE} Tomcat" | ||
} | ||
labels = { | ||
"org.opencontainers.image.title" = "${PRODUCT_LINE} Tomcat" | ||
"org.opencontainers.image.description" = "A base image shipping Tomcat for Alfresco Products" | ||
} | ||
tags = ["alfresco-base-tomcat:tomcat${TOMCAT_MAJOR}-${JDIST}${JAVA_MAJOR}-${DISTRIB_NAME}${DISTRIB_MAJOR}"] | ||
output = ["type=cacheonly"] | ||
} | ||
|
||
target "repository" { | ||
context = "./repository" | ||
dockerfile = "Dockerfile" | ||
inherits = ["tomcat_base"] | ||
contexts = { | ||
tomcat_base = "target:tomcat_base" | ||
} | ||
labels = { | ||
"org.opencontainers.image.title" = "${PRODUCT_LINE} Content Repository" | ||
"org.opencontainers.image.description" = "Alfresco Content Services Repository" | ||
} | ||
tags = ["alfresco-content-repository:latest"] | ||
output = ["type=docker"] | ||
} | ||
|
||
target "search_liveindexing" { | ||
matrix = { | ||
liveindexing = ["metadata", "path"] | ||
} | ||
name = "search_liveindexing-${liveindexing}" | ||
args = { | ||
LIVEINDEXING = "${liveindexing}" | ||
} | ||
dockerfile = "./search/enterprise/common/Dockerfile" | ||
inherits = ["java_base"] | ||
contexts = { | ||
java_base = "target:java_base" | ||
} | ||
labels = { | ||
"org.opencontainers.image.title" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing}" | ||
"org.opencontainers.image.description" = "${PRODUCT_LINE} Enterprise Search - ${liveindexing} live indexing" | ||
} | ||
tags = ["alfresco-elasticsearch-live-indexing-${liveindexing}:latest"] | ||
output = ["type=docker"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Alfresco Base Java Image | ||
ARG DISTRIB_NAME | ||
ARG DISTRIB_MAJOR | ||
ARG IMAGE_BASE_LOCATION=docker.io/rockylinux:9 | ||
|
||
FROM ${IMAGE_BASE_LOCATION} AS rhlike | ||
|
||
ARG JDIST | ||
ARG JAVA_MAJOR | ||
|
||
ENV JAVA_HOME /etc/alternatives/jre | ||
ENV LANG C.UTF-8 | ||
ENV LC_ALL C.UTF-8 | ||
|
||
RUN \ | ||
yum update --security -y && \ | ||
yum install -y langpacks-en java-${JAVA_MAJOR}-openjdk-headless && \ | ||
yum clean all && rm -rf /var/cache/yum | ||
|
||
FROM rhlike AS rockylinux8 | ||
FROM rhlike AS rockylinux9 | ||
FROM rhlike AS rhel8 | ||
|
||
FROM ${DISTRIB_NAME}${DISTRIB_MAJOR} | ||
ARG DISTRIB_NAME | ||
ARG DISTRIB_MAJOR | ||
ARG JAVA_MAJOR | ||
|
||
RUN $JAVA_HOME/bin/java -version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.