Git Product home page Git Product logo

install's Introduction

Abstract

Cross-platform set of scripts to install MetaCall Core infrastructure. For advanced install information, check the documentation.

Install

The following scripts are provided in order to install MetaCall:

In order to install MetaCall in one line, curl or wget or powershell can be used:

  • curl:
    curl -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh
  • wget:
    wget -O - https://raw.githubusercontent.com/metacall/install/master/install.sh | sh
  • powershell:
    powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/metacall/install/master/install.ps1')))"

Install Linux or MacOS

Additional parameters for the install script:

  • --update: Updates automatically MetaCall if it is already installed without asking to the user.
  • --uninstall: Uninstalls MetaCall if it is already installed without asking to the user. Overwrites the update command.
  • --docker-install: Runs Docker installation overwriting Docker fallback option over binary installation.
  • --no-check-certificate: When running binary installation (the default one), disables checking certificates when downloading the tarball. Useful for environments where there is not certificates, but insecure.
  • --no-docker-fallback: When running binary installation (the default one), disables Docker installation as fallback if the binary installation fails.
  • --from-path <path>: Installs MetaCall from specific path, the <path> points to a previously download tarball located in your file system.

Example usage:

  • Install with curl without checking certificates and without docker fallback:

    curl --insecure -sL https://raw.githubusercontent.com/metacall/install/master/install.sh | sh -s -- --no-check-certificate --no-docker-fallback
  • Install with wget using Docker installer:

    wget -O - https://raw.githubusercontent.com/metacall/install/master/install.sh | sh -s -- --docker-install
  • Install with wget from a existing tarball located at /root/downloads/metacall-tarball-linux-amd64.tar.gz:

    wget -O - https://raw.githubusercontent.com/metacall/install/master/install.sh | sh -s -- --from-path /root/downloads/metacall-tarball-linux-amd64.tar.gz
  • Install metacall in a BusyBox without certificates:

    wget --no-check-certificate -O - https://raw.githubusercontent.com/metacall/install/master/install.sh | sh -s -- --no-check-certificate

Install Windows

Additional parameters for the install script:

  • -InstallDir <directory>: Defines a custom folder in order to install MetaCall in, otherwise it uses %LocalAppData%\MetaCall by default.
  • -Version <version>: Version of the tarball to be downloaded. Versions are available here. Uses latest version by default.
  • -FromPath <path>: Install MetaCall from an existing distributable tarball, path must point to a tarball downloaded from releases.

Example usage:

  • Install tarball version v0.1.0 into D:\metacall:
    powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/metacall/install/master/install.ps1'))) -InstallDir 'D:\metacall' -Version '0.1.0'"

Testing

./test.sh

Troubleshooting

Sometimes the domain raw.githubusercontent.com maybe blocked by your ISP. Due to this, you may not be able to install metacall directly from previous commands. In that case, you may clone this repo and directly run install.sh for Linux and run install.ps1 for Windows.

install's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

install's Issues

metacall cli install mac error

▷ Start to download the tarball.
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 9 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (22) The requested URL returned error: 404
✘ The tarball metacall-tarball-osx-amd64.tar.gz could not be downloaded.
Please, refer to https://github.com/metacall/install/issues and create a new issue.
Aborting installation.
‼ Binary installation has failed, fallback to Docker installation.

Installation Freezing Issue on Windows

When using the provided PowerShell command for installation:

powershell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://raw.githubusercontent.com/metacall/install/master/install.ps1')))"

I encountered a freezing issue where nothing happens during the installation process.

Temporary Fix:

I found a workaround by explicitly setting the TLS version to 1.2 using the following PowerShell command:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

After executing this command, the installation script worked as expected.

Reverting to System Default:

To set the [Net.ServicePointManager]::SecurityProtocol back to the system default, you can use the following PowerShell command:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::SystemDefault

This ensures that the TLS version is back to the default configuration on your system.

Simplify `sudo` branches (install.sh script)

The code is full of branches depending on root permissions or not, in order to use sudo, like this:

		if [ $(id -u) -eq 0 ]; then
			mkdir -p /etc/profile.d/
			echo "export PATH=\"\${PATH}:/usr/local/bin\"" > /etc/profile.d/metacall.sh
			chmod 644 /etc/profile.d/metacall.sh
		else
			echo "export PATH=\"\${PATH}:/usr/local/bin\"" | sudo tee /etc/profile.d/metacall.sh > /dev/null
			sudo mkdir -p /etc/profile.d/
			sudo chmod 644 /etc/profile.d/metacall.sh
		fi

This can be simplified if we test for root permissions at the beginning like this:

if [ $(id -u) -eq 0 ]; then
	SUDO=
else
	SUDO=sudo
fi

And the previous code would look like:

		echo "export PATH=\"\${PATH}:/usr/local/bin\"" | ${SUDO} tee /etc/profile.d/metacall.sh > /dev/null
		${SUDO} mkdir -p /etc/profile.d/
		${SUDO} chmod 644 /etc/profile.d/metacall.sh

Also all echos are unnecesary, we can just use tee for both cases, we have just to update the dependencies.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.