Skip to content

Commit a1750cb

Browse files
CR-10360 -- security fixes (#733)
* CR-10360 -- security fixes * fix linter errors * fix Dockerfile * update node version + update pkg + update binary node version + update node-tester-image * check another image * fix node-tester-image * fix test * Revert "fix test" This reverts commit 4e9349b. * fix test * fix jq * fix docker file * update version * add small e2e tests * fix * rearrange e2e * refactor e2e tests * fix * add docker ignore for e2e
1 parent 42ac97a commit a1750cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1669
-975
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ codefresh.yml
1212
.coveralls.yml
1313
examples
1414
dist
15+
e2e

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# go hub binary
22
FROM golang:alpine as go
33
RUN apk --update add ca-certificates git
4-
RUN go get github.com/github/hub
4+
RUN go install github.com/github/hub@latest
55

66
# python yq binary
77
FROM six8/pyinstaller-alpine:alpine-3.6-pyinstaller-v3.4 as yq
@@ -11,9 +11,9 @@ RUN pip install yq==${YQ_VERSION}
1111
RUN pyinstaller --noconfirm --onefile --log-level DEBUG --clean --distpath /tmp/ $(which yq)
1212

1313
# Main
14-
FROM node:10.23.0-alpine3.11
14+
FROM node:12.22.11-alpine3.15
1515

16-
RUN apk --update add --no-cache ca-certificates git curl bash yarn jq=1.6-r0
16+
RUN apk --update add --no-cache ca-certificates git curl bash jq
1717

1818
COPY --from=go /go/bin/hub /usr/local/bin/hub
1919
COPY --from=yq /tmp/yq /usr/local/bin/yq
@@ -31,7 +31,6 @@ RUN yarn install --prod --frozen-lockfile && \
3131
COPY . /cf-cli
3232

3333
RUN yarn generate-completion
34-
RUN apk del yarn
3534

3635
RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
3736

codefresh.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,30 @@ steps:
1212

1313
install_dependencies:
1414
title: 'Installing testing dependencies'
15-
image: codefresh/node-tester-image:10.15.3
15+
image: quay.io/codefresh/node-tester-image:12.21.0
1616
commands:
1717
- yarn install --frozen-lockfile
1818

19-
eslint:
20-
title: 'Running linting logic'
21-
image: codefresh/node-tester-image:10.15.3
22-
commands:
23-
- yarn eslint
19+
parallel_tests:
20+
type: parallel
21+
steps:
22+
eslint:
23+
title: 'Running linting logic'
24+
image: quay.io/codefresh/node-tester-image:12.21.0
25+
commands:
26+
- yarn eslint
2427

25-
unit-tests:
26-
title: 'Running unit tests'
27-
image: codefresh/node-tester-image:10.15.3
28-
commands:
29-
- yarn test
28+
unit-tests:
29+
title: 'Running unit tests'
30+
image: quay.io/codefresh/node-tester-image:12.21.0
31+
commands:
32+
- yarn test
33+
34+
e2e-tests:
35+
title: 'Running e2e tests'
36+
image: quay.io/codefresh/node-tester-image:12.21.0
37+
commands:
38+
- yarn e2e
3039

3140
extract_version:
3241
title: "Exporting package.json version"

e2e/e2e.spec.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# fail if one of the commands returns non-zero code
2+
set -e
3+
set -o pipefail
4+
5+
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd)
6+
CODEFRESH_PATH="$SCRIPT_DIR/../lib/interface/cli/codefresh"
7+
8+
echo "Using $CODEFRESH_PATH"
9+
function codefresh() {
10+
$CODEFRESH_PATH $@
11+
}
12+
13+
codefresh version
14+
echo
15+
16+
for executable in $SCRIPT_DIR/scenarios/*.sh
17+
do
18+
source $executable > "$executable.log" &
19+
echo "[$!] Executing: $executable"
20+
done
21+
echo
22+
23+
for job in `jobs -p`
24+
do
25+
echo "Waiting for $job..."
26+
wait $job || exit 1
27+
done
28+
29+
echo
30+
echo "All tests executed successfully!"

e2e/scenarios/agents.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
codefresh get agents

e2e/scenarios/annotations.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
echo "Skipping annotation.sh"
2+
#codefresh get annotation

e2e/scenarios/boards.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
codefresh get boards
2+
echo "Skipping sections.sh"
3+
#codefresh get sections

e2e/scenarios/builds.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
codefresh get builds

e2e/scenarios/clusters.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
codefresh get clusters

e2e/scenarios/compositions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
codefresh get compositions

0 commit comments

Comments
 (0)