Skip to content

Commit

Permalink
Merge pull request #199 from xebialabs/master
Browse files Browse the repository at this point in the history
Syncing 23.3  with master
  • Loading branch information
vpugar-digital authored Sep 29, 2023
2 parents 8b2957d + 349286f commit 66917d7
Show file tree
Hide file tree
Showing 32 changed files with 1,580 additions and 13 deletions.
10 changes: 10 additions & 0 deletions applejack/conf/products/central-configuration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ context:
central_config_files:
- deploy-cluster.yaml
- deploy-metrics.yaml
- deploy-oidc.yaml
- deploy-plugins.yaml
- deploy-repository.yaml
- deploy-reporting.yaml
- deploy-satellite.yaml
- deploy-secret-complexity.yaml
- deploy-server.yaml
Expand All @@ -49,6 +51,14 @@ context:
value: "123"
- key: XL_DB_MAX_POOL_SIZE
value: "10"
- key: XL_REPORT_DB_URL
value: "$XL_DB_URL"
- key: XL_REPORT_DB_USERNAME
value: "$XL_DB_USERNAME"
- key: XL_REPORT_DB_PASSWORD
value: "$XL_DB_PASSWORD"
- key: XL_REPORT_DB_MAX_POOL_SIZE
value: "$XL_DB_MAX_POOL_SIZE"
- key: XL_METRICS_ENABLED
value: "false"
- key: XLD_IN_PROCESS
Expand Down
3 changes: 3 additions & 0 deletions applejack/conf/products/xl-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ context:
central_config_files:
- deploy-cluster.yaml
- deploy-metrics.yaml
- deploy-plugins.yaml
- deploy-repository.yaml
- deploy-reporting.yaml
- deploy-satellite.yaml
- deploy-secret-complexity.yaml
- deploy-server.yaml
- deploy-task.yaml
- deploy-caches.yaml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
admin.password=${ADMIN_PASSWORD}
hide.internals=false
http.bind.address=0.0.0.0
http.context.root=/
http.context.root=${APP_CONTEXT_ROOT}
http.port=${APP_PORT}
repository.keystore.password=${REPOSITORY_KEYSTORE_PASSPHRASE}
ssl.mutual=${SSL}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ client.session.remember.enabled=true
client.session.timeout.minutes=20
hide.internals=false
http.bind.address=0.0.0.0
http.context.root=/
http.context.root=${APP_CONTEXT_ROOT}
http.port=${APP_PORT}
http.upload.buffer=262144
importable.packages.path=importablePackages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ deploy.cluster:
heartbeat: "10 seconds"
ttl: "60 seconds"
jdbc:
driver-classname: "${XL_DB_DRIVER}"
url: "${XL_DB_URL}"
username: ${XL_DB_USERNAME}
password: "${XL_DB_PASSWORD}"
password: |-
${XL_DB_PASSWORD}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
xl.reporting:
database:
db-driver-classname: "${XL_REPORT_DB_DRIVER}"
db-driver-classname: "${XL_DB_DRIVER}"
db-url: "${XL_REPORT_DB_URL}"
db-password: "${XL_REPORT_DB_PASSWORD}"
db-password: |-
${XL_REPORT_DB_PASSWORD}
db-username: "${XL_REPORT_DB_USERNAME}"
max-pool-size: ${XL_REPORT_DB_MAX_POOL_SIZE}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ xl.repository:
database:
db-driver-classname: "${XL_DB_DRIVER}"
db-url: "${XL_DB_URL}"
db-password: "${XL_DB_PASSWORD}"
db-password: |-
${XL_DB_PASSWORD}
db-username: "${XL_DB_USERNAME}"
max-pool-size: ${XL_DB_MAX_POOL_SIZE}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ deploy.task:
jms-driver-classname: "${XLD_TASK_QUEUE_DRIVER_CLASS_NAME}"
jms-url: "${XLD_TASK_QUEUE_URL}"
jms-username: "${XLD_TASK_QUEUE_USERNAME}"
jms-password: "${XLD_TASK_QUEUE_PASSWORD}"
jms-password: |-
${XLD_TASK_QUEUE_PASSWORD}
akka:
io:
dns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ fi
if [[ -z "$APP_PORT" ]]; then
APP_PORT=4516
fi
if [[ -z "$APP_CONTEXT_ROOT" ]]; then
APP_CONTEXT_ROOT="/"
fi

