Permalink
Browse files

Add support for single release and fix issue with PSH install

  • Loading branch information...
killswitch-GUI committed Dec 23, 2017
1 parent db61660 commit 1b9cae7e02673635b6893c1a78501c43788dd029
Showing with 59 additions and 27 deletions.
  1. +1 −0 .gitignore
  2. +48 −22 .release.sh
  3. +1 −1 VERSION
  4. +9 −4 setup/install.sh
View
@@ -14,3 +14,4 @@ data/misc/Obfuscated.ps1
setup/xar*
setup/bomutils/*
.venv
.DS_Store
View
70 .release.sh 100644 → 100755
@@ -4,39 +4,65 @@ set -ex
# SET THE FOLLOWING VARIABLES
USERNAME=empireproject
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
git pull
# 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`
echo "version: $VERSION"
echo "[*] Current version: $VERSION"
# TAF, PULL, MERGE DEV
git checkout -b "dev"
git add --all
git commit -m "Empire $VERSION Release"
git tag -a "$VERSION" -m "Empire $VERSION Release"
git push origin "dev"
git push origin "dev" --tags
git checkout master
git merge "dev"
git push
hub release create $VERSION -m "Empire $VERSION Release"
read -p "[!] Do you want to create a new Github Release? [Y/N] " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
# do dangerous stuff
git checkout -b "Version-$VERSION"
git add --all
git commit -m "Empire $VERSION Release"
# NO NEED TO TAG IF WE 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
./.build.sh
read -p "[!] Do you want to BUILD Docker image? [Y/N] " -n 1 -r
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 $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$VERSION
# 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"
read -p "[!] Do you want to PUSH to Docker Hub? [Y/N] " -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
# 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
View
@@ -1 +1 @@
2.3
2.3.0
View
@@ -12,11 +12,16 @@ function install_powershell {
brew cask install powershell
else
if [ ! which powershell > /dev/null ] && [ ! which pwsh > /dev/null ]; then
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/14.04/prod.list | sudo tee /etc/apt/sources.list.d/microsoft.list
apt-get update
# TODO: Support multiple powershell releases
# Import the public repository GPG keys
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
apt-get install -y powershell
if ls /opt/microsoft/powershell/*/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY; then
rm /opt/microsoft/powershell/*/DELETE_ME_TO_DISABLE_CONSOLEHOST_TELEMETRY
fi

0 comments on commit 1b9cae7

Please sign in to comment.