2022-11-08 21:54:48 +03:00
|
|
|
parameters:
|
|
|
|
- name: installStep
|
|
|
|
type: step
|
|
|
|
- name: tags
|
|
|
|
type: string
|
|
|
|
default: "null"
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- checkout: none
|
|
|
|
|
|
|
|
# Get the host details on which these test are running
|
|
|
|
- script: |
|
|
|
|
echo $(Description)
|
|
|
|
hostnamectl
|
|
|
|
displayName: 'Print Agent Info'
|
|
|
|
|
|
|
|
# Create directory structure and prepare to mount
|
|
|
|
- ${{ parameters.installStep }}
|
|
|
|
- script: |
|
|
|
|
sudo rm -rf $(ROOT_DIR)
|
|
|
|
sudo mkdir -p $(ROOT_DIR)
|
|
|
|
sudo chown -R `whoami` $(ROOT_DIR)
|
|
|
|
chmod 777 $(ROOT_DIR)
|
|
|
|
mkdir -p $(ROOT_DIR)/go/src
|
|
|
|
displayName: 'Create Directory Structure'
|
|
|
|
|
|
|
|
# Clone the repo
|
|
|
|
- script: |
|
|
|
|
git clone https://github.com/Azure/azure-storage-fuse
|
|
|
|
displayName: 'Checkout Code'
|
|
|
|
workingDirectory: $(ROOT_DIR)/go/src
|
|
|
|
|
|
|
|
# Checkout the branch
|
|
|
|
- script: |
|
|
|
|
git checkout `echo $(Build.SourceBranch) | cut -d "/" -f 1,2 --complement`
|
|
|
|
displayName: 'Checkout Branch'
|
|
|
|
workingDirectory: $(WORK_DIR)
|
2023-07-25 12:26:31 +03:00
|
|
|
|
|
|
|
# Custom script to install Go-lang
|
|
|
|
- task: ShellScript@2
|
|
|
|
inputs:
|
2023-08-16 12:24:29 +03:00
|
|
|
scriptPath: "$(WORK_DIR)/go_installer.sh"
|
|
|
|
args: "$(ROOT_DIR)/"
|
2023-07-25 12:26:31 +03:00
|
|
|
displayName: "GoTool Custom Setup"
|
2022-11-08 21:54:48 +03:00
|
|
|
|
|
|
|
# Downloading Go dependency packages
|
|
|
|
- task: Go@0
|
|
|
|
inputs:
|
|
|
|
command: 'get'
|
|
|
|
arguments: '-d'
|
|
|
|
workingDirectory: $(WORK_DIR)
|
|
|
|
displayName: "Go Get"
|
|
|
|
|
|
|
|
# Building our package
|
|
|
|
- task: Go@0
|
|
|
|
inputs:
|
|
|
|
command: 'build'
|
|
|
|
arguments: "-tags ${{ parameters.tags }} -o blobfuse2"
|
|
|
|
workingDirectory: $(WORK_DIR)
|
|
|
|
displayName: "Go Build"
|
|
|
|
|
|
|
|
# Building our package
|
|
|
|
- task: Go@0
|
|
|
|
inputs:
|
|
|
|
command: 'build'
|
|
|
|
arguments: "-tags ${{ parameters.tags }} -o bfusemon ./tools/health-monitor/"
|
|
|
|
workingDirectory: $(WORK_DIR)
|
|
|
|
displayName: "Go Build bfusemon"
|
|
|
|
|
|
|
|
#Verification of built binary
|
|
|
|
- script: |
|
|
|
|
sudo chmod +x $(WORK_DIR)/blobfuse2
|
|
|
|
$(WORK_DIR)/blobfuse2 --version
|
|
|
|
displayName: 'Test binary'
|
|
|
|
env:
|
|
|
|
working_directory: $(WORK_DIR)
|
|
|
|
|
|
|
|
# Creating necessary directories
|
|
|
|
- script: |
|
|
|
|
sudo fusermount -u $(MOUNT_DIR)
|
|
|
|
sudo fusermount3 -u $(MOUNT_DIR)
|
|
|
|
rm -rf $(MOUNT_DIR)
|
|
|
|
mkdir -p $(MOUNT_DIR)
|
|
|
|
echo "Creating mount dir " $(MOUNT_DIR)
|
|
|
|
displayName: 'Create Mount directory'
|
|
|
|
env:
|
|
|
|
mount_dir: $(MOUNT_DIR)
|
|
|
|
|
|
|
|
- script: |
|
|
|
|
mkdir -p $(TEMP_DIR)
|
|
|
|
echo "Creating temp dir " $(TEMP_DIR)
|
|
|
|
displayName: "Create Cache directory"
|
|
|
|
env:
|
|
|
|
temp_dir: $(TEMP_DIR)
|