-
Notifications
You must be signed in to change notification settings - Fork 297
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 #1111 from buildpacks/fix/1081-1108-buildpack-dupl…
…icates Fix duplicate detection and content collision Signed-off-by: David Freilich <[email protected]>
- Loading branch information
Showing
17 changed files
with
479 additions
and
47 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
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
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
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
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
49 changes: 49 additions & 0 deletions
49
acceptance/testdata/mock_buildpacks/0.2/simple-layers-buildpack-different-sha/bin/build
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo "---> Build: Simple Layers Different Sha Buildpack" | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
launch_dir=$1 | ||
|
||
## makes a launch layer | ||
echo "making launch layer" | ||
|
||
# Add color line, to test for --no-color | ||
echo "Color: [0mStyled" | ||
|
||
mkdir "$launch_dir/launch-layer" | ||
echo "Launch Dep Contents" > "$launch_dir/launch-layer/launch-dep" | ||
ln -snf "$launch_dir/launch-layer" launch-deps | ||
echo "launch = true" > "$launch_dir/launch-layer.toml" | ||
|
||
## makes a cached launch layer | ||
if [[ ! -f "$launch_dir/cached-launch-layer.toml" ]]; then | ||
echo "making cached launch layer" | ||
mkdir "$launch_dir/cached-launch-layer" | ||
echo "Cached Dep Contents" > "$launch_dir/cached-launch-layer/cached-dep" | ||
ln -snf "$launch_dir/cached-launch-layer" cached-deps | ||
echo "launch = true" > "$launch_dir/cached-launch-layer.toml" | ||
echo "cache = true" >> "$launch_dir/cached-launch-layer.toml" | ||
else | ||
echo "reusing cached launch layer" | ||
ln -snf "$launch_dir/cached-launch-layer" cached-deps | ||
fi | ||
|
||
## adds a process | ||
cat <<EOF > "$launch_dir/launch.toml" | ||
[[processes]] | ||
type = "web" | ||
command = "./run" | ||
args = ["8080"] | ||
[[processes]] | ||
type = "hello" | ||
command = "echo" | ||
args = ["hello", "world"] | ||
direct = true | ||
EOF | ||
|
||
echo "---> Done" |
40 changes: 40 additions & 0 deletions
40
acceptance/testdata/mock_buildpacks/0.2/simple-layers-buildpack-different-sha/bin/build.bat
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
@echo off | ||
echo --- Build: Simple Layers Different Sha Buildpack | ||
|
||
set launch_dir=%1 | ||
|
||
:: makes a launch layer | ||
echo making launch layer %launch_dir%\launch-layer | ||
mkdir %launch_dir%\launch-layer | ||
echo Launch Dep Contents > "%launch_dir%\launch-layer\launch-dep | ||
mklink /j launch-deps %launch_dir%\launch-layer | ||
echo launch = true > %launch_dir%\launch-layer.toml | ||
|
||
:: makes a cached launch layer | ||
if not exist %launch_dir%\cached-launch-layer.toml ( | ||
echo making cached launch layer %launch_dir%\cached-launch-layer | ||
mkdir %launch_dir%\cached-launch-layer | ||
echo Cached Dep Contents > %launch_dir%\cached-launch-layer\cached-dep | ||
mklink /j cached-deps %launch_dir%\cached-launch-layer | ||
echo launch = true > %launch_dir%\cached-launch-layer.toml | ||
echo cache = true >> %launch_dir%\cached-launch-layer.toml | ||
) else ( | ||
echo reusing cached launch layer %launch_dir%\cached-launch-layer | ||
mklink /j cached-deps %launch_dir%\cached-launch-layer | ||
) | ||
|
||
:: adds a process | ||
( | ||
echo [[processes]] | ||
echo type = "web" | ||
echo command = '.\run' | ||
echo args = ["8080"] | ||
echo. | ||
echo [[processes]] | ||
echo type = "hello" | ||
echo command = "cmd" | ||
echo args = ["/c", "echo hello world"] | ||
echo direct = true | ||
) > %launch_dir%\launch.toml | ||
|
||
echo --- Done |
3 changes: 3 additions & 0 deletions
3
acceptance/testdata/mock_buildpacks/0.2/simple-layers-buildpack-different-sha/bin/detect
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
## always detect |
2 changes: 2 additions & 0 deletions
2
acceptance/testdata/mock_buildpacks/0.2/simple-layers-buildpack-different-sha/bin/detect.bat
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
:: always detect |
1 change: 1 addition & 0 deletions
1
...nce/testdata/mock_buildpacks/0.2/simple-layers-buildpack-different-sha/bin/extra_file.txt
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Just some extra content to change the sha256 of this buildpack :) |
9 changes: 9 additions & 0 deletions
9
acceptance/testdata/mock_buildpacks/0.2/simple-layers-buildpack-different-sha/buildpack.toml
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
api = "0.2" | ||
|
||
[buildpack] | ||
id = "simple/layers" | ||
version = "simple-layers-version" | ||
name = "Simple Layers Buildpack" | ||
|
||
[[stacks]] | ||
id = "pack.test.stack" |
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
2 changes: 2 additions & 0 deletions
2
acceptance/testdata/pack_fixtures/simple-layers-buildpack-different-sha_package.toml
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[buildpack] | ||
uri = "simple-layers-buildpack-different-sha.tgz" |
2 changes: 2 additions & 0 deletions
2
...tdata/pack_previous_fixtures_overrides/simple-layers-buildpack-different-sha_package.toml
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[buildpack] | ||
uri = "simple-layers-buildpack-different-sha.tgz" |
Oops, something went wrong.