Skip to content

Commit

Permalink
[#120]: Fix issues in the testing script after the release process (#121
Browse files Browse the repository at this point in the history
)

* das-120: Fix issues in the testing script after the release process

* Update release.sh
  • Loading branch information
levisingularity authored Nov 19, 2024
1 parent 551f74d commit e1e7167
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 13 deletions.
7 changes: 3 additions & 4 deletions scripts/deployment/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function create_release() {
if process_package_dependencies "$package_name" "$package_dependencies"; then
execute_hook_if_exists "BeforeRelease" "$package_hook_before_release"

cd - &>/dev/null
cd "$workdir" &>/dev/null

local new_package="{\"package_name\": \"${package_name}\", \"current_version\": \"${package_version}\", \"new_version\": \"${new_package_version}\", \"repository_path\": \"${package_repository_folder}\", \"repository_owner\": \"${package_repo_owner}\", \"repository_name\": \"${package_repo_name}\", \"repository_workflow\": \"${package_workflow}\", \"repository_ref\": \"$package_repo_ref\"}"

Expand Down Expand Up @@ -233,15 +233,14 @@ function main() {
requirements "${required_commands[@]}"
process_package_definitions "$definitions"
review_and_apply_updates
empty_backup_answers

if [[ "$exec_integration_tests" == true ]]; then
print "Before starting the integration tests, it might be necessary to deploy the resources. To do this, use the command 'make deploy'"
press_enter_to_continue

source "$workdir/scripts/deployment/tests.sh"
make integration-tests
fi

empty_backup_answers
}


Expand Down
Empty file modified scripts/deployment/tests.sh
100644 → 100755
Empty file.
26 changes: 17 additions & 9 deletions scripts/deployment/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

# PATHS
workdir=$(pwd)
github_token_path="$workdir/scripts/deployment/gh_token"

# GLOBAL VARIABLES
colors=("reset" "red" "green" "blue" "yellow")
Expand Down Expand Up @@ -147,8 +146,11 @@ function show_git_diff() {
}

function set_git_identity() {
local gh_user=$(gh api user | jq -r '.login')
local gh_email=$(gh api user/emails | jq -r '.[0].email')
local gh_user=""
local gh_email=""

gh_user=$(gh api user | jq -r '.login')
gh_email=$(gh api user/emails | jq -r '.[0].email')

print ":green:Setting git identity to $gh_user:$gh_email:/green:"
git config user.name "$gh_user"
Expand All @@ -166,7 +168,7 @@ function commit_and_push_changes() {

set_git_identity

git add $files_to_add
git add "$files_to_add"

git commit -m "$commit_msg"

Expand All @@ -177,17 +179,23 @@ function commit_and_push_changes() {
}

function setup_gh_auth() {
local github_token=$(load_or_request_github_token "$github_token_path")

gh auth login --web
if ! gh auth status >/dev/null 2>&1; then
gh auth refresh -h github.com -s user

gh auth setup-git
gh auth setup-git
else
local gh_user
gh_user=$(gh api user | jq -r '.login')
print ":yellow:User ${gh_user} is logged in:/yellow:"
fi
}

function clone_repo_to_temp_dir() {
local package_repository="$1"
local target_branch="${2:-master}"
local tmp_folder=$(mktemp -d)
local tmp_folder=""

tmp_folder=$(mktemp -d)

gh repo clone "$package_repository" "$tmp_folder"

Expand Down
Empty file modified scripts/deployment/workflow.sh
100644 → 100755
Empty file.

0 comments on commit e1e7167

Please sign in to comment.