Add support for single release and fix issue with PSH install
parent
db6166033d
commit
1b9cae7e02
|
@ -14,3 +14,4 @@ data/misc/Obfuscated.ps1
|
||||||
setup/xar*
|
setup/xar*
|
||||||
setup/bomutils/*
|
setup/bomutils/*
|
||||||
.venv
|
.venv
|
||||||
|
.DS_Store
|
||||||
|
|
|
@ -4,39 +4,65 @@ set -ex
|
||||||
# SET THE FOLLOWING VARIABLES
|
# SET THE FOLLOWING VARIABLES
|
||||||
USERNAME=empireproject
|
USERNAME=empireproject
|
||||||
IMAGE=empire
|
IMAGE=empire
|
||||||
VERSION="$(curl -s https://raw.githubusercontent.com/EmpireProject/Empire/master/lib/common/empire.py | grep "VERSION =" | cut -d '"' -f2)"
|
VERSION="$(cat VERSION)"
|
||||||
|
|
||||||
# UPDATE THE SOURCE CODE
|
# UPDATE THE SOURCE CODE
|
||||||
git pull
|
git pull
|
||||||
|
|
||||||
# bump version
|
# bump version
|
||||||
docker run --rm -v "$PWD":/app treeder/bump patch
|
read -p "[!] Do you want to BUMP the version? [Y/N] " -n 1 -r
|
||||||
|
echo # (optional) move to a new line
|
||||||
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
# do dangerous stuff
|
||||||
|
# TODO: CHECK IF WE WANT TO BUMP PATCH or MINOR or MAJOR
|
||||||
|
docker run --rm -v "$PWD":/app treeder/bump minor
|
||||||
|
fi
|
||||||
VERSION=`cat VERSION`
|
VERSION=`cat VERSION`
|
||||||
echo "version: $VERSION"
|
echo "[*] Current version: $VERSION"
|
||||||
|
|
||||||
# TAF, PULL, MERGE DEV
|
# TAF, PULL, MERGE DEV
|
||||||
git checkout -b "dev"
|
read -p "[!] Do you want to create a new Github Release? [Y/N] " -n 1 -r
|
||||||
git add --all
|
echo # (optional) move to a new line
|
||||||
git commit -m "Empire $VERSION Release"
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
git tag -a "$VERSION" -m "Empire $VERSION Release"
|
then
|
||||||
git push origin "dev"
|
# do dangerous stuff
|
||||||
git push origin "dev" --tags
|
git checkout -b "Version-$VERSION"
|
||||||
git checkout master
|
git add --all
|
||||||
git merge "dev"
|
git commit -m "Empire $VERSION Release"
|
||||||
git push
|
# NO NEED TO TAG IF WE RELEASE
|
||||||
hub release create $VERSION -m "Empire $VERSION Release"
|
# git tag -a "$VERSION" -m "Empire $VERSION Release"
|
||||||
|
git push origin "Version-$VERSION"
|
||||||
|
# git push origin "dev" --tags
|
||||||
|
git checkout master
|
||||||
|
git merge "Version-$VERSION"
|
||||||
|
git push
|
||||||
|
hub release create $VERSION -m "Empire $VERSION Release"
|
||||||
|
fi
|
||||||
|
|
||||||
# ALERT VERSION
|
|
||||||
echo "Building Version: $VERSION"
|
|
||||||
|
|
||||||
# START BUILD
|
read -p "[!] Do you want to BUILD Docker image? [Y/N] " -n 1 -r
|
||||||
./.build.sh
|
echo # (optional) move to a new line
|
||||||
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
|
then
|
||||||
|
# do dangerous stuff
|
||||||
|
# ALERT VERSION
|
||||||
|
echo "[*] Building Version: $VERSION"
|
||||||
|
# START BUILD
|
||||||
|
./.build.sh
|
||||||
|
fi
|
||||||
|
|
||||||
# DOCKER TAG/VERSIONING
|
# DOCKER TAG/VERSIONING
|
||||||
docker tag $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$VERSION
|
docker tag $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$VERSION
|
||||||
|
|
||||||
# PUSH TO DOCKER HUB
|
read -p "[!] Do you want to PUSH to Docker Hub? [Y/N] " -n 1 -r
|
||||||
docker push $USERNAME/$IMAGE:latest
|
echo # (optional) move to a new line
|
||||||
echo "Docker image pushed: $USERNAME/$IMAGE:latest"
|
if [[ $REPLY =~ ^[Yy]$ ]]
|
||||||
docker push $USERNAME/$IMAGE:$VERSION
|
then
|
||||||
echo "Docker image pushed: $USERNAME/$IMAGE:$VERSION"
|
# do dangerous stuff
|
||||||
|
# PUSH TO DOCKER HUB
|
||||||
|
docker push $USERNAME/$IMAGE:latest
|
||||||
|
echo "Docker image pushed: $USERNAME/$IMAGE:latest"
|
||||||
|
docker push $USERNAME/$IMAGE:$VERSION
|
||||||
|
echo "Docker image pushed: $USERNAME/$IMAGE:$VERSION"
|
||||||
|
fi
|
||||||
|
|
|
@ -12,11 +12,16 @@ function install_powershell {
|
||||||
brew cask install powershell
|
brew cask install powershell
|
||||||
else
|
else
|
||||||
if [ ! which powershell > /dev/null ] && [ ! which pwsh > /dev/null ]; then
|
if [ ! which powershell > /dev/null ] && [ ! which pwsh > /dev/null ]; then
|
||||||
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
|
# TODO: Support multiple powershell releases
|
||||||
curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
|
# Import the public repository GPG keys
|
||||||
apt-get update
|
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
|
||||||
|
# Register the Microsoft Ubuntu repository
|
||||||
|
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
|
||||||
|
# Update the list of products
|
||||||
|
apt-get update
|
||||||
|
# Install PowerShell
|
||||||
|
apt-get install -y powershell
|
||||||
fi
|
fi
|
||||||
apt-get install -y powershell
|
|
||||||
if ls /opt/microsoft/powershell/*/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY; then
|
if ls /opt/microsoft/powershell/*/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY; then
|
||||||
rm /opt/microsoft/powershell/*/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY
|
rm /opt/microsoft/powershell/*/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue