Revert to manual release.

This commit is contained in:
Jamal Kaabi-Mofrad
2020-04-14 18:18:26 +01:00
parent 4a86d5f191
commit 17734dea68
4 changed files with 30 additions and 29 deletions

View File

@@ -2,28 +2,23 @@ dist: trusty
sudo: required
language: bash
branches:
only:
- master
stages:
- name: Build and Release
if: tag IS present
jobs:
include:
- stage: "Build and Release"
name: "Build and release alfresco-keycloak-theme"
if: fork = false AND (branch = master) AND type != pull_request AND commit_message !~ /\[no-release\]/
before_deploy:
- ./set-version.sh
- source build.properties
- echo "Prepare deployment of alfresco-keycloak-theme-$THEME_VERSION"
- export TRAVIS_TAG=$THEME_VERSION
- git tag "$TRAVIS_TAG" -m ""
- echo "Prepare deployment of alfresco-keycloak-theme-$TRAVIS_TAG"
- ./build.sh
deploy:
provider: releases
api_key: $GITHUB_TOKEN
file: "alfresco-keycloak-theme-$THEME_VERSION.zip"
file: "alfresco-keycloak-theme-$TRAVIS_TAG.zip"
skip_cleanup: true
edge: true
edge: true
on:
tag: true
repo: Alfresco/alfresco-keycloak-theme

2
build.properties Executable file → Normal file
View File

@@ -1 +1 @@
THEME_VERSION=0.1
THEME_VERSION=0.2

22
release.sh Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/bash -e
set -o errexit
declare -r currentDir="$(dirname "${BASH_SOURCE[0]}")"
source "${currentDir}/build.properties"
CURRENT_BRANCH=$(git branch | grep '*' | cut -d' ' -f 2)
echo "Do you wish to tag and push the current branch '$CURRENT_BRANCH' as '$THEME_VERSION' ?"
select yn in "Yes" "No"; do
case $yn in
Yes)
git tag "$THEME_VERSION" -m ""
git push origin "$THEME_VERSION"
break
;;
No)
exit
;;
esac
done

View File

@@ -1,16 +0,0 @@
#!/bin/bash
OLD_VERSION=$(cat build.properties | grep THEME_VERSION)
OLD_VALUE=$(echo $OLD_VERSION | cut -f 2 -d "=")
NEW_VALUE=$(echo $OLD_VALUE + .1 | bc)
if [[ $NEW_VALUE == .* ]]; then
# Append zero
NEW_VALUE="0$NEW_VALUE"
fi
echo "Setting the THEME_VERSION from '$OLD_VALUE' to '$NEW_VALUE'"
NEW_VERSION=$(echo THEME_VERSION=$NEW_VALUE)
sed -i -e "s/$OLD_VERSION/$NEW_VERSION/" build.properties