Fix some build scripts (#7048)

Make publish run on API
This commit is contained in:
Eugenio Romano
2021-05-20 17:14:42 +01:00
committed by GitHub
parent a5e85b44f8
commit ac6f616246
4 changed files with 59 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
import:
- source: Alfresco/alfresco-build-tools:.travis.docker_hub_login.yml@v1.1.1
git:
depth: 3
quiet: true
@@ -54,13 +54,13 @@ stages:
- name: "Check bundle"
if: type = push AND tag IS blank
- name: "Trigger Alpha ADF child build"
if: branch = develop AND type = cron
if: branch = develop AND (type = cron || type = api)
- name: "Build Demo shell"
if: tag IS blank
- name: "Unit test Lib"
if: type = cron || type = pull_request
if: type = pull_request || (type = cron || type = api)
- name: "e2e Test"
if: type = cron || type = pull_request
if: type = pull_request || (type = cron || type = api)
- name: "Release tag"
if: branch = master
- name: "Deprecate develop builds"
@@ -99,8 +99,8 @@ jobs:
- stage: "Build lib"
name: "Lib::Build"
script:
- ./scripts/travis/build/build-libs.sh
- ./scripts/travis/release/release-npm.sh
- ./scripts/travis/build/build-libs.sh || travis_terminate 1
- ./scripts/travis/release/release-npm.sh || travis_terminate 1
workspaces:
create:
name: built_libs_cache
@@ -163,7 +163,9 @@ jobs:
script: ./scripts/travis/release/git-tag.sh
- stage: "Deprecate develop builds"
script: ./scripts/travis/release/deprecate-develop-build.sh -v ${ADF_VERSION}
script:
- ADF_VERSION=$(npm view @alfresco/adf-core@${TAG_NPM} version)
- ./scripts/travis/release/deprecate-develop-build.sh -v ${ADF_VERSION}
- stage: "e2e Test"
name: "Core"

44
scripts/npm-move-tag.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
eval projects=(
"@alfresco/adf-cli"
"@alfresco/adf-core"
"@alfresco/adf-content-services"
"@alfresco/adf-insights"
"@alfresco/adf-process-services"
"@alfresco/adf-process-services-cloud"
"@alfresco/adf-testing"
"@alfresco/adf-extensions" )
show_help() {
echo "Usage: npm-move-tag.sh"
echo ""
echo "-v version package to apply new tag"
echo "-t new tag name to add"
}
new_tag(){
eval TAG=$1
}
package_version(){
eval PACKAGE_VERSION=$1
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-t|--tag) new_tag $2; shift 2;;
-v) package_version $2; shift 2;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
esac
done
for PACKAGE in ${projects[@]}
do
echo "====== Move ${PACKAGE}@${PACKAGE_VERSION} to tag ${TAG}===== "
echo "====== command npm dist-tag add ${PACKAGE}@${PACKAGE_VERSION} ${TAG}===== "
npm dist-tag add ${PACKAGE}@${PACKAGE_VERSION} ${TAG}
done

View File

@@ -8,10 +8,12 @@ rm -rf tmp && mkdir tmp;
npx @alfresco/adf-cli@alpha update-commit-sha --pointer "HEAD" --pathPackage "$(pwd)"
if [ $TRAVIS_EVENT_TYPE == "push" ] || [ $TRAVIS_EVENT_TYPE == "cron" ]
if [ $TRAVIS_EVENT_TYPE == "push" ] || [ $TRAVIS_EVENT_TYPE == "cron" ] || [ $TRAVIS_EVENT_TYPE == "api" ]
then
if [ $TRAVIS_BRANCH == "develop"] || [ $TRAVIS_EVENT_TYPE == "cron" ]
if [ $TRAVIS_BRANCH == "develop" ] || [ $TRAVIS_EVENT_TYPE == "cron" ] || [ $TRAVIS_EVENT_TYPE == "api" ]
then
echo "Replace NPM version with new Alpha tag"
NEXT_VERSION=-nextalpha
./scripts/update-version.sh -gnu $NEXT_VERSION || exit 1;
fi

View File

@@ -4,15 +4,11 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR/../../../
if [ $TRAVIS_EVENT_TYPE == "push" ] || [ $TRAVIS_EVENT_TYPE == "cron" ]
if [ $TRAVIS_EVENT_TYPE == "push" ] || [ $TRAVIS_EVENT_TYPE == "cron" ] || [ $TRAVIS_EVENT_TYPE == "api" ]
then
TAG_NPM=latest
if [[ $TRAVIS_BRANCH == "develop" ]];
then
TAG_NPM=alpha
fi
if [[ $TRAVIS_EVENT_TYPE == "cron" ]];
if [ $TRAVIS_BRANCH == "develop" ] || [ $TRAVIS_EVENT_TYPE == "cron" ] || [ $TRAVIS_EVENT_TYPE == "api" ]
then
TAG_NPM=alpha
fi