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

Create a script to create a build drop to enable running functional tests on boxes that didn't build the product. #466

Merged
merged 1 commit into from
Nov 2, 2018
Merged
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
30 changes: 30 additions & 0 deletions Scripts/Mac/CI/CreateBuildDrop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

. "$(dirname ${BASH_SOURCE[0]})/../InitializeEnvironment.sh"

CONFIGURATION=$1
BUILDDROP_ROOT=$2
if [ -z $BUILDDROP_ROOT ] || [ -z $CONFIGURATION ]; then
echo 'ERROR: Usage: CreateBuildDrop.sh [configuration] [build drop root directory]'
exit 1
fi

# Set up some paths
BUILDDROP_BUILDOUTPUT=$BUILDDROP_ROOT/BuildOutput
BUILDDROP_SRC=$BUILDDROP_ROOT/src
BUILDDROP_PROJFS=$BUILDDROP_SRC/ProjFS.Mac
BUILDDROP_KEXT=$BUILDDROP_BUILDOUTPUT/ProjFS.Mac/Native/Build/Products/$CONFIGURATION

# Set up the build drop directory structure
rm -rf $BUILDDROP_ROOT
mkdir -p $BUILDDROP_BUILDOUTPUT
mkdir -p $BUILDDROP_SRC
mkdir -p $BUILDDROP_PROJFS
mkdir -p $BUILDDROP_KEXT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are cases in the build scripts that use sudo. How do we know when we will need to use that vs not?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm making the assumption in this script that the CI agent will have access to wherever it is asked to publish the drop. Also, this caught my clumsiness a few times where I fat fingered /[something] instead of ~/[something].


# Copy to the build drop, retaining directory structure.
rsync -avm $VFS_OUTPUTDIR/Git $BUILDDROP_BUILDOUTPUT
rsync -avm $VFS_PUBLISHDIR $BUILDDROP_ROOT
rsync -avm $VFS_SCRIPTDIR $BUILDDROP_SRC/Scripts
rsync -avm $VFS_SRCDIR/ProjFS.Mac/Scripts $BUILDDROP_PROJFS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this keep the Scripts folder?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It keeps the script folders so that we can keep the logic on how we run functional tests or install/start the kext encoded in the script.

rsync -avm $VFS_OUTPUTDIR/ProjFS.Mac/Native/Build/Products/$CONFIGURATION/PrjFSKext.kext $BUILDDROP_KEXT