Compare commits

...
Author SHA1 Message Date
Alex Goodman 5519a25035 dont add signing artifact (#802)
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2022-02-07 17:03:09 +00:00
Alex Goodman 950ad681a0 Stabilize CI behavior (#796)
* reduce parallelism of builds and increase install.sh test setup buffer

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* change logging mechanism for signing

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* restore automatic parallelism determination for goreleaser

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* rm logging goreleaser version

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2022-02-07 07:55:11 -08:00
Keith Zantow 1e338502ff Update SPDX license list (#801) 2022-02-07 15:24:08 +00:00
Alex Goodman 37251f6179 Fix intermittent slow CLI tests (#797)
* use a port that is porbably not in use

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>

* template cli test args

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
2022-02-06 15:53:55 +00:00
6 changed files with 52 additions and 44 deletions
+10 -13
View File
@@ -6,6 +6,7 @@ IS_SNAPSHOT="$1"
## grab utilities
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. "$SCRIPT_DIR"/utils.sh
mkdir -p "$SCRIPT_DIR/log"
main() {
@@ -33,17 +34,13 @@ main() {
echo -n "$MAC_SIGNING_IDENTITY" > "$SCRIPT_DIR/$SIGNING_IDENTITY_FILENAME"
}
set +u
if [ -z "$SCRIPT" ]
then
# capture all output from a subshell to log output additionally to a file (as well as the terminal)
( (
set +u
if [ -n "$SKIP_SIGNING" ]; then
commentary "skipping signing setup..."
else
set -u
# log all output
mkdir -p "$SCRIPT_DIR/log"
/usr/bin/script "$SCRIPT_DIR/log/setup.txt" /bin/bash -c "$0 $*"
exit $?
elif [ -n "$SKIP_SIGNING" ]; then
commentary "skipping signing setup..."
else
set -u
main
fi
main
fi
) 2>&1) | tee "$SCRIPT_DIR/log/setup.txt"
+10 -13
View File
@@ -7,6 +7,7 @@ IS_SNAPSHOT="$2"
## grab utilities
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
. "$SCRIPT_DIR"/utils.sh
mkdir -p "$SCRIPT_DIR/log"
# sign_binary [binary-path] [signing-identity]
@@ -124,17 +125,13 @@ main() {
fi
}
set +u
if [ -z "$SCRIPT" ]
then
# capture all output from a subshell to log output additionally to a file (as well as the terminal)
( (
set +u
if [ -n "$SKIP_SIGNING" ]; then
commentary "skipping signing setup..."
else
set -u
# log all output
mkdir -p "$SCRIPT_DIR/log"
/usr/bin/script "$SCRIPT_DIR/log/signing-$(basename $ARCHIVE_PATH).txt" /bin/bash -c "$0 $*"
exit $?
elif [ -n "$SKIP_SIGNING" ]; then
commentary "skipping signing..."
else
set -u
main
fi
main
fi
) 2>&1) | tee "$SCRIPT_DIR/log/signing-$(basename $ARCHIVE_PATH).txt"
-1
View File
@@ -71,7 +71,6 @@ signs:
- artifacts: archive
ids:
- darwin-archives
signature: "${artifact}"
cmd: ./.github/scripts/apple-signing/sign.sh
args:
- "${artifact}"
+12 -2
View File
@@ -1,9 +1,9 @@
// Code generated by go generate; DO NOT EDIT.
// This file was generated by robots at 2021-11-15 14:32:22.081911 -0500 EST m=+0.159302107
// This file was generated by robots at 2022-02-07 09:34:56.622482 -0500 EST m=+0.351558414
// using data from https://spdx.org/licenses/licenses.json
package spdxlicense
const Version = "3.15"
const Version = "3.16"
var licenseIDs = map[string]string{
"0bsd": "0BSD",
@@ -64,6 +64,7 @@ var licenseIDs = map[string]string{
"apl-1": "APL-1.0",
"apl-1.0": "APL-1.0",
"apl-1.0.0": "APL-1.0",
"app-s2p": "App-s2p",
"apsl-1": "APSL-1.0",
"apsl-1.0": "APSL-1.0",
"apsl-1.0.0": "APSL-1.0",
@@ -399,6 +400,9 @@ var licenseIDs = map[string]string{
"d-fsl-1.0": "D-FSL-1.0",
"d-fsl-1.0.0": "D-FSL-1.0",
"diffmark": "diffmark",
"dl-de-by-2": "DL-DE-BY-2.0",
"dl-de-by-2.0": "DL-DE-BY-2.0",
"dl-de-by-2.0.0": "DL-DE-BY-2.0",
"doc": "DOC",
"dotseqn": "Dotseqn",
"drl-1": "DRL-1.0",
@@ -422,6 +426,9 @@ var licenseIDs = map[string]string{
"efl-2.0": "EFL-2.0",
"efl-2.0.0": "EFL-2.0",
"egenix": "eGenix",
"elastic-2": "Elastic-2.0",
"elastic-2.0": "Elastic-2.0",
"elastic-2.0.0": "Elastic-2.0",
"entessa": "Entessa",
"epics": "EPICS",
"epl-1": "EPL-1.0",
@@ -596,6 +603,7 @@ var licenseIDs = map[string]string{
"ipl-1.0": "IPL-1.0",
"ipl-1.0.0": "IPL-1.0",
"isc": "ISC",
"jam": "Jam",
"jasper-2": "JasPer-2.0",
"jasper-2.0": "JasPer-2.0",
"jasper-2.0.0": "JasPer-2.0",
@@ -909,6 +917,7 @@ var licenseIDs = map[string]string{
"sax-pd": "SAX-PD",
"saxpath": "Saxpath",
"scea": "SCEA",
"schemereport": "SchemeReport",
"sendmail": "Sendmail",
"sendmail-8": "Sendmail-8.23",
"sendmail-8.23": "Sendmail-8.23",
@@ -1007,6 +1016,7 @@ var licenseIDs = map[string]string{
"wtfpl": "WTFPL",
"wxwindows": "wxWindows",
"x11": "X11",
"x11-distribute-modifications-variant": "X11-distribute-modifications-variant",
"xerox": "Xerox",
"xfree86-1": "XFree86-1.1",
"xfree86-1.1": "XFree86-1.1",
+19 -14
View File
@@ -1,6 +1,7 @@
package cli
import (
"fmt"
"strings"
"testing"
)
@@ -201,6 +202,10 @@ func TestPackagesCmdFlags(t *testing.T) {
}
func TestRegistryAuth(t *testing.T) {
host := "localhost:17"
image := fmt.Sprintf("%s/something:latest", host)
args := []string{"packages", "-vv", fmt.Sprintf("registry:%s", image)}
tests := []struct {
name string
args []string
@@ -209,55 +214,55 @@ func TestRegistryAuth(t *testing.T) {
}{
{
name: "fallback to keychain",
args: []string{"packages", "-vv", "registry:localhost:5000/something:latest"},
args: args,
assertions: []traitAssertion{
assertInOutput("source=OciRegistry"),
assertInOutput("localhost:5000/something:latest"),
assertInOutput(image),
assertInOutput("no registry credentials configured, using the default keychain"),
},
},
{
name: "use creds",
args: []string{"packages", "-vv", "registry:localhost:5000/something:latest"},
args: args,
env: map[string]string{
"SYFT_REGISTRY_AUTH_AUTHORITY": "localhost:5000",
"SYFT_REGISTRY_AUTH_AUTHORITY": host,
"SYFT_REGISTRY_AUTH_USERNAME": "username",
"SYFT_REGISTRY_AUTH_PASSWORD": "password",
},
assertions: []traitAssertion{
assertInOutput("source=OciRegistry"),
assertInOutput("localhost:5000/something:latest"),
assertInOutput(`using basic auth for registry "localhost:5000"`),
assertInOutput(image),
assertInOutput(fmt.Sprintf(`using basic auth for registry "%s"`, host)),
},
},
{
name: "use token",
args: []string{"packages", "-vv", "registry:localhost:5000/something:latest"},
args: args,
env: map[string]string{
"SYFT_REGISTRY_AUTH_AUTHORITY": "localhost:5000",
"SYFT_REGISTRY_AUTH_AUTHORITY": host,
"SYFT_REGISTRY_AUTH_TOKEN": "token",
},
assertions: []traitAssertion{
assertInOutput("source=OciRegistry"),
assertInOutput("localhost:5000/something:latest"),
assertInOutput(`using token for registry "localhost:5000"`),
assertInOutput(image),
assertInOutput(fmt.Sprintf(`using token for registry "%s"`, host)),
},
},
{
name: "not enough info fallsback to keychain",
args: []string{"packages", "-vv", "registry:localhost:5000/something:latest"},
args: args,
env: map[string]string{
"SYFT_REGISTRY_AUTH_AUTHORITY": "localhost:5000",
"SYFT_REGISTRY_AUTH_AUTHORITY": host,
},
assertions: []traitAssertion{
assertInOutput("source=OciRegistry"),
assertInOutput("localhost:5000/something:latest"),
assertInOutput(image),
assertInOutput(`no registry credentials configured, using the default keychain`),
},
},
{
name: "allows insecure http flag",
args: []string{"packages", "-vv", "registry:localhost:5000/something:latest"},
args: args,
env: map[string]string{
"SYFT_REGISTRY_INSECURE_USE_HTTP": "true",
},
+1 -1
View File
@@ -94,7 +94,7 @@ setup_snapshot_server() {
worker_pid=$!
# it takes some time for the server to be ready...
sleep 0.5
sleep 3
echo "$worker_pid"
}