# Set up new installation
if [ ! -f "${APP_HOME}/conf/{{ boot_conf }}" ]; then
Expand Down Expand Up @@ -121,6 +124,7 @@ if [ ! -f "${APP_HOME}/conf/{{ boot_conf }}" ]; then
-e "s#\${SSL}#${SSL}#g" \
-e "s#\${SERVER_PORT}#${SERVER_PORT}#g" \
-e "s#\${APP_PORT}#${APP_PORT}#g" \
-e "s#\${APP_CONTEXT_ROOT}#${APP_CONTEXT_ROOT}#g" \
${APP_HOME}/default-conf/{{ boot_conf }}.template > ${APP_HOME}/conf/{{ boot_conf }}

echo "Done"
Expand Down Expand Up @@ -170,15 +174,17 @@ else
} >> ${APP_HOME}/conf/{{ boot_conf }}
fi
fi
echo "Updating server port and cloud enabled properties"
echo "Updating server port, context root and cloud enabled properties"
grep "server.port=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#server.port\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
grep "xl.spring.cloud.enabled=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#xl.spring.cloud.enabled\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
grep "http.port=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#http.port\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
grep "http.context.root=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#http.context.root\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
{
echo ""
echo server.port=${SERVER_PORT}
echo xl.spring.cloud.enabled=true
echo http.port=${APP_PORT}
echo http.context.root=${APP_CONTEXT_ROOT}
} >> ${APP_HOME}/conf/{{ boot_conf }}

sed -i '/^$/d' ${APP_HOME}/conf/{{ boot_conf }}
Expand Down
9 changes: 8 additions & 1 deletion templates/resources/includes/xl-deploy-run-script.j2
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ if [[ -z "$APP_PORT" ]]; then
APP_PORT={{ port }}
fi

if [[ -z "$APP_CONTEXT_ROOT" ]]; then
APP_CONTEXT_ROOT="/"
fi

if [[ -z "$SERVER_PORT" ]]; then
SERVER_PORT=8180
fi
Expand Down Expand Up @@ -126,6 +130,7 @@ if [ ! -f "${APP_HOME}/conf/{{ boot_conf }}" ]; then
-e "s#\${HOSTNAME_SUFFIX}#${HOSTNAME_SUFFIX}#g" \
-e "s#\${SSL}#${SSL}#g" \
-e "s#\${APP_PORT}#${APP_PORT}#g" \
-e "s#\${APP_CONTEXT_ROOT}#${APP_CONTEXT_ROOT}#g" \
-e "s#\${SERVER_PORT}#${SERVER_PORT}#g" \
${APP_HOME}/default-conf/{{ boot_conf }}.template > ${APP_HOME}/conf/{{ boot_conf }}

Expand Down Expand Up @@ -220,15 +225,17 @@ else
} >> ${APP_HOME}/conf/{{ boot_conf }}
fi
fi
echo "Updating http port, server port, and cloud enabled properties"
echo "Updating http port, context root, server port, and cloud enabled properties"
grep "server.port=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#server.port\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
grep "xl.spring.cloud.enabled=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#xl.spring.cloud.enabled\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
grep "http.port=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#http.port\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
grep "http.context.root=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#http.context.root\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
{
echo ""
echo server.port=${SERVER_PORT}
echo xl.spring.cloud.enabled=true
echo http.port=${APP_PORT}
echo http.context.root=${APP_CONTEXT_ROOT}
} >> ${APP_HOME}/conf/{{ boot_conf }}

sed -i '/^$/d' ${APP_HOME}/conf/{{ boot_conf }}
Expand Down
18 changes: 18 additions & 0 deletions templates/resources/includes/xl-release-run-script.j2
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,16 @@ if [ ! -f "${APP_HOME}/conf/{{ boot_conf }}" ]; then
APP_PORT={{ port }}
fi

if [[ -z "$APP_CONTEXT_ROOT" ]]; then
APP_CONTEXT_ROOT="/"
fi

echo "... Generating {{ boot_conf }}"
sed -e "s#\${ADMIN_PASSWORD}#${ADMIN_PASSWORD}#g" \
-e "s#\${REPOSITORY_KEYSTORE_PASSPHRASE}#${REPOSITORY_KEYSTORE_PASSPHRASE}#g" \
-e "s#\${SSL}#${SSL}#g" \
-e "s#\${APP_PORT}#${APP_PORT}#g" \
-e "s#\${APP_CONTEXT_ROOT}#${APP_CONTEXT_ROOT}#g" \
${APP_HOME}/default-conf/{{ boot_conf }}.template > ${APP_HOME}/conf/{{ boot_conf }}

if [ -n "${SERVER_URL}" ]; then
Expand All @@ -107,6 +112,19 @@ if [ ! -f "${APP_HOME}/conf/{{ boot_conf }}" ]; then

echo "Done"
fi
else
echo "Found ${APP_HOME}/conf/{{ boot_conf }} file. Processing it for new properties"

echo "Updating http port and context root properties"
grep "http.port=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#http.port\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
grep "http.context.root=" ${APP_HOME}/conf/{{ boot_conf }} && sed -i "s#http.context.root\=.*##" ${APP_HOME}/conf/{{ boot_conf }}
{
echo ""
echo http.port=${APP_PORT}
echo http.context.root=${APP_CONTEXT_ROOT}
} >> ${APP_HOME}/conf/{{ boot_conf }}

sed -i '/^$/d' ${APP_HOME}/conf/{{ boot_conf }}
fi

# Fix OpenJDK SSL issue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ xl {

database {
db-driver-classname="${XL_DB_DRIVER}"
db-password="${XL_DB_PASSWORD}"
db-password="""${XL_DB_PASSWORD}"""
db-url="${XL_DB_URL}"
db-username=${XL_DB_USERNAME}
max-pool-size=${XL_DB_MAX_POOL_SIZE}
}

# TODO XLR does not support (H2) running in one schema.
reporting {
db-driver-classname="${XL_DB_DRIVER}"
db-password="${XL_REPORT_DB_PASSWORD}"
db-password="""${XL_REPORT_DB_PASSWORD}"""
db-url="${XL_REPORT_DB_URL}"
db-username=${XL_REPORT_DB_USERNAME}
max-pool-size=${XL_REPORT_DB_MAX_POOL_SIZE}
Expand All @@ -44,7 +43,7 @@ xl {
# Task queue
queue {
embedded=${ENABLE_EMBEDDED_QUEUE}
password="${XLR_TASK_QUEUE_PASSWORD}"
password="""${XLR_TASK_QUEUE_PASSWORD}"""
queueName="${XLR_TASK_QUEUE_NAME}"
url="${XLR_TASK_QUEUE_URL}"
username="${XLR_TASK_QUEUE_USERNAME}"
Expand Down
131 changes: 131 additions & 0 deletions xl-client/23.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
FROM alpine:3.16 as installer

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

ENV USER_UID=10001 APP_ROOT=/opt/xebialabs
ENV APP_HOME=${APP_ROOT}/xl-client

COPY resources/xl-client-23.3.0-rc.1-linux-amd64.bin /tmp

RUN mkdir -p ${APP_HOME} && \
mv /tmp/xl-client-23.3.0-rc.1-linux-amd64.bin ${APP_HOME}/xl && \
chgrp -R 0 ${APP_ROOT} && \
chmod -R g=u ${APP_ROOT} && \
chmod +x ${APP_HOME}/xl

FROM alpine:3.16

MAINTAINER XebiaLabs Development <[email protected]>

LABEL name="xebialabs/xl-client" \
maintainer="[email protected]" \
vendor="XebiaLabs" \
version="23.3.0-rc.1" \
release="1" \
summary="XL Client" \
description="Enterprise-scale Application Release Automation for any environment" \
url="https://www.xebialabs.com/xl-client"

ENV USER_UID=10001 APP_ROOT=/opt/xebialabs
ENV APP_HOME=${APP_ROOT}/xl-client

# Install dependencies
RUN apk update

# Install kubectl
RUN apk add --no-cache curl && \
curl -LO "https://storage.googleapis.com/kubernetes-release/release/v1.26.3/bin/linux/amd64/kubectl" && \
chmod +x kubectl && \
mv kubectl /usr/local/bin/ && \
apk del curl && \
kubectl version --client --output=yaml

# Install keytool
RUN apk add --no-cache openjdk11-jre-headless ca-certificates

# Install yq
RUN apk add --no-cache yq && \
yq --version

# Install helm
RUN apk add --no-cache curl tar && \
curl -LO https://get.helm.sh/helm-v3.7.0-linux-amd64.tar.gz && \
tar -xvf helm-v3.7.0-linux-amd64.tar.gz && \
chmod +x linux-amd64/helm && \
mv linux-amd64/helm /usr/local/bin && \
rm -rf helm-v3.7.0-linux-amd64.tar.gz linux-amd64 && \
apk del curl tar && \
helm version

# Install vim
RUN apk add --no-cache vim xclip

# Install oc
RUN apk add --no-cache gcompat curl ca-certificates tar gzip && \
curl -L https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.8.11/openshift-client-linux.tar.gz | tar zx && \
mv oc /usr/local/bin && \
apk del curl tar gzip && \
oc version --client

# Install gcloud dependencies
RUN apk add --no-cache curl python3 py3-crcmod py3-openssl ca-certificates
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz -o /tmp/google-cloud-sdk.tar.gz && \
tar xzf /tmp/google-cloud-sdk.tar.gz -C /opt && \
rm /tmp/google-cloud-sdk.tar.gz && \
apk del curl tar gzip

ENV PATH="/opt/google-cloud-sdk/bin:${PATH}"

# Install gcloud auth plugin
RUN gcloud components install beta && \
gcloud components install gke-gcloud-auth-plugin

# git installation needed for krew
RUN apk add --no-cache git

# Install aws dependencies.
RUN apk update && \
apk add python3 py3-pip

RUN pip3 install awscli
RUN aws --version

# Add user
RUN apk add --no-cache shadow && \
useradd -d /opt/xebialabs -m -r -u 10001 -g 0 xebialabs

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

# Set up gcloud config, aws config and kube config folder
RUN mkdir -p ${APP_ROOT}/.config/gcloud && \
mkdir -p ${APP_ROOT}/.kube && \
mkdir -p ${APP_ROOT}/.aws

ENV KUBECONFIG=${APP_ROOT}/.kube/config

# Install Tini
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-static ${APP_ROOT}/tini
RUN chmod +x ${APP_ROOT}/tini && \
chown -R 10001:0 ${APP_ROOT}

WORKDIR ${APP_HOME}

# Don't run as root
USER 10001

# Install Krew
RUN cd /tmp \
&& wget -O krew-linux_amd64.tar.gz https://github.com/kubernetes-sigs/krew/releases/download/v0.4.3/krew-linux_amd64.tar.gz \
&& tar zxvf krew-linux_amd64.tar.gz \
&& ./krew-linux_amd64 install krew && \
rm -rf /tmp/krew*

# Set up Krew
ENV PATH="${APP_ROOT}/.krew/bin:${PATH}"

RUN kubectl krew install oidc-login

ENTRYPOINT ["/opt/xebialabs/tini", "--", "/opt/xebialabs/xl-client/xl"]
Loading

0 comments on commit 66917d7

Please sign in to comment.