summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authormo khan <mo.khan@gmail.com>2020-07-13 09:57:29 -0600
committermo khan <mo.khan@gmail.com>2020-08-21 16:31:57 -0600
commitcbc4d1e328fd0e578f038d57fbd6b9354dafa79e (patch)
tree99b53a90cd7c0996a2d0993b41eb56a695bcc996 /config
parenteb11eeb1018c4d32e8dbaf3f734e588205f0671f (diff)
Install tools from .deb package
Diffstat (limited to 'config')
-rw-r--r--config/files/.bashrc8
-rw-r--r--config/files/.default-python-packages2
-rw-r--r--config/files/.tool-versions12
-rw-r--r--config/install.sh74
-rwxr-xr-xconfig/scripts/asdf/postinst3
-rwxr-xr-xconfig/scripts/license_management/postinst11
-rwxr-xr-xconfig/scripts/license_management/postrm3
-rw-r--r--config/software/asdf.rb2
-rw-r--r--config/software/asdf_golang.rb6
-rw-r--r--config/software/asdf_python.rb44
-rw-r--r--config/software/license_management.rb4
11 files changed, 48 insertions, 121 deletions
diff --git a/config/files/.bashrc b/config/files/.bashrc
index b37ae94..7017be5 100644
--- a/config/files/.bashrc
+++ b/config/files/.bashrc
@@ -7,7 +7,6 @@ export HOME="/opt/gitlab"
alias nuget='mono /usr/local/bin/nuget.exe'
set -o vi
-
function inflate() {
local file=$1
local to_dir=$2
@@ -59,14 +58,13 @@ function enable_dev_mode() {
apt-get install -y --no-install-recommends vim less shellcheck
}
-inflate /opt/asdf.tar.zst /opt
-inflate /opt/gitlab/.cache.tar.zst /opt/gitlab
+if [ ! -d "/opt/asdf" ]; then
+ dpkg -i /opt/toolcache/asdf_*.deb
+fi
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
diff --git a/config/files/.default-python-packages b/config/files/.default-python-packages
index ddf6574..495b9f1 100644
--- a/config/files/.default-python-packages
+++ b/config/files/.default-python-packages
@@ -1,4 +1,4 @@
conan
-pip
+pip<20.0
pipenv
virtualenv
diff --git a/config/files/.tool-versions b/config/files/.tool-versions
index 5da7afd..6fa1c96 100644
--- a/config/files/.tool-versions
+++ b/config/files/.tool-versions
@@ -1,11 +1,11 @@
-elixir system
+dotnet-core 3.1.302
+elixir 1.10.4
golang 1.14.6
-gradle 6.3
-java adoptopenjdk-8.0.252+9.1 adoptopenjdk-11.0.7+10.1
-maven 3.6.3
-nodejs 12.16.3 10.20.1
+java 8
+mono 6.8.0.123
+nodejs 12.18.2
php 7.4.8
-python 3.8.2 2.7.18
+python 3.8.5
ruby 2.6.6
rust 1.45.0
sbt 1.3.8
diff --git a/config/install.sh b/config/install.sh
index 1d0189e..3e4c581 100644
--- a/config/install.sh
+++ b/config/install.sh
@@ -8,7 +8,6 @@ apt-get clean
apt-get update -q
apt-get install -y --no-install-recommends \
apt-transport-https \
- apt-utils \
autoconf \
automake \
bison \
@@ -17,16 +16,10 @@ apt-get install -y --no-install-recommends \
bzip2 \
ca-certificates \
cmake \
- coreutils \
curl \
default-libmysqlclient-dev \
- dirmngr \
- elixir \
- gettext \
git \
- gnupg \
gnupg2 \
- gpg \
jq \
libbz2-dev \
libcurl4 \
@@ -51,70 +44,25 @@ apt-get install -y --no-install-recommends \
libssl-dev \
libtool \
libxml2-dev \
+ libxmlsec1-dev \
libxslt-dev \
libyaml-dev \
libzip-dev \
- llvm \
- locate \
make \
- openssl \
pkg-config \
- python-openssl \
re2c \
rebar \
software-properties-common \
sudo \
- tk-dev \
- unixodbc-dev \
unzip \
- wget \
- xz-utils \
zlib1g \
zlib1g-dev \
zstd
-echo -e "section_end:$(date +%s):install_packages\r\e[0K"
-echo -e "section_start:$(date +%s):install_asdf\r\e[0K==> Installing asdf…"
dpkg --install /opt/toolcache/license*.deb
rm -fr /root
ln -s /opt/gitlab /root
-
-mkdir -p "$ASDF_DATA_DIR"
-git clone https://github.com/asdf-vm/asdf.git "$ASDF_DATA_DIR"
-cd "$ASDF_DATA_DIR"
-git checkout "$(git describe --abbrev=0 --tags)"
-
-# shellcheck source=/dev/null
-. "$ASDF_DATA_DIR"/asdf.sh
-
-while IFS= read -r line; do
- tool=$(echo "$line" | cut -d' ' -f1)
- asdf plugin-add "$tool"
-done < "/opt/gitlab/.tool-versions"
-bash "$ASDF_DATA_DIR/plugins/nodejs/bin/import-release-team-keyring"
-asdf install
-rm -fr "$ASDF_DATA_DIR/installs/rust"
-rm -fr "$ASDF_DATA_DIR/installs/php"
-asdf reshim
-asdf current
-
-for version in $(asdf list python); do
- asdf shell python "$version"
- pip download -d "/opt/gitlab/.config/virtualenv/app-data" pip-licenses pip setuptools wheel
-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_end:$(date +%s):install_packages\r\e[0K"
echo -e "section_start:$(date +%s):cleanup\r\e[0K==> Beginning cleanup…"
apt purge -y libx11-6 libwayland-client0
@@ -125,16 +73,7 @@ mkdir -p /tmp
chmod 777 /tmp
chmod +t /tmp
-rm -fr "$ASDF_DATA_DIR/docs" \
- "$ASDF_DATA_DIR"/installs/golang/**/go/test \
- "$ASDF_DATA_DIR"/installs/java/**/demo \
- "$ASDF_DATA_DIR"/installs/java/**/man \
- "$ASDF_DATA_DIR"/installs/java/**/sample \
- "$ASDF_DATA_DIR"/installs/python/**/lib/**/test \
- "$ASDF_DATA_DIR"/installs/ruby/**/lib/ruby/gems/**/cache \
- "$ASDF_DATA_DIR"/installs/**/**/share \
- "$ASDF_DATA_DIR"/test \
- /opt/gitlab/.config/configstore/update-notifier-npm.json \
+rm -fr /opt/gitlab/.config/configstore/update-notifier-npm.json \
/opt/gitlab/.config/pip/selfcheck.json \
/opt/gitlab/.gem \
/opt/gitlab/.npm \
@@ -180,11 +119,8 @@ echo -e "section_end:$(date +%s):cleanup\r\e[0K"
echo -e "section_start:$(date +%s):compress_files\r\e[0K==> Starting compression…"
zstd_command="/usr/bin/zstd -19 -T0"
-cd /opt
-tar --use-compress-program "$zstd_command" -cf /opt/asdf.tar.zst asdf &
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 &
@@ -194,8 +130,6 @@ tar --use-compress-program "$zstd_command" -cf /usr/include.tar.zst include &
tar --use-compress-program "$zstd_command" -cf /usr/share.tar.zst share &
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 &
@@ -209,8 +143,6 @@ rm -fr \
/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 \
diff --git a/config/scripts/asdf/postinst b/config/scripts/asdf/postinst
new file mode 100755
index 0000000..ceed3e5
--- /dev/null
+++ b/config/scripts/asdf/postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+tar -xf /opt/asdf/plugins.tar.gz
diff --git a/config/scripts/license_management/postinst b/config/scripts/license_management/postinst
index da63d3b..06de8f5 100755
--- a/config/scripts/license_management/postinst
+++ b/config/scripts/license_management/postinst
@@ -1,14 +1,3 @@
#!/bin/sh
-PROGNAME=$(basename "$0")
-
-error_exit()
-{
- echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2
- exit 1
-}
-
ln -s /opt/gitlab/bin/license_management /usr/local/bin/license_management
-echo "Thank you for installing license_management!"
-
-exit 0
diff --git a/config/scripts/license_management/postrm b/config/scripts/license_management/postrm
index 5b47b27..ab1a69a 100755
--- a/config/scripts/license_management/postrm
+++ b/config/scripts/license_management/postrm
@@ -1,6 +1,3 @@
#!/bin/sh
rm -f /usr/local/bin/license_management
-echo "license_management has been uninstalled!"
-
-exit 0
diff --git a/config/software/asdf.rb b/config/software/asdf.rb
index 1b5ba26..72b77ce 100644
--- a/config/software/asdf.rb
+++ b/config/software/asdf.rb
@@ -44,4 +44,6 @@ end
build do
delete "#{install_dir}/installs/elixir/**/man"
+ command "tar -czvf #{install_dir}/plugins.tar.gz #{install_dir}/plugins"
+ delete "#{install_dir}/plugins"
end
diff --git a/config/software/asdf_golang.rb b/config/software/asdf_golang.rb
index d8240b0..d7e8fd2 100644
--- a/config/software/asdf_golang.rb
+++ b/config/software/asdf_golang.rb
@@ -9,6 +9,12 @@ relative_path "go"
version "1.14.6" do
source sha256: "5c566ddc2e0bcfc25c26a5dc44a440fcc0177f7350c1f01952b34d5989a0d287"
end
+version "1.14.7" do
+ source sha256: "4a7fa60f323ee1416a4b1425aefc37ea359e9d64df19c326a58953a97ad41ea5"
+end
+version "1.15" do
+ source sha256: "2d75848ac606061efe52a8068d0e647b35ce487a15bb52272c427df485193602"
+end
build do
mkdir install_dir
diff --git a/config/software/asdf_python.rb b/config/software/asdf_python.rb
index 5a0e9c9..68cfd68 100644
--- a/config/software/asdf_python.rb
+++ b/config/software/asdf_python.rb
@@ -54,35 +54,35 @@ build do
configure(*configure_command, env: env)
make "-j #{workers}", env: env
make "-j #{workers} install", env: env
- command "ln -s #{install_dir}/embedded/bin #{install_dir}/bin"
-end
+ command "ln -s #{install_dir}/embedded/bin #{install_dir}/bin", env: env
-build do
if version.start_with?('3.')
- command "ln -s #{install_dir}/bin/python3 #{install_dir}/bin/python"
- command "ln -s #{install_dir}/bin/pip3 #{install_dir}/bin/pip"
+ command "ln -s #{install_dir}/bin/python3 #{install_dir}/bin/python", env: env
+ command "ln -s #{install_dir}/bin/pip3 #{install_dir}/bin/pip", env: env
end
- if File.exist?("#{install_dir}/bin/pip")
- command "#{install_dir}/bin/pip install --upgrade pip"
+ case version
+ when /^3\.3\./
+ command "curl https://bootstrap.pypa.io/3.3/get-pip.py -o #{project_dir}/get-pip.py", env: env
+ command "#{install_dir}/bin/python #{project_dir}/get-pip.py \"pip==10.0.1\"", env: env
+ command "#{install_dir}/bin/pip install pipenv virtualenv", env: env
+ when /^3\.4\./
+ command "#{install_dir}/bin/pip install pipenv==11.1.6 virtualenv", env: env
+ when /^2\.7\./
+ command "curl https://bootstrap.pypa.io/2.6/get-pip.py -o #{project_dir}/get-pip.py", env: env
+ command "#{install_dir}/bin/python #{project_dir}/get-pip.py \"pip<20.0\"", env: env
+ command "#{install_dir}/bin/pip install pipenv virtualenv", env: env
else
- case version
- when /^3\.2\./
- command "curl https://bootstrap.pypa.io/3.2/get-pip.py -o #{project_dir}/get-pip.py"
- when /^3\.3\./
- command "curl https://bootstrap.pypa.io/3.3/get-pip.py -o #{project_dir}/get-pip.py"
- when /^3\.4\./
- command "curl https://bootstrap.pypa.io/3.4/get-pip.py -o #{project_dir}/get-pip.py"
- when /^2\.6\./
- command "curl https://bootstrap.pypa.io/2.6/get-pip.py -o #{project_dir}/get-pip.py"
- else
- command "curl https://bootstrap.pypa.io/get-pip.py -o #{project_dir}/get-pip.py"
- end
+ command "#{install_dir}/bin/pip install pipenv virtualenv", env: env
+ end
- command "#{install_dir}/bin/python #{project_dir}/get-pip.py \"pip<20.0\""
+ if version == default_version
+ command "#{install_dir}/bin/pip install conan", env: env
+ command "#{install_dir}/bin/conan --version", env: env
end
- command "#{install_dir}/bin/pip install pipenv virtualenv"
- command "#{install_dir}/bin/pip install conan" if version == default_version
+ command "#{install_dir}/bin/pip --version", env: env
+ command "#{install_dir}/bin/pipenv --version", env: env
+ command "#{install_dir}/bin/virtualenv --version", env: env
end
build do
diff --git a/config/software/license_management.rb b/config/software/license_management.rb
index de8a854..3880799 100644
--- a/config/software/license_management.rb
+++ b/config/software/license_management.rb
@@ -38,8 +38,8 @@ end
build do
touch "#{install_dir}/.config/virtualenv/app-data/.keep"
- command "pip2 download -d #{install_dir}/.config/virtualenv/app-data pip-licenses pip setuptools wheel"
- command "pip3 download -d #{install_dir}/.config/virtualenv/app-data pip-licenses pip setuptools wheel"
+ command "pip2 download -d #{install_dir}/.config/virtualenv/app-data pip-licenses setuptools wheel"
+ command "pip3 download -d #{install_dir}/.config/virtualenv/app-data pip-licenses setuptools wheel"
end
build do