Skip to content
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

Add volume mapping #1

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 40 additions & 5 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ jobs:
inputs:
filePath: "scripts/Test-ChangesMadeInPath.ps1"
arguments: >-
-authorisation "Bearer $(system.accesstoken)"
-pathFilter "build/containers"
-authorisation "Bearer $(system.accesstoken)"
-pathFilter "build/containers"
-buildId $(Build.BuildId)
-collectionUri "$(System.CollectionUri)"
-project "$(System.TeamProject)"
Expand Down Expand Up @@ -97,6 +97,8 @@ jobs:
container:
image: ghcr.io/flcdrg/azure-pipelines-container-jobs:latest
endpoint: 'GitHub Packages'
# volumes:
# - $(Agent.TempDirectory):/var/lib/mysql

variables:
Configuration: Release
Expand All @@ -109,20 +111,53 @@ jobs:
releaseType: stable

- script: |
printenv
dotnet --info
docker info
displayName: Info
mkdir $(Agent.TempDirectory)/stuff
# Ensure full access
chmod 777 $(Agent.TempDirectory)/stuff
ls -al $(Agent.TempDirectory)
touch $(Agent.TempDirectory)/stuff/host

echo "Agent.TempDirectory: $(Agent.TempDirectory)"

# Set a variable in host step, to see if we can see it on the container steps
echo "##vso[task.setvariable variable=myVar;isreadonly=true]$(Agent.TempDirectory)"
echo "##vso[task.setvariable variable=myVar2;isreadonly=true]A$(Agent.TempDirectory)B"

ENCODED_TEMP=$(echo -n "$(Agent.TempDirectory)" | base64)
echo "##vso[task.setvariable variable=EncodedTemp;isreadonly=true]$ENCODED_TEMP"
displayName: Info (host)
failOnStderr: true
target: host

- script: |
printenv
dotnet --info
docker info
displayName: Info for host

echo "myVar: $(myVar)"
echo "Agent.TempDirectory: $(Agent.TempDirectory)"

DECODED_TEMP=$(echo '$(EncodedTemp)' | base64 -d)

echo "DECODED_TEMP: $DECODED_TEMP"

ls -al $(Agent.TempDirectory)
touch $(Agent.TempDirectory)/container
touch $(Agent.TempDirectory)/stuff/container
ls -al $(Agent.TempDirectory)/stuff
displayName: Info
failOnStderr: true

- script: |
ls -al $(Agent.TempDirectory)/stuff
displayName: List directory (host)
target: host

- task: DotNetCoreCLI@2
displayName: '.NET: build'
inputs:
command: 'build'
workingDirectory: src