Skip to content

Commit 30df6ad

Browse files
committed
review fixes
1 parent 8edfbba commit 30df6ad

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

0-bootstrap/scripts/choose_build_type.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616

1717
# Define the base path where the build type files are
18-
SCRIPTS_DIR="$( dirname -- "$0"; )"
18+
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1919
BASE_PATH="$SCRIPTS_DIR/.."
2020
TARGET_BUILD="$1"
2121

helpers/foundation-deployer/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Version 1.5.7 is the last version before the license model change. To use a late
7373

7474
### Prepare the deploy environment
7575

76-
- Create a directory in the file system to host the Git Repositories that will be created (Cloud Source repositories, Github , or GitLab) and a copy of the terraform example foundation repository.
76+
- Create a directory in the file system to host the Git Repositories that will be created (Cloud Source repositories, Github, or GitLab) and a copy of the terraform example foundation repository.
7777
- Clone the `terraform-example-foundation` repository on this directory.
7878

7979
```text

helpers/foundation-deployer/github/github.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ func triggerNewBuild(t testing.TB, ctx context.Context, owner, repo, token, comm
8484
},
8585
}
8686

87-
// wait action creation
87+
// wait for the new workflow run to be created and appear
88+
// in the API results after re-running it
89+
// needed because RerunWorkflowByID dos no return
90+
// the ID of the new workflow
8891
time.Sleep(30 * time.Second)
8992

9093
runs, _, err := client.Actions.ListRepositoryWorkflowRuns(ctx, owner, repo, opts)
@@ -267,10 +270,11 @@ func (g GH) WaitBuildSuccess(t testing.TB, owner, repo, token, commitSha, failur
267270
var runID int64
268271
var err error
269272

270-
ctx := context.Background()
271-
// wait action creation
273+
// wait for the new workflow and action to be created and appear in the API results
274+
// after the code being pushed to the repository
272275
time.Sleep(30 * time.Second)
273276

277+
ctx := context.Background()
274278
runID, status, conclusion, err = g.GetLastActionState(t, ctx, owner, repo, token, commitSha)
275279
if err != nil {
276280
return err

helpers/foundation-deployer/gitlab/gitlab.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,10 +202,11 @@ func (g GL) WaitBuildSuccess(t testing.TB, owner, project, token, commitSha, fai
202202
var jobID int
203203
var err error
204204

205-
ctx := context.Background()
206-
// wait job creation
205+
// wait for the new job to be created and appear in the API results
206+
// after the code being pushed to the project
207207
time.Sleep(30 * time.Second)
208208

209+
ctx := context.Background()
209210
status, jobID, err = g.GetLastJobStatusForSHA(t, ctx, owner, project, token, commitSha)
210211
if err != nil {
211212
return err

0 commit comments

Comments
 (0)