mirror of
https://github.com/portainer/portainer.git
synced 2025-07-19 13:29:41 +02:00
feat(stacks): redeploy git stack [EE-161] (#5139)
* feat(git): save git config when creating stack (#5048) * feat(git): save git config when creating stack * chore(fs): test fileExists * fix(git): fix tests to use CloneRepository * refactor(git): move options to new object * feat(stacks): redeploy git stack api (#5112) * feat(stacks): redeploy git stacks form [EE-666] * feat(stack): show loading after confirmation * fix(stacks): show same size description * fix(stacks): reload state when deployed * feat(stacks): set stopped stacks status to activate when updating * feat(stacks): backup stack folder before cloning * feat(stacks): don't accept prune and env on update git Co-authored-by: Chaim Lev-Ari <chiptus@users.noreply.github.com> Co-authored-by: Chaim Lev-Ari <chiptus@gmail.com>
This commit is contained in:
parent
296ecc5960
commit
0b93714de4
54 changed files with 795 additions and 381 deletions
|
@ -2,12 +2,13 @@ package git
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
_ "github.com/joho/godotenv/autoload"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/docker/docker/pkg/ioutils"
|
||||
_ "github.com/joho/godotenv/autoload"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestService_ClonePublicRepository_Azure(t *testing.T) {
|
||||
|
@ -54,7 +55,7 @@ func TestService_ClonePublicRepository_Azure(t *testing.T) {
|
|||
assert.NoError(t, err)
|
||||
defer os.RemoveAll(dst)
|
||||
repositoryUrl := fmt.Sprintf(tt.args.repositoryURLFormat, tt.args.password)
|
||||
err = service.ClonePublicRepository(repositoryUrl, tt.args.referenceName, dst)
|
||||
err = service.CloneRepository(dst, repositoryUrl, tt.args.referenceName, "", "")
|
||||
assert.NoError(t, err)
|
||||
assert.FileExists(t, filepath.Join(dst, "README.md"))
|
||||
})
|
||||
|
@ -72,7 +73,7 @@ func TestService_ClonePrivateRepository_Azure(t *testing.T) {
|
|||
defer os.RemoveAll(dst)
|
||||
|
||||
repositoryUrl := "https://portainer.visualstudio.com/Playground/_git/dev_integration"
|
||||
err = service.ClonePrivateRepositoryWithBasicAuth(repositoryUrl, "refs/heads/main", dst, "", pat)
|
||||
err = service.CloneRepository(dst, repositoryUrl, "refs/heads/main", "", pat)
|
||||
assert.NoError(t, err)
|
||||
assert.FileExists(t, filepath.Join(dst, "README.md"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue