Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
chore(test/e2e/azure/cli): Add tag with current timestamp for rg clea…
Browse files Browse the repository at this point in the history
…nup (#1534)
  • Loading branch information
jchauncey authored and jackfrancis committed Oct 4, 2017
1 parent ed7e905 commit e32dd26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/e2e/azure/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package azure

import (
"encoding/json"
"fmt"
"log"
"os/exec"
"time"

"github.com/Azure/acs-engine/test/e2e/engine"

Expand Down Expand Up @@ -75,8 +77,10 @@ func (a *Account) SetSubscription() error {
}

// CreateGroup will create a resource group in a given location
//--tags "type=${RESOURCE_GROUP_TAG_TYPE:-}" "now=$(date +%s)" "job=${JOB_BASE_NAME:-}" "buildno=${BUILD_NUM:-}"
func (a *Account) CreateGroup(name, location string) error {
out, err := exec.Command("az", "group", "create", "--name", name, "--location", location).CombinedOutput()
now := fmt.Sprintf("now=%v", time.Now().Add(-3*time.Hour).Unix())
out, err := exec.Command("az", "group", "create", "--name", name, "--location", location, "--tags", now).CombinedOutput()
if err != nil {
log.Printf("Error while trying create resource group (%s) in %s:%s", name, location, err)
log.Printf("Output:%s\n", out)
Expand Down

0 comments on commit e32dd26

Please sign in to comment.