diff options
| -rw-r--r-- | .gitlab/test.yml | 1 | ||||
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | Gemfile.lock | 2 | ||||
| -rwxr-xr-x | bin/docker-build | 2 | ||||
| -rw-r--r-- | config/files/.bashrc | 9 | ||||
| -rw-r--r-- | config/install.sh | 46 | ||||
| -rw-r--r-- | lib/license/finder/ext/dotnet.rb | 8 | ||||
| -rw-r--r-- | lib/license/management/version.rb | 2 |
8 files changed, 55 insertions, 19 deletions
diff --git a/.gitlab/test.yml b/.gitlab/test.yml index 00c9434..6d0dcae 100644 --- a/.gitlab/test.yml +++ b/.gitlab/test.yml @@ -35,7 +35,6 @@ lint: variables: GIT_DEPTH: "10" GIT_STRATEGY: fetch - LOG_LEVEL: debug cache: key: ${CI_COMMIT_REF_SLUG} paths: diff --git a/CHANGELOG.md b/CHANGELOG.md index 2168955..a310c65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # GitLab License management changelog +## v3.19.0 + +- Include the latest LTS of the .NET SDK in the Docker image. (!191) + ## v3.18.1 - Fix failing composer tests. diff --git a/Gemfile.lock b/Gemfile.lock index 27474e8..b3cbb88 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,7 +8,7 @@ GIT PATH remote: . specs: - license-management (3.18.1) + license-management (3.19.0) license_finder (~> 6.6.0) GEM diff --git a/bin/docker-build b/bin/docker-build index 6f111fe..abc46c1 100755 --- a/bin/docker-build +++ b/bin/docker-build @@ -9,7 +9,7 @@ IMAGE_NAME=${IMAGE_NAME:-$(basename "$PWD"):latest} export DOCKER_BUILDKIT=1 if command -v docker; then - docker build --progress=plain --network=host --cache-from "$LATEST_IMAGE" -t "$IMAGE_NAME" . + docker build --network=host --cache-from "$LATEST_IMAGE" -t "$IMAGE_NAME" . else echo "Install docker: https://docs.docker.com/engine/installation/" exit 1 diff --git a/config/files/.bashrc b/config/files/.bashrc index 81afcb8..388f93d 100644 --- a/config/files/.bashrc +++ b/config/files/.bashrc @@ -60,7 +60,16 @@ function enable_dev_mode() { } inflate /opt/asdf.tar.zst /opt +inflate /opt/gitlab/.cache.tar.zst /opt/gitlab +inflate /opt/gitlab/.config.tar.zst /opt/gitlab +inflate /opt/gitlab/.m2.tar.zst /opt/gitlab +inflate /opt/gitlab/embedded.tar.zst /opt/gitlab +inflate /usr/include.tar.zst /usr +inflate /usr/lib/elixir.tar.zst /usr/lib +inflate /usr/lib/erlang.tar.zst /usr/lib inflate /usr/lib/gcc.tar.zst /usr/lib +inflate /usr/lib/git-core.tar.zst /usr/lib +inflate /usr/lib/llvm-7.tar.zst /usr/lib inflate /usr/lib/rustlib.tar.zst /usr/lib # shellcheck source=/dev/null diff --git a/config/install.sh b/config/install.sh index 0de9b1c..834dff8 100644 --- a/config/install.sh +++ b/config/install.sh @@ -1,5 +1,5 @@ #!/bin/bash -set -euo pipefail +set -exuo pipefail export DEBIAN_FRONTEND=noninteractive @@ -75,15 +75,6 @@ apt-get install -y --no-install-recommends \ zstd echo -e "section_end:$(date +%s):install_packages\r\e[0K" -echo -e "section_start:$(date +%s):install_dotnet\r\e[0K==> Installing dotnet/mono…" -wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg -wget -q -O /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/debian/10/prod.list -apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF -echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list - -curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe -echo -e "section_end:$(date +%s):install_dotnet\r\e[0K" - echo -e "section_start:$(date +%s):install_asdf\r\e[0K==> Installing asdf…" dpkg --install "$(find /opt/toolcache/ -name "license-management*.deb")" rm -fr /root @@ -113,6 +104,17 @@ done wait echo -e "section_end:$(date +%s):install_asdf\r\e[0K" +echo -e "section_start:$(date +%s):install_dotnet\r\e[0K==> Installing dotnet/mono…" +wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/microsoft.asc.gpg +wget -q -O /etc/apt/sources.list.d/microsoft-prod.list https://packages.microsoft.com/config/debian/10/prod.list +apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF +echo "deb https://download.mono-project.com/repo/debian stable-buster main" | tee /etc/apt/sources.list.d/mono-official-stable.list + +curl -o /usr/local/bin/nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe +curl -o /tmp/dotnet-install.sh https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.sh +bash /tmp/dotnet-install.sh --install-dir /opt/asdf/installs/dotnet/latest --channel LTS --version latest +echo -e "section_end:$(date +%s):install_dotnet\r\e[0K" + echo -e "section_start:$(date +%s):cleanup\r\e[0K==> Beginning cleanup…" apt purge -y libx11-6 libwayland-client0 apt autoremove -y @@ -180,15 +182,35 @@ zstd_command="/usr/bin/zstd -19 -T0" cd /opt tar --use-compress-program "$zstd_command" -cf /opt/asdf.tar.zst asdf & -cd /usr/lib -tar --use-compress-program "$zstd_command" -cf /usr/lib/gcc.tar.zst gcc & +cd /opt/gitlab +tar --use-compress-program "$zstd_command" -cf /opt/gitlab/.cache.tar.zst .cache & +tar --use-compress-program "$zstd_command" -cf /opt/gitlab/.config.tar.zst .config & +tar --use-compress-program "$zstd_command" -cf /opt/gitlab/.m2.tar.zst .m2 & +tar --use-compress-program "$zstd_command" -cf /opt/gitlab/embedded.tar.zst embedded & + +cd /usr +tar --use-compress-program "$zstd_command" -cf /usr/include.tar.zst include & cd /usr/lib +tar --use-compress-program "$zstd_command" -cf /usr/lib/elixir.tar.zst elixir & +tar --use-compress-program "$zstd_command" -cf /usr/lib/erlang.tar.zst erlang & +tar --use-compress-program "$zstd_command" -cf /usr/lib/gcc.tar.zst gcc & +tar --use-compress-program "$zstd_command" -cf /usr/lib/git-core.tar.zst git-core & +tar --use-compress-program "$zstd_command" -cf /usr/lib/llvm-7.tar.zst llvm-7 & tar --use-compress-program "$zstd_command" -cf /usr/lib/rustlib.tar.zst rustlib & wait rm -fr \ /opt/asdf/ \ + /opt/gitlab/.m2 \ + /opt/gitlab/.cache \ + /opt/gitlab/.config \ + /opt/gitlab/embedded \ + /usr/include \ + /usr/lib/elixir \ + /usr/lib/erlang \ /usr/lib/gcc \ + /usr/lib/git-core \ + /usr/lib/llvm-7 \ /usr/lib/rustlib echo -e "section_end:$(date +%s):compress_files\r\e[0K" diff --git a/lib/license/finder/ext/dotnet.rb b/lib/license/finder/ext/dotnet.rb index c5ff485..e9e0490 100644 --- a/lib/license/finder/ext/dotnet.rb +++ b/lib/license/finder/ext/dotnet.rb @@ -9,12 +9,14 @@ module LicenseFinder project_path.glob('*.fsproj') end + def installed?(*) + File.exist?('/opt/asdf/installs/dotnet/latest/dotnet') + end + def prepare - shell.execute(['apt-get', :update, '-q']) - shell.execute(['apt-get', :install, '-y', '--no-install-recommends', 'dotnet-sdk-3.1']) shell.execute([:mkdir, '-p', vendor_path.to_s]) unless vendor_path.exist? shell.execute([ - :dotnet, + '/opt/asdf/installs/dotnet/latest/dotnet', :restore, detected_package_path.to_s, '--no-cache', '--packages', vendor_path.to_s, diff --git a/lib/license/management/version.rb b/lib/license/management/version.rb index 1ba7279..72c1491 100644 --- a/lib/license/management/version.rb +++ b/lib/license/management/version.rb @@ -2,6 +2,6 @@ module License module Management - VERSION = '3.18.1' + VERSION = '3.19.0' end end |
