-
Notifications
You must be signed in to change notification settings - Fork 66
Scripts: add InstallFromSource.sh #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
derrickstolee
merged 2 commits into
microsoft:main
from
derrickstolee:install-from-source
Sep 25, 2020
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/bin/bash | ||
|
||
# To test on a Debian-based Linux machine: | ||
# | ||
# ./InstallFromSource.sh | ||
# (outputs Git, GCM, and Scalar versions) | ||
# | ||
# Small clone should work: | ||
# scalar clone https://dev.azure.com/gvfs/ci/_git/ForTests | ||
# | ||
# Big clone for authenticated repo should work: | ||
# scalar clone <url> | ||
# | ||
# Note: if you are using a headless Linux machine, then GCM Core will | ||
# not be able to store your credentials. Instead, create a PAT and | ||
# use that for password (multiple times). This will be fixed soon. | ||
|
||
# Nuke previous data | ||
rm -rf git-vfs*.deb gcmcore-linux*.deb packages*.deb | ||
|
||
echo "Installing dotnet SDK 3.1" | ||
|
||
sudo apt-get update -qq | ||
sudo apt-get install -y apt-transport-https && sudo apt-get update -qq | ||
|
||
sudo apt-get install -y lsb-release wget | ||
LSB_VERSION=$(lsb_release -rs | awk '/^[0-9]+\.[0-9]+$/ { print }') | ||
if [ -z "$LSB_VERSION" ] | ||
then | ||
LSB_VERSION="20.04" | ||
fi | ||
wget https://packages.microsoft.com/config/ubuntu/"$LSB_VERSION"/packages-microsoft-prod.deb -O packages-microsoft-prod.deb | ||
sudo dpkg -i packages-microsoft-prod.deb | ||
|
||
if sudo apt-get install -y dotnet-sdk-3.1 | ||
then | ||
echo "dotnet successfully installed" | ||
else | ||
echo "error: failed to install dotnet" | ||
echo "please follow instructions here to install: https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu" | ||
exit 1 | ||
fi | ||
|
||
echo "Installing Git from microsoft/git" | ||
wget https://github.com/microsoft/git/releases/download/v2.28.0.vfs.0.0/git-vfs_2.28.0.vfs.0.0.deb | ||
|
||
if ! sudo dpkg -i ./git-vfs_2.28.0.vfs.0.0.deb | ||
then | ||
echo "error: failed to install microsoft/git" | ||
exit 1 | ||
fi | ||
|
||
echo "Installing GCM Core" | ||
wget https://github.com/microsoft/Git-Credential-Manager-Core/releases/download/v2.0.246-beta/gcmcore-linux_amd64.2.0.246.34937.deb | ||
|
||
if ! sudo dpkg -i ./gcmcore-linux*.deb | ||
then | ||
echo "error: failed to install GCM core" | ||
exit 1 | ||
fi | ||
|
||
echo "Cloning and installing Scalar" | ||
mkdir scalar | ||
git clone --filter=blob:none https://github.com/microsoft/scalar scalar/src | ||
( | ||
cd scalar/src | ||
dotnet restore | ||
dotnet build --configuration Release --no-restore | ||
dotnet test --configuration Release --no-restore --verbosity normal | ||
sudo rm -rf /usr/local/lib/scalar | ||
sudo mkdir /usr/local/lib/scalar | ||
sudo cp -r ../out/Scalar/bin/Release/netcoreapp3.1/* /usr/local/lib/scalar/ | ||
sudo rm -rf /usr/local/bin/scalar | ||
sudo ln -s /usr/local/lib/scalar/scalar /usr/local/bin/scalar | ||
sudo chmod a+x /usr/local/bin/scalar | ||
) | ||
|
||
git version | ||
git-credential-manager-core --version | ||
|
||
|
||
if ! scalar version | ||
then | ||
echo "Scalar was not properly installed. Please double-check the build output" | ||
exit 1 | ||
fi |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Azure Pipelines agent, we use the install scripts to get .NET on the box. They've done some
heavymedium lifting across various Linux flavors to get prereqs sorted and whatnot. This script looks pretty Ubuntu/Debian flavored so perhaps you 🤷♂️ but I thought I'd mention it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting! If we have any more problems with installing
dotnet
I will definitely replace these with something likewget https://dotnet.microsoft.com/download/dotnet-core/scripts/v1/dotnet-install.sh && ./dotnet-install.sh