AAE-11918A - remove travis env var (#8312)

* AAE-11918 - travis_branch env removal

* AAE-11918 - travis_branch env removal

* event_type and travis_pull_request_branch  env removal

* e travis_build_dir, travis_build_number, travis_commit  env removal

* rename scripts path

* remove .travis file

* remove .travis file

* remove .travis file

* just a commit

* trying to fix e2e test

* fix e2e issue

* remove action load travis env

* with action travis env var load

* remove action travis load env vars

* remove action travis load env vars

* remove action travis load env vars

* last check

* test release flow in dry-run

* final check for review

* fix env variables

* fix env variables

* fix env variables

* remove devel flag

* revert renaming action facade

* git mv commit

* git mv commit
This commit is contained in:
Maurizio Cacace
2023-02-28 15:36:22 +01:00
committed by GitHub
parent 2bc74f012d
commit fc224713f2
37 changed files with 191 additions and 198 deletions

View File

@@ -0,0 +1,68 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
eval VERSION=""
eval projects=( "adf-core"
"adf-insights"
"adf-content-services"
"adf-extensions"
"adf-testing"
"adf-process-services"
"adf-process-services-cloud" )
show_help() {
echo "Usage: deprecate-develop-build.sh"
echo "-v or -version to check -v 1.4.0 "
echo ""
}
set_npm_registry() {
npm set registry https://registry.npmjs.org/
}
version() {
if [[ $1 == "" ]];
then
echo "You need to add a version"
exit 1
fi
VERSION=$1
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-v|--version) version $2; shift 2;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
if [[ $VERSION == "" ]];
then
echo "You need to add a version"
fi
for PACKAGE in ${projects[@]}
do
echo "@alfresco/$PACKAGE"
for VERSION_TO_DEPRECATE in $(npm view "@alfresco/$PACKAGE" versions --json | jq -r '.[] | select( . | match("-[0-9].*$") ) | select( . | contains("'$VERSION'"))')
do
deprecated=$(npm view "@alfresco/$PACKAGE@$VERSION_TO_DEPRECATE" -json | jq '.deprecated')
if [[ $deprecated != null ]];
then
echo "Already deprecated @alfresco/$PACKAGE@$VERSION_TO_DEPRECATE"
else
echo "Deprecate alpha/beta version @alfresco/$PACKAGE@$VERSION_TO_DEPRECATE"
npm deprecate "@alfresco/$PACKAGE@$VERSION_TO_DEPRECATE" "Upgrade to @latest or $VERSION"
fi
done
done

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../
BRANCH=${GITHUB_REF##*/}
if [[ $BRANCH =~ ^master(-patch.*)?$ ]]; then
export TAGS=$(grep -m1 version package.json | awk '{ print $2 }' | sed 's/[", ]//g')
else
if [[ "${GITHUB_BASE_REF}" != "" ]];
then
export TAGS="${GITHUB_BASE_REF}-$GH_BUILD_NUMBER"
else
export TAGS="$GITHUB_BASE_REF-$GH_BUILD_NUMBER,$GITHUB_BASE_REF"
fi;
fi;
if [[ -n "$GITHUB_ACTIONS" ]]; then
echo "TAGS=$TAGS" >> $GITHUB_ENV;
fi
echo "$TAGS"

View File

@@ -0,0 +1,22 @@
#!/bin/bash
if [[ $BRANCH == "master" ]]; then
VERSION=$(grep -m1 version package.json | awk '{ print $2 }' | sed 's/[", ]//g')
else
VERSION=$(npm view @alfresco/adf-core@beta version)
fi;
echo "git tag -a ${VERSION} -m ${VERSION}"
git config --local user.name "alfresco-build"
git config --local user.email "build@alfresco.com"
git tag -a ${VERSION} -m "${VERSION} [ci skip] "
git remote rm origin
GITHUB_REPO=https://$GITHUB_TOKEN:x-oauth-basic@github.com/Alfresco/alfresco-ng2-components.git
git remote add origin $GITHUB_REPO
if [[ "$1" == "--dryrun" ]]; then
echo "dry run: Pushing new tag ${VERSION}!"
else
echo "Pushing new tag ${VERSION}!"
git push origin --tags
fi;

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../
echo " demo-shell: Running the docker with tag" $TAGS
DOCKER_PROJECT_ARGS="PROJECT_NAME=demo-shell"
# Publish Image to docker
./node_modules/@alfresco/adf-cli/bin/adf-cli docker \
--loginCheck \
--loginUsername "$DOCKER_REPOSITORY_USER" \
--loginPassword "$DOCKER_REPOSITORY_PASSWORD" \
--loginRepo "$DOCKER_REPOSITORY_DOMAIN" \
--dockerRepo "$DOCKER_REPOSITORY" \
--buildArgs "$DOCKER_PROJECT_ARGS" \
--dockerTags "$TAGS" \
--pathProject "$(pwd)" \
"$@"

View File

@@ -0,0 +1,40 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../
VERSION_IN_PACKAGE_JSON=`node -p "require('./package.json')".version;`;
BRANCH=${GITHUB_REF##*/}
if [[ $BRANCH =~ ^master(-patch.*)?$ ]]
then
# Pre-release versions
if [[ $VERSION_IN_PACKAGE_JSON =~ ^[0-9]*\.[0-9]*\.[0-9]*-A\.[0-9]*$ ]];
then
TAG_NPM=next
# Stable major versions
else
TAG_NPM=latest
fi
fi
if [[ $BRANCH =~ ^develop(-patch.*)?$ ]]
then
TAG_NPM=alpha
fi
echo "Publishing on GH PKG registry with tag $TAG_NPM"
./node_modules/@alfresco/adf-cli/bin/adf-cli npm-publish \
--npmRegistry "npm.pkg.github.com" \
--tokenRegistry $github_token \
--tag $TAG_NPM \
--pathProject "$(pwd)" \
"$@"
echo "Publishing on Public npm registry with tag $TAG_NPM"
./node_modules/@alfresco/adf-cli/bin/adf-cli npm-publish \
--npmRegistry $NPM_REGISTRY_ADDRESS \
--tokenRegistry $NPM_REGISTRY_TOKEN \
--tag $TAG_NPM \
--pathProject "$(pwd)" \
"$@"

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../
echo " storybook-shell: Running the docker with tag" $TAGS
DOCKER_PROJECT_ARGS="PROJECT_NAME=storybook/stories"
echo "{}" > $DIR/../../../dist/storybook/stories/app.config.json
# Publish Image to docker
./node_modules/@alfresco/adf-cli/bin/adf-cli docker \
--loginCheck \
--loginUsername "$DOCKER_REPOSITORY_USER" \
--loginPassword "$DOCKER_REPOSITORY_PASSWORD" \
--loginRepo "$DOCKER_REPOSITORY_DOMAIN" \
--dockerRepo "$DOCKER_REPOSITORY_STORYBOOK" \
--buildArgs "$DOCKER_PROJECT_ARGS" \
--dockerTags "$TAGS" \
--pathProject "$(pwd)" \
"$@"