Skip to content

Commit

Permalink
Merge pull request #202 from xebialabs/adding-ubuntu-image
Browse files Browse the repository at this point in the history
adding ubuntu image support.
  • Loading branch information
Murugesan-30795 authored Oct 13, 2023
2 parents 9350464 + d7482fe commit d75b4f9
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ pipeline {

stage('Rendering and Build Docker Images for XLProducts') {
parallel {
stage('Rendering and Build Docker Images for debian-slim centos amazonlinux') {
stage('Rendering and Build Docker Images for debian-slim centos ubuntu amazonlinux') {
when {
expression { params.Linux == true }
}
Expand Down Expand Up @@ -142,7 +142,7 @@ pipeline {
}

// Build Docker Image and push it
sh "pipenv run ./applejack.py build --xl-version ${xlr_LatestVersion} --download-source nexus --download-username ${NEXUS_CRED_USR} --download-password ${NEXUS_CRED_PSW} --product xl-release --target-os debian-slim --target-os centos --target-os amazonlinux --push --registry ${params.Registry}"
sh "pipenv run ./applejack.py build --xl-version ${xlr_LatestVersion} --download-source nexus --download-username ${NEXUS_CRED_USR} --download-password ${NEXUS_CRED_PSW} --product xl-release --target-os debian-slim --target-os ubuntu --target-os centos --target-os amazonlinux --push --registry ${params.Registry}"
}

if (params.xl_deploy == true) {
Expand All @@ -156,7 +156,7 @@ pipeline {
}

// Build Docker Image and push it
sh "pipenv run ./applejack.py build --xl-version ${xld_LatestVersion} --download-source nexus --download-username ${NEXUS_CRED_USR} --download-password ${NEXUS_CRED_PSW} --product xl-deploy --target-os debian-slim --target-os centos --target-os amazonlinux --push --registry ${params.Registry}"
sh "pipenv run ./applejack.py build --xl-version ${xld_LatestVersion} --download-source nexus --download-username ${NEXUS_CRED_USR} --download-password ${NEXUS_CRED_PSW} --product xl-deploy --target-os debian-slim --target-os ubuntu --target-os centos --target-os amazonlinux --push --registry ${params.Registry}"
}
if (params.central_configuration == true) {

Expand All @@ -169,7 +169,7 @@ pipeline {
}

// Build Docker Image and push it
sh "pipenv run ./applejack.py build --xl-version ${cc_LatestVersion} --download-source nexus --download-username ${NEXUS_CRED_USR} --download-password ${NEXUS_CRED_PSW} --product central-configuration --target-os debian-slim --target-os centos --target-os amazonlinux --push --registry ${params.Registry}"
sh "pipenv run ./applejack.py build --xl-version ${cc_LatestVersion} --download-source nexus --download-username ${NEXUS_CRED_USR} --download-password ${NEXUS_CRED_PSW} --product central-configuration --target-os debian-slim --target-os ubuntu --target-os centos --target-os amazonlinux --push --registry ${params.Registry}"
}
if (params.deploy_task_engine == true) {

Expand All @@ -182,7 +182,7 @@ pipeline {
}

// Build Docker Image and push it
sh "pipenv run ./applejack.py build --xl-version ${dte_LatestVersion} --download-source nexus --download-username ${NEXUS_CRED_USR} --download-password ${NEXUS_CRED_PSW} --product deploy-task-engine --target-os debian-slim --target-os centos --target-os amazonlinux --push --registry ${params.Registry}"
sh "pipenv run ./applejack.py build --xl-version ${dte_LatestVersion} --download-source nexus --download-username ${NEXUS_CRED_USR} --download-password ${NEXUS_CRED_PSW} --product deploy-task-engine --target-os debian-slim --target-os ubuntu --target-os centos --target-os amazonlinux --push --registry ${params.Registry}"
}
}
script {
Expand Down
1 change: 1 addition & 0 deletions applejack/conf/products/central-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dockerfiles:
centos: centos/Dockerfile.j2
amazonlinux: amazonlinux/Dockerfile.j2
rhel: rhel/Dockerfile.j2
ubuntu: ubuntu/Dockerfile.j2
repositories:
nexus: 'https://nexus.xebialabs.com/nexus/service/local/repositories/{repo}/content/ai/digital/config/central-configuration-server/{version}/{product}-server-{version}.zip'
dist: 'https://dist.xebialabs.com/customer/central-configuration-server/product/{version}/{product}-server-{version}.zip'
Expand Down
1 change: 1 addition & 0 deletions applejack/conf/products/deploy-task-engine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dockerfiles:
debian-slim: debian-slim/Dockerfile.j2
centos: centos/Dockerfile.j2
amazonlinux: amazonlinux/Dockerfile.j2
ubuntu: ubuntu/Dockerfile.j2
repositories:
nexus: 'https://nexus.xebialabs.com/nexus/service/local/repositories/{repo}/content/com/xebialabs/deployit/xl-deploy/{version}/xl-deploy-{version}-task-engine-trial-edition.zip'
dist: 'https://dist.xebialabs.com/customer/xl-deploy/product/{version}/xl-deploy-{version}-task-engine.zip'
Expand Down
1 change: 1 addition & 0 deletions applejack/conf/products/xl-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dockerfiles:
debian-slim: debian-slim/Dockerfile.j2
centos: centos/Dockerfile.j2
amazonlinux: amazonlinux/Dockerfile.j2
ubuntu: ubuntu/Dockerfile.j2
repositories:
nexus: 'https://nexus.xebialabs.com/nexus/service/local/repositories/{repo}/content/com/xebialabs/deployit/xl-deploy/{version}/{product}-{version}-server-trial-edition.zip'
dist: 'https://dist.xebialabs.com/customer/xl-deploy/product/{version}/{product}-{version}-server.zip'
Expand Down
1 change: 1 addition & 0 deletions applejack/conf/products/xl-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ dockerfiles:
debian-slim: debian-slim/Dockerfile.j2
centos: centos/Dockerfile.j2
amazonlinux: amazonlinux/Dockerfile.j2
ubuntu: ubuntu/Dockerfile.j2
repositories:
nexus: 'https://nexus.xebialabs.com/nexus/service/local/repositories/{repo}/content/com/xebialabs/xlrelease/xl-release/{version}/{product}-{version}-server.zip'
dist: 'https://dist.xebialabs.com/customer/xl-release/product/{version}/{product}-{version}-server.zip'
Expand Down
2 changes: 1 addition & 1 deletion copy_docker_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ while getopts ":hd:v:p:s:" arg; do
esac
done

for tag in $version $version-'centos' $version-'amazonlinux' $version-'debian-slim'
for tag in $version $version-'centos' $version-'amazonlinux' $version-'ubuntu' $version-'debian-slim'
do
pull_push $tag
done
Expand Down
3 changes: 2 additions & 1 deletion documentation/docs/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ By default the images are generated with 3 different target operating systems:
- Centos 7
- Debian Slim
- Amazon Linux
- ubuntu

If you only want to build a Docker image for a specific target operating system, use the following command:

```shell
$ ./applejack.py build --xl-version <version> --target-os rhel --target-os centos --target-os debian-slim
$ ./applejack.py build --xl-version <version> --target-os rhel --target-os centos --target-os debian-slim --target-os ubuntu
```
Note: For rhel images you will need to build it in RedHat OS with valid RHEL subscription.

Expand Down
41 changes: 41 additions & 0 deletions templates/dockerfiles/ubuntu/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
FROM alpine:3.16 as installer

# Install dependencies
RUN apk update
RUN apk add --no-cache gawk unzip curl busybox-extras

{% if 'deploy-task-engine' in product %}
{% include './deploy-task-engine/install.j2' %}
{% elif 'central-config' in product %}
{% include './central-configuration/install.j2' %}
{% else %}
{% include 'install.j2' %}
{% endif %}

FROM docker.usw2mgt.dev.digitalai.cloud/dai-java:11-jdk
USER root

{% include 'metadata.j2' %}

{% if 'deploy-task-engine' in product %}
{% include './deploy-task-engine/variables.j2' %}
{% else %}
{% include 'variables.j2' %}
{% endif %}

# Install dependencies
RUN apt-get update -y && \
apt-get install -y curl jq unzip apt-utils telnet && \
apt-get install -y fontconfig libfreetype6 && \
apt-get clean all -q

# Copy installed {{ product_name }}
COPY --from=installer ${APP_ROOT} ${APP_ROOT}

ENV OS=ubuntu

{% if 'deploy' in product %}
{% include 'terraform.j2' %}
{% endif %}

{% include 'runtime.j2' %}

0 comments on commit d75b4f9

Please sign in to comment.