-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand GIT CLONE tests to validate --branch works (#3469)
Signed-off-by: Alex Couture-Beil <[email protected]>
- Loading branch information
Showing
2 changed files
with
135 additions
and
0 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 |
---|---|---|
|
@@ -12,6 +12,35 @@ | |
"targets": [ | ||
{ | ||
"name": "test", | ||
"recipe": [ | ||
{ | ||
"command": { | ||
"args": [ | ||
"+test-default" | ||
], | ||
"name": "BUILD" | ||
} | ||
}, | ||
{ | ||
"command": { | ||
"args": [ | ||
"+test-branch" | ||
], | ||
"name": "BUILD" | ||
} | ||
}, | ||
{ | ||
"command": { | ||
"args": [ | ||
"+test-sha" | ||
], | ||
"name": "BUILD" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "test-default", | ||
"recipe": [ | ||
{ | ||
"command": { | ||
|
@@ -87,6 +116,93 @@ | |
} | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "test-branch", | ||
"recipe": [ | ||
{ | ||
"command": { | ||
"args": [ | ||
"/test" | ||
], | ||
"name": "WORKDIR" | ||
} | ||
}, | ||
{ | ||
"command": { | ||
"args": [ | ||
"--branch", | ||
"v0.7.20", | ||
"[email protected]:earthly/earthly.git", | ||
"myrepo" | ||
], | ||
"name": "GIT CLONE" | ||
} | ||
}, | ||
{ | ||
"command": { | ||
"args": [ | ||
"/test/myrepo" | ||
], | ||
"name": "WORKDIR" | ||
} | ||
}, | ||
{ | ||
"command": { | ||
"args": [ | ||
"test", | ||
"\"$(cat CHANGELOG.md | grep '## v' | head -n 1)\"", | ||
"=", | ||
"\"## v0.7.20 - 2023-10-03\"" | ||
], | ||
"name": "RUN" | ||
} | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "test-sha", | ||
"recipe": [ | ||
{ | ||
"command": { | ||
"args": [ | ||
"/test" | ||
], | ||
"name": "WORKDIR" | ||
} | ||
}, | ||
{ | ||
"command": { | ||
"args": [ | ||
"--branch", | ||
"f862451125039f2071f26168ae9bc0e69ec24bf3", | ||
"[email protected]:earthly/earthly.git", | ||
"myrepo" | ||
], | ||
"docs": "git rev-parse v0.7.10 --> f862451125039f2071f26168ae9bc0e69ec24bf3\n", | ||
"name": "GIT CLONE" | ||
} | ||
}, | ||
{ | ||
"command": { | ||
"args": [ | ||
"/test/myrepo" | ||
], | ||
"name": "WORKDIR" | ||
} | ||
}, | ||
{ | ||
"command": { | ||
"args": [ | ||
"test", | ||
"\"$(cat CHANGELOG.md | grep '## v' | head -n 1)\"", | ||
"=", | ||
"\"## v0.7.10 - 2023-07-05\"" | ||
], | ||
"name": "RUN" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"version": { | ||
|
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
VERSION 0.7 | ||
FROM alpine/git:1.0.7 | ||
|
||
test: | ||
BUILD +test-default | ||
BUILD +test-branch | ||
BUILD +test-sha | ||
|
||
test-default: | ||
WORKDIR /test | ||
GIT CLONE https://github.com/moby/buildkit.git buildkit | ||
RUN test "$(pwd)" = "/test" | ||
|
@@ -9,3 +15,16 @@ test: | |
RUN git status | ||
RUN git branch | ||
RUN test -f README.md | ||
|
||
test-branch: | ||
WORKDIR /test | ||
GIT CLONE --branch v0.7.20 [email protected]:earthly/earthly.git myrepo | ||
WORKDIR /test/myrepo | ||
RUN test "$(cat CHANGELOG.md | grep '## v' | head -n 1)" = "## v0.7.20 - 2023-10-03" | ||
|
||
test-sha: | ||
WORKDIR /test | ||
# git rev-parse v0.7.10 --> f862451125039f2071f26168ae9bc0e69ec24bf3 | ||
GIT CLONE --branch f862451125039f2071f26168ae9bc0e69ec24bf3 [email protected]:earthly/earthly.git myrepo | ||
WORKDIR /test/myrepo | ||
RUN test "$(cat CHANGELOG.md | grep '## v' | head -n 1)" = "## v0.7.10 - 2023-07-05" |