Merge pull request #98 from brthor/dockerci
Changes to enable Ubuntu Docker CI build
This commit is contained in:
commit
9350db24be
14 changed files with 38 additions and 25 deletions
14
build.sh
14
build.sh
|
@ -1,5 +1,15 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# $1 is passed to package to enable deb or pkg packaging
|
||||
|
||||
./scripts/bootstrap.sh
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
||||
|
||||
./scripts/package.sh
|
||||
$DIR/scripts/bootstrap.sh
|
||||
|
||||
$DIR/scripts/package.sh $1
|
||||
|
|
|
@ -104,4 +104,4 @@ dotnet publish --framework dnxcore50 --runtime $RID --output "$STAGE2_DIR" "$REP
|
|||
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
|
||||
|
||||
# Make Stage 2 Folder Accessible
|
||||
chmod -R a+r $STAGE2_DIR
|
||||
chmod -R a+r $REPOROOT
|
|
@ -1,9 +1,8 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [[ "$(uname)" == "Linux" ]]; then
|
||||
$SCRIPT_DIR/dockerbuild.sh $@
|
||||
$SCRIPT_DIR/dockerbuild.sh debian $@
|
||||
else
|
||||
$SCRIPT_DIR/../build.sh $@
|
||||
fi
|
||||
|
|
|
@ -13,7 +13,7 @@ cd $DIR/..
|
|||
[ -z "$DOTNET_BUILD_CONTAINER_TAG" ] && DOTNET_BUILD_CONTAINER_TAG="dotnetcli-build"
|
||||
[ -z "$DOTNET_BUILD_CONTAINER_NAME" ] && DOTNET_BUILD_CONTAINER_NAME="dotnetcli-build-container"
|
||||
[ -z "$DOCKER_HOST_SHARE_DIR" ] && DOCKER_HOST_SHARE_DIR=$(pwd)
|
||||
[ -z "$BUILD_COMMAND" ] && BUILD_COMMAND="//opt\\code\\build.sh"
|
||||
[ -z "$BUILD_COMMAND" ] && BUILD_COMMAND="/opt/code/build.sh"
|
||||
|
||||
echo $DOCKER_HOST_SHARE_DIR
|
||||
|
||||
|
@ -21,9 +21,13 @@ echo $DOCKER_HOST_SHARE_DIR
|
|||
docker build -t $DOTNET_BUILD_CONTAINER_TAG scripts/docker/
|
||||
|
||||
# Run the build in the container
|
||||
docker rm -f $DOTNET_BUILD_CONTAINER_NAME
|
||||
docker run \
|
||||
docker run --rm \
|
||||
-v $DOCKER_HOST_SHARE_DIR:/opt/code \
|
||||
--name $DOTNET_BUILD_CONTAINER_NAME \
|
||||
-e DOTNET_BUILD_VERSION=$DOTNET_BUILD_VERSION \
|
||||
$DOTNET_BUILD_CONTAINER_TAG $BUILD_COMMAND
|
||||
$DOTNET_BUILD_CONTAINER_TAG $BUILD_COMMAND $1
|
||||
|
||||
docker run --rm \
|
||||
-v $DOCKER_HOST_SHARE_DIR:/opt/code \
|
||||
-e DOTNET_BUILD_VERSION=$DOTNET_BUILD_VERSION \
|
||||
$DOTNET_BUILD_CONTAINER_TAG chmod a+rw /opt/code
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env bash
|
||||
#
|
||||
# Build Script
|
||||
# Debian Packaging Script
|
||||
# Currently Intended to build on ubuntu14.04
|
||||
|
||||
SOURCE="${BASH_SOURCE[0]}"
|
||||
|
|
|
@ -11,7 +11,7 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
|||
# Create Dnvm Package
|
||||
$DIR/package-dnvm.sh
|
||||
|
||||
# Create Debian package
|
||||
$DIR/package-debian.sh
|
||||
|
||||
# TODO: Create Pkg
|
||||
if [[ "$1" == "debian" ]]; then
|
||||
# Create Debian package
|
||||
$DIR/package-debian.sh
|
||||
fi
|
||||
|
|
|
@ -68,7 +68,7 @@ function AddPackage
|
|||
fi
|
||||
packageUrl=$(grep "sourceUrl" $packageFile | head -n 1 | awk '{print $2}')
|
||||
echo "Adding package to $server [$packageUrl]"
|
||||
curl -i -k "$baseurl/v1/packages" --data @./$packageFile -H "Content-Type: application/json"
|
||||
curl -i -k "$baseurl/v1/packages" --data @$packageFile -H "Content-Type: application/json"
|
||||
BailIf $?
|
||||
echo ""
|
||||
}
|
||||
|
|
|
@ -82,9 +82,9 @@ copy_code_to_vm(){
|
|||
run_build(){
|
||||
# These are env variables for dockerbuild.sh
|
||||
export DOCKER_HOST_SHARE_DIR="$(_convert_path $VM_CODE_DIR)"
|
||||
echo $DOCKER_HOST_SHARE_DIR
|
||||
export BUILD_COMMAND="//opt\\code\\build.sh"
|
||||
|
||||
$DIR/dockerbuild.sh
|
||||
$DIR/dockerbuild.sh debian
|
||||
}
|
||||
|
||||
# This will duplicate the entire repo + any side effects from
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
},
|
||||
"Microsoft.Extensions.CommandLineUtils.Sources": {
|
||||
"type": "build",
|
||||
"version": "1.0.0-*"
|
||||
"version": "1.0.0-rc1-15838"
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
},
|
||||
"Microsoft.Extensions.CommandLineUtils.Sources": {
|
||||
"type": "build",
|
||||
"version": "1.0.0-*"
|
||||
"version": "1.0.0-rc1-15838"
|
||||
},
|
||||
"Microsoft.Net.Compilers.netcore": "1.1.0-*"
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
},
|
||||
"Microsoft.Extensions.CommandLineUtils.Sources": {
|
||||
"type": "build",
|
||||
"version": "1.0.0-*"
|
||||
"version": "1.0.0-rc1-15838"
|
||||
},
|
||||
"Microsoft.Net.Compilers.netcore": "1.1.0-*"
|
||||
},
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"Microsoft.Extensions.CommandLineUtils.Sources": {
|
||||
"type": "build",
|
||||
"version": "1.0.0-*"
|
||||
"version": "1.0.0-rc1-15838"
|
||||
},
|
||||
"System.AppContext": "4.0.1-beta-23419"
|
||||
},
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
},
|
||||
"Microsoft.Extensions.CommandLineUtils.Sources": {
|
||||
"type": "build",
|
||||
"version": "1.0.0-*"
|
||||
"version": "1.0.0-rc1-15838"
|
||||
},
|
||||
"System.Xml.XDocument": "4.0.11-beta-23419",
|
||||
"System.Resources.ReaderWriter": "4.0.0-beta-23419"
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
"Microsoft.Extensions.FileSystemGlobbing": "1.0.0-beta-23419",
|
||||
"Microsoft.Extensions.JsonParser.Sources": {
|
||||
"type": "build",
|
||||
"version": "1.0.0-*"
|
||||
"version": "1.0.0-rc1-15792"
|
||||
},
|
||||
"Microsoft.Extensions.HashCodeCombiner.Sources": {
|
||||
"type": "build",
|
||||
"version": "1.0.0-*"
|
||||
"version": "1.0.0-rc1-15718 "
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue