diff options
| author | mo khan <mo.khan@gmail.com> | 2020-02-21 15:25:24 -0700 |
|---|---|---|
| committer | mo khan <mo.khan@gmail.com> | 2020-02-26 08:53:17 -0700 |
| commit | 5b511cb630e7b4121dc758d5fedc3cd50cd7fadc (patch) | |
| tree | f80255ab4eb11b64c2ded1cdf4b3eb7c31c468cb | |
| parent | 39afdc40296871d9f7c1732ff3f7e1e3b7b28bbe (diff) | |
Upgrade to version 6.0.0 of the Docker image
* Remove custom Java installation
* Install java and conan for backwards compatibiilty
* Make legacy java the default
* Control java version via asdf
* Add support for legacy version files
* Update version and CHANGELOG
* Load appropriate python version
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | Dockerfile | 15 | ||||
| -rw-r--r-- | Gemfile.lock | 2 | ||||
| -rw-r--r-- | lib/license/management/version.rb | 2 | ||||
| -rwxr-xr-x | run.sh | 11 |
5 files changed, 23 insertions, 11 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d5aae6..2cebfd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # GitLab License management changelog +## v2.6.0 + +- Upgrade to license finder 6.0.0 docker image (!115) + ## v2.5.2 - Exclude development/test dependencies by default (!117) @@ -1,13 +1,8 @@ -FROM licensefinder/license_finder:5.11.1 +FROM licensefinder/license_finder:6.0.0 ENV PATH="${PATH}:/root/.asdf/shims:/root/.asdf/bin" ENV LM_HOME=/opt/license-management ENV LM_PYTHON_VERSION 3 ENV LM_REPORT_VERSION ${LM_REPORT_VERSION:-2} -RUN cd /tmp && \ - wget --quiet --no-cookies https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.5%2B10/OpenJDK11U-jdk_x64_linux_hotspot_11.0.5_10.tar.gz -O jdk-11.tgz && \ - tar xf /tmp/jdk-11.tgz && \ - mv jdk-11.0.5+10 /usr/lib/jvm/adoptopen_jdk11 && \ - rm /tmp/jdk-11.tgz RUN npm install npm-install-peers # Don't let Rubygem fail with the numerous projects using PG or MySQL, @@ -17,6 +12,7 @@ RUN add-apt-repository ppa:ondrej/php -y && apt-get update -y && \ apt-get upgrade -y --no-install-recommends && \ apt-get install -y --no-install-recommends \ bsdmainutils \ + jq \ libjpeg8-dev \ zlib1g-dev \ libpq-dev libmysqlclient-dev realpath \ @@ -24,12 +20,19 @@ RUN add-apt-repository ppa:ondrej/php -y && apt-get update -y && \ git clone --depth 1 --branch v0.7.6 https://github.com/asdf-vm/asdf.git $HOME/.asdf && \ echo 'pip' >> $HOME/.default-python-packages && \ echo 'setuptools' >> $HOME/.default-python-packages && \ + echo 'conan' >> $HOME/.default-python-packages && \ echo '\n. $HOME/.asdf/asdf.sh' >> $HOME/.bashrc && \ + echo 'legacy_version_file = yes' > $HOME/.asdfrc && \ + asdf plugin-add java && \ asdf plugin-add python && \ + echo 'java adopt-openjdk-8u242-b08 adopt-openjdk-11.0.6+10' >> $HOME/.tool-versions && \ echo 'python 3.8.1 3.5.9 2.7.17' >> $HOME/.tool-versions && \ asdf install && \ asdf global python 3.8.1 && \ + asdf global java adopt-openjdk-8u242-b08 && \ asdf reshim && \ + bash -lc "gem install --no-document 'bundler:~> 1.7' 'bundler:~> 2.0'" && \ + rm -fr /opt/jdk* && \ rm -rf /var/lib/apt/lists/* COPY config/NuGet /root/.config/NuGet diff --git a/Gemfile.lock b/Gemfile.lock index 66377a0..0dc8334 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - license-management (2.5.2) + license-management (2.6.0) license_finder (~> 6.0.0) GEM diff --git a/lib/license/management/version.rb b/lib/license/management/version.rb index ab693f3..5623e68 100644 --- a/lib/license/management/version.rb +++ b/lib/license/management/version.rb @@ -2,6 +2,6 @@ module License module Management - VERSION = '2.5.2' + VERSION = '2.6.0' end end @@ -78,13 +78,14 @@ case "$LM_PYTHON_VERSION" in "3") echo "switching to python $LM_PYTHON_VERSION" LICENSE_FINDER_CLI_OPTS="--python-version 3 $LICENSE_FINDER_CLI_OPTS" + asdf shell python "$(asdf list python | awk '{ print $1 }' | grep '^3' | sort -rn | head -n1)" pip --version ;; "3.5") echo "switching to python $LM_PYTHON_VERSION" LICENSE_FINDER_CLI_OPTS="--python-version 3 $LICENSE_FINDER_CLI_OPTS" - asdf shell python 3.5.9 + asdf shell python "$(asdf list python | awk '{ print $1 }' | grep '^3.5')" pip --version ;; @@ -109,7 +110,10 @@ case "$COMMAND" in shift pushd $APP_PATH > /dev/null + asdf list + asdf current if [[ -z "${SETUP_CMD}" ]]; then + asdf install # Before running license_finder, we need to install dependencies for the project. if test -f Gemfile ; then if test -n "$rvm_recommended_ruby" ; then @@ -163,10 +167,11 @@ case "$COMMAND" in fi if [[ ${LM_JAVA_VERSION} = "11" ]]; then - JAVA_HOME=/usr/lib/jvm/adoptopen_jdk11 + asdf shell java "$(asdf list java | awk '{ print $1 }' | grep '^adopt-openjdk-11')" elif [[ ${LM_JAVA_VERSION} = "8" ]]; then - JAVA_HOME=/usr/lib/jvm/oracle_jdk8 + asdf shell java "$(asdf list java | awk '{ print $1 }' | grep '^adopt-openjdk-8')" fi + export JAVA_HOME=$(asdf where java) if test -f pom.xml ; then # Install Java Maven dependencies. |
