mirror of
https://github.com/Alfresco/acs-community-packaging.git
synced 2026-09-16 18:13:21 +00:00
ACS-12381 Migrate to GitHub App Tokens (#1694)
* ACS-12380 Use env-load-from-yaml to read RELEASE_VERSION and DEVELOPMENT_VERSION * ACS-12380 Pin action usages to an immutable commit SHA * ACS-12380 Adjust versions * ACS-12381 Migrate to Github App token * ACS-12381 Use sha * ACS-12381 Adjust release-versions.yml * ACS-12381 Use AUTH variable * ACS-12381 Remove set +x
This commit is contained in:
@@ -20,7 +20,7 @@ function cloneRepo() {
|
||||
|
||||
rm -rf "$(basename "${REPO%.git}")"
|
||||
|
||||
git clone -b "${TAG_OR_BRANCH}" --depth=1 "https://${GIT_USERNAME}:${GIT_PASSWORD}@${REPO}"
|
||||
git clone -b "${TAG_OR_BRANCH}" --depth=1 "https://${AUTH}${REPO}"
|
||||
|
||||
popd >/dev/null
|
||||
}
|
||||
@@ -76,7 +76,9 @@ function remoteBranchExists() {
|
||||
local REMOTE_REPO="${1}"
|
||||
local BRANCH="${2}"
|
||||
|
||||
git ls-remote --exit-code --heads "https://${GIT_USERNAME}:${GIT_PASSWORD}@${REMOTE_REPO}" "${BRANCH}" &>/dev/null
|
||||
git ls-remote --exit-code --heads "https://${AUTH}${REMOTE_REPO}" "${BRANCH}" &>/dev/null
|
||||
|
||||
return "${RESULT}"
|
||||
}
|
||||
|
||||
function identifyUpstreamSourceBranch() {
|
||||
@@ -175,7 +177,7 @@ function retieveLatestTag() {
|
||||
|
||||
local LOCAL_PATH="/tmp/$(basename "${REPO%.git}")"
|
||||
|
||||
git clone -q -b "${BRANCH}" "https://${GIT_USERNAME}:${GIT_PASSWORD}@${REPO}" "${LOCAL_PATH}"
|
||||
git clone -q -b "${BRANCH}" "https://${AUTH}${REPO}" "${LOCAL_PATH}"
|
||||
|
||||
pushd "${LOCAL_PATH}" >/dev/null
|
||||
git describe --abbrev=0 --tags
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
echo "=========================== Starting Release Script ==========================="
|
||||
PS4="\[\e[35m\]+ \[\e[m\]"
|
||||
set -vex
|
||||
pushd "$(dirname "${BASH_SOURCE[0]}")/../../"
|
||||
|
||||
|
||||
if [ -z "${RELEASE_VERSION}" ] || [ -z "${DEVELOPMENT_VERSION}" ]; then
|
||||
echo "Please provide a Release and Development version in the format <acs-version>-<additional-info> (e.g. 7.2.0-A2)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use full history for release
|
||||
git checkout -B "${BRANCH_NAME}"
|
||||
# Define git identity for commits
|
||||
git config user.email "${GIT_EMAIL}"
|
||||
git config user.name "${GIT_USERNAME}"
|
||||
|
||||
mvn -B \
|
||||
-ntp \
|
||||
-Prelease,all-tas-tests -Pags \
|
||||
-DreleaseVersion="${RELEASE_VERSION}" \
|
||||
-DdevelopmentVersion="${DEVELOPMENT_VERSION}" \
|
||||
"-Darguments=-Prelease,all-tas-tests -Pags -DskipTests -Dbuild-number=${BUILD_NUMBER}" \
|
||||
release:clean release:prepare release:perform \
|
||||
-DscmCommentPrefix="[maven-release-plugin][skip ci] " \
|
||||
-Dusername="${GIT_USERNAME}" \
|
||||
-Dpassword="${GIT_PASSWORD}"
|
||||
|
||||
|
||||
popd
|
||||
set +vex
|
||||
echo "=========================== Finishing Release Script =========================="
|
||||
|
||||
Reference in New Issue
Block a user