-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#18385 from Aflynn50/fix-local-charms-test-2
juju#18385 Backport juju#18216 from 3.6. > Git needed to have a user to commit, set the user.
- Loading branch information
Showing
1 changed file
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,7 @@ run_deploy_local_charm_revision() { | |
cd "${TMP}/ubuntu-plus" || exit 1 | ||
|
||
# Initialise a git repo to check the commit SHA is used as the charm version. | ||
git init | ||
git add . && git commit -m "commit everything" | ||
create_local_git_and_commit_all | ||
SHA_OF_UBUNTU_PLUS=\"$(git describe --dirty --always)\" | ||
|
||
# Deploy from directory. | ||
|
@@ -100,8 +99,7 @@ run_deploy_local_charm_revision_relative_path() { | |
cd "${TMP}/ubuntu-plus" || exit 1 | ||
|
||
# Initialise a git repo and commit everything so that commit SHA is used as the charm version. | ||
git init | ||
git add . && git commit -m "commit everything" | ||
create_local_git_and_commit_all | ||
SHA_OF_UBUNTU_PLUS=\"$(git describe --dirty --always)\" | ||
|
||
# Create git directory outside the charm directory | ||
|
@@ -149,8 +147,7 @@ run_deploy_local_charm_revision_invalid_git() { | |
cd "${TMP_CHARM_GIT}/ubuntu-plus" || exit 1 | ||
|
||
# Initialise a git repo and commit everything so that commit SHA is used as the charm version. | ||
git init | ||
git add . && git commit -m "commit everything" | ||
create_local_git_and_commit_all | ||
SHA_OF_UBUNTU_PLUS=\"$(git describe --dirty --always)\" | ||
|
||
WANTED_CHARM_SHA=\"$(git describe --dirty --always)\" | ||
|
@@ -183,6 +180,15 @@ create_local_git_folder() { | |
git commit -am "rand_file" | ||
} | ||
|
||
create_local_git_and_commit_all() { | ||
git init . | ||
if [ -z "$(git config --global user.email)" ]; then | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "John Doe" | ||
fi | ||
git add . && git commit -m "commit everything" | ||
} | ||
|
||
test_local_charms() { | ||
if [ "$(skip 'test_local_charms')" ]; then | ||
echo "==> TEST SKIPPED: deploy local charm tests" | ||
|