Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
  • Loading branch information
rabehaja committed Jul 10, 2020
2 parents 6fd0b7d + 72aad40 commit 9eebb60
Show file tree
Hide file tree
Showing 7 changed files with 247 additions and 624 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

## July 2020

- [Added] Sitecore 9.3.0 XP/SXA/PS SQL linux images.
- [Fixed] Sitecore 9.3.0 XP/SXA Solr linux images.

## May 2020
Expand Down
747 changes: 124 additions & 623 deletions IMAGES.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[//]: # "start: stats"

[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square)](https://opensource.org/licenses/MIT) ![Repositories](https://img.shields.io/badge/Repositories-104-blue.svg?style=flat-square) ![Tags](https://img.shields.io/badge/Tags-783-blue.svg?style=flat-square) ![Deprecated](https://img.shields.io/badge/Deprecated-0-lightgrey.svg?style=flat-square) ![Dockerfiles](https://img.shields.io/badge/Dockerfiles-98-blue.svg?style=flat-square) ![Default version](https://img.shields.io/badge/Default%20version-9.3.0%20on%20ltsc2019/1809-blue?style=flat-square)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg?style=flat-square)](https://opensource.org/licenses/MIT) ![Repositories](https://img.shields.io/badge/Repositories-105-blue.svg?style=flat-square) ![Tags](https://img.shields.io/badge/Tags-784-blue.svg?style=flat-square) ![Deprecated](https://img.shields.io/badge/Deprecated-0-lightgrey.svg?style=flat-square) ![Dockerfiles](https://img.shields.io/badge/Dockerfiles-99-blue.svg?style=flat-square) ![Default version](https://img.shields.io/badge/Default%20version-9.3.0%20on%20ltsc2019/1809-blue?style=flat-square)

[//]: # "end: stats"

Expand Down
32 changes: 32 additions & 0 deletions linux/9.3.x/sitecore-sxa-ps-sql/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
ARG BASE_IMAGE

FROM $BASE_IMAGE as builder

USER root

RUN apt-get -y update \
&& apt-get -y --allow-unauthenticated install unzip \
&& wget -progress=bar:force -q -O sqlpackage.zip https://go.microsoft.com/fwlink/?linkid=2113331 \
&& unzip -qq sqlpackage.zip -d /opt/sqlpackage \
&& chmod +x /opt/sqlpackage/sqlpackage

COPY *.zip /opt/wdp/

RUN unzip -qq /opt/wdp/Sitecore*scwdp.zip -d /opt/wdp/

COPY attach-databases.sh /opt/
COPY install-databases.sh /opt/

ENV DB_PREFIX='sc'

RUN mkdir -p /install \
&& chmod -R 700 /install \
&& chmod +x /opt/*.sh \
&& cp /clean/* /install/ \
&& ( /opt/mssql/bin/sqlservr & ) | grep -q "Service Broker manager has started" \
&& ./opt/attach-databases.sh /install \
&& ./opt/install-databases.sh /opt/wdp

FROM $BASE_IMAGE

COPY --from=builder ["/install/*", "/clean/"]
41 changes: 41 additions & 0 deletions linux/9.3.x/sitecore-sxa-ps-sql/attach-databases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

dataDir=$1

for attempt in {1..10}
do
echo "### Connection attempt $attempt..."

/opt/mssql-tools/bin/sqlcmd -S . -U sa -P $SA_PASSWORD -t 120 -l 120 -Q "SELECT Name from sys.Databases" >/dev/null 2>&1

if [[ $? == 0 ]]; then
echo "### Connected."

break
else
echo "### Retrying..."

sleep 1
fi
done

echo "### Attaching databases in '$dataDir':"

set -e

echo "### Attaching databases now '$dataDir':"

for filename in $dataDir/Sitecore.*.mdf; do
[ -e "$filename" ] || continue

fileBaseName=$(basename $filename .mdf)
databaseName="${fileBaseName/_Primary/}"
ldfPath="$dataDir/$fileBaseName.ldf"
mdfPath=$filename

echo "### Attaching '$databaseName' from '$mdfPath' and '$ldfPath'..."

/opt/mssql-tools/bin/sqlcmd -S . -U sa -P $SA_PASSWORD -t 60 -l 300 -Q "CREATE DATABASE [$databaseName] ON (FILENAME = '$mdfPath'),(FILENAME = '$ldfPath') FOR ATTACH"
done

echo "### Databases ready."
13 changes: 13 additions & 0 deletions linux/9.3.x/sitecore-sxa-ps-sql/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"tags": [
{
"tag": "sitecore-xp-sxa-ps-sql:9.3.0-linux",
"build-options": [
"--build-arg BASE_IMAGE=sitecore-xp-sxa-sql:9.3.0-linux"
]
}
],
"sources": [
"Sitecore Publishing Module 9.3.0.0.scwdp.zip"
]
}
35 changes: 35 additions & 0 deletions linux/9.3.x/sitecore-sxa-ps-sql/install-databases.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash
source=$1

for attempt in {1..10}
do
echo "### Connection attempt $attempt..."

/opt/mssql-tools/bin/sqlcmd -S . -U sa -P $SA_PASSWORD -t 120 -l 120 -Q "SELECT Name from sys.Databases" >/dev/null 2>&1

if [[ $? == 0 ]]; then
echo "### Connected."

break
else
echo "### Retrying..."

sleep 1
fi
done

echo "### Installing databases..."

set -e

for filename in $source/*.dacpac; do
[ -e "$filename" ] || continue

fileBaseName=$(basename $filename .dacpac)
databaseName="Sitecore.${fileBaseName}"


echo "### Installing '$databaseName' from '$filename'..."

/opt/sqlpackage/sqlpackage /a:Publish /tsn:. /tdn:$databaseName /tu:sa /tp:$SA_PASSWORD /sf:$filename /tt:120 /q
done

0 comments on commit 9eebb60

Please sign in to comment.