drop tool versioning #92
Workflow file for this run
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
name: Build RDMP Docker Image | |
on: | |
push | |
jobs: | |
build: | |
name: Build and push Docker image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4.0.1 | |
with: | |
dotnet-version: 6.0.x | |
- name: Cache Nuget | |
uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
- name: Log in to the GitHub Container registry | |
uses: redhat-actions/podman-login@v1 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build RDMP and push container | |
run: | | |
dotnet publish Tools/rdmp/rdmp.csproj -c Release --nologo -o rdmp-cli -r linux-x64 --sc true -v q -p:PublishReadyToRun=true -p:PublishSingleFile=true | |
ctr=$(buildah from docker://public.ecr.aws/ubuntu/ubuntu:20.04_stable) | |
buildah copy "$ctr" rdmp-cli /rdmp/ | |
buildah run "$ctr" sh << EOS | |
set -e | |
apt-get update -qq | |
apt-get install -qqy curl gnupg2 python3 ca-certificates libgdiplus libicu66 --no-install-recommends -y | |
curl https://packages.microsoft.com/keys/microsoft.asc | tee /etc/apt/trusted.gpg.d/microsoft.asc | |
apt-get install software-properties-common -y | |
apt-get update -y | |
add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-preview.list)" | |
apt-get update -y | |
apt-get install mssql-tools unixodbc-dev -y | |
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list | |
# curl -sL https://packages.microsoft.com/keys/microsoft.asc | APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=1 apt-key add - | |
# curl -sL https://packages.microsoft.com/config/ubuntu/20.04/mssql-server-preview.list >> /etc/apt/sources.list | |
# echo >> /etc/apt/sources.list | |
# curl -sL https://packages.microsoft.com/config/ubuntu/20.04/prod.list >> /etc/apt/sources.list | |
# echo >> /etc/apt/sources.list | |
# apt-get update -qq | |
# ACCEPT_EULA=y apt-get install -qqy mssql-tools mssql-server --no-install-recommends | |
curl -sL https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py > /usr/bin/systemctl | |
chmod +x /usr/bin/systemctl | |
MSSQL_PID=Express ACCEPT_EULA=Y MSSQL_SA_PASSWORD='YourStrong#Passw0rd' /opt/mssql/bin/mssql-conf -n setup | |
/opt/mssql-tools/bin/sqlcmd -l 180 -S localhost -U sa -P 'YourStrong#Passw0rd' -Q 'SELECT @@VERSION;' | |
/rdmp/rdmp install -u sa -p 'YourStrong#Passw0rd' -e localhost RDMPDock_ | |
cat <<EOT > /rdmp/Databases.yaml | |
CatalogueConnectionString: Server=localhost;user=SA;password=YourStrong#Passw0rd;Database=RDMPDock_Catalogue; | |
DataExportConnectionString: Server=localhost;user=SA;password=YourStrong#Passw0rd;Database=RDMPDock_DataExport; | |
EOT | |
EOS | |
buildah config --cmd "/usr/bin/systemctl" "$ctr" | |
buildah commit "$ctr" "rdmpcli" | |
for t in latest ${GITHUB_REF##*/} | |
do | |
podman push rdmpcli ghcr.io/hicservices/rdmpcli:${t} | |
done |