diff --git a/.circleci/Dockerfile b/.circleci/Dockerfile deleted file mode 100644 index 0db762fc..00000000 --- a/.circleci/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ - -FROM cimg/python:3.7.10 AS base -USER root - -# Setup dependencies for pyodbc -RUN \ - apt-get update && \ - apt-get install -y unixodbc-dev unixodbc g++ apt-transport-https && \ - gpg --keyserver hkp://keys.gnupg.net:80 --recv-keys 5072E1F5 - -RUN \ - export ACCEPT_EULA='Y' && \ - # Install pyodbc db drivers for MSSQL - curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - && \ - curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list && \ - apt-get update && \ - apt-get install -y msodbcsql17 odbc-postgresql mssql-tools - -# add sqlcmd to the path -ENV PATH="$PATH:/opt/mssql-tools/bin" - -# Update odbcinst.ini to make sure full path to driver is listed -RUN \ - sed 's/Driver=psql/Driver=\/usr\/lib\/x86_64-linux-gnu\/odbc\/psql/' /etc/odbcinst.ini > /tmp/temp.ini && \ - mv -f /tmp/temp.ini /etc/odbcinst.ini - -RUN \ - # Cleanup build dependencies - apt-get remove -y curl apt-transport-https debconf-utils rsync build-essential gnupg2 && \ - apt-get autoremove -y && apt-get autoclean -y \ No newline at end of file diff --git a/.github/Dockerfile b/.github/Dockerfile new file mode 100644 index 00000000..c89b3eec --- /dev/null +++ b/.github/Dockerfile @@ -0,0 +1,26 @@ +FROM python:3.10-bullseye + +# Setup dependencies for pyodbc +RUN apt-get update && \ + apt-get install -y unixodbc-dev unixodbc apt-transport-https curl lsb-release && \ + rm -rf /var/lib/apt/lists/* + +# enable Microsoft package repo +RUN curl -sL -o mspkgs.deb https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb && \ + dpkg -i mspkgs.deb && \ + rm -rf mspkgs.deb + +# enable Azure CLI package repo +RUN echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/azure-cli.list + +# install Microsoft packages +ENV ACCEPT_EULA=Y +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + azure-cli \ + msodbcsql17 \ + mssql-tools && \ + rm -rf /var/lib/apt/lists/* + +# add sqlcmd to the path +ENV PATH="$PATH:/opt/mssql-tools/bin" diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..50980f2d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,15 @@ +--- +version: 2 +updates: + - package-ecosystem: pip + directory: "/" + schedule: + interval: daily + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + - package-ecosystem: docker + directory: "/" + schedule: + interval: daily diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml new file mode 100644 index 00000000..2c54060d --- /dev/null +++ b/.github/workflows/publish-docker.yml @@ -0,0 +1,38 @@ +--- +name: Publish Docker image for CI/CD +on: + push: + tags: + - 'docker-*' + +jobs: + publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@v1.14.1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v3.7.0 + with: + images: ghcr.io/${{ github.repository }} + + - name: Build and push Docker images + uses: docker/build-push-action@v2.10.0 + with: + context: "{{defaultContext}}:.github" + push: true + platforms: linux/amd64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}