Skip to content

Commit 6e956cd

Browse files
committed
initial commit
0 parents  commit 6e956cd

36 files changed

+2274
-0
lines changed

.codecov.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
coverage:
2+
status:
3+
patch: off
4+
project:
5+
default:
6+
# allow test coverage to drop by 2%
7+
threshold: 2

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Dockerfile
2+
dist

.gitignore

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
coverage.txt
8+
9+
# Test binary, built with `go test -c`
10+
*.test
11+
12+
# Output of the go coverage tool, specifically when used with LiteIDE
13+
*.out
14+
15+
# ides
16+
.vscode
17+
.idea
18+
19+
# Dependency directories (remove the comment below to include it)
20+
# vendor/
21+
dist/
22+
23+
# General
24+
.DS_Store
25+
.AppleDouble
26+
.LSOverride
27+
28+
# Icon must end with two \r
29+
Icon
30+
31+
32+
# Thumbnails
33+
._*
34+
35+
# Files that might appear in the root of a volume
36+
.DocumentRevisions-V100
37+
.fseventsd
38+
.Spotlight-V100
39+
.TemporaryItems
40+
.Trashes
41+
.VolumeIcon.icns
42+
.com.apple.timemachine.donotpresent
43+
44+
# Directories potentially created on remote AFP share
45+
.AppleDB
46+
.AppleDesktop
47+
Network Trash Folder
48+
Temporary Items
49+
.apdisk
50+
51+
# Windows thumbnail cache files
52+
Thumbs.db
53+
Thumbs.db:encryptable
54+
ehthumbs.db
55+
ehthumbs_vista.db
56+
57+
# Dump file
58+
*.stackdump
59+
60+
# Folder config file
61+
[Dd]esktop.ini
62+
63+
# Recycle Bin used on file shares
64+
$RECYCLE.BIN/
65+
66+
# Windows Installer files
67+
*.cab
68+
*.msi
69+
*.msix
70+
*.msm
71+
*.msp
72+
73+
# Windows shortcuts
74+
*.lnk
75+
76+
*~
77+
78+
# temporary files which can be created if a process still has a handle open of a deleted file
79+
.fuse_hidden*
80+
81+
# KDE directory preferences
82+
.directory
83+
84+
# Linux trash folder which might appear on any partition or disk
85+
.Trash-*
86+
87+
# .nfs files are created when an open file is removed but is still being accessed
88+
.nfs*
89+
90+
# mkdocs
91+
site
92+
93+
# codecov
94+
codecov.log

.golangci.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# This file contains all available configuration options
2+
# with their default values.
3+
4+
# options for analysis running
5+
run:
6+
# default concurrency is a available CPU number
7+
concurrency: 4
8+
9+
# timeout for analysis, e.g. 30s, 5m, default is 1m
10+
timeout: 1m
11+
12+
# exit code when at least one issue was found, default is 1
13+
issues-exit-code: 1
14+
15+
linters:
16+
enable:
17+
- gocyclo
18+
- errcheck
19+
- godox
20+
# all available settings of specific linters
21+
linters-settings:
22+
errcheck:
23+
# report about not checking of errors in type assertions: `a := b.(MyStruct)`;
24+
# default is false: such cases aren't reported by default.
25+
check-type-assertions: false
26+
27+
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
28+
# default is false: such cases aren't reported by default.
29+
check-blank: false
30+
31+
gocyclo:
32+
# minimal code complexity to report, 30 by default (but we recommend 10-20)
33+
min-complexity: 18

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
default_stages: [commit, push]
2+
repos:
3+
- repo: local
4+
hooks:
5+
- id: pre-comit
6+
name: pre-commit linting
7+
language: system
8+
entry: make pre-commit
9+
verbose: true
10+
stages: [ commit ]
11+
- id: pre-push
12+
name: pre-push testing
13+
language: system
14+
entry: make pre-push
15+
verbose: true
16+
stages: [ push ]

.readthedocs.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
formats: all
3+
mkdocs:
4+
fail_on_warning: false
5+
python:
6+
install:
7+
- requirements: docs/requirements.txt

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Changelog:

Dockerfile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
FROM golang:1.16.3-alpine3.13 as base
2+
3+
WORKDIR /go/src/github.com/codefresh-io/cli-v2
4+
5+
RUN apk -U add --no-cache git ca-certificates && update-ca-certificates
6+
7+
RUN adduser \
8+
--disabled-password \
9+
--gecos "" \
10+
--home "/home/codefresh" \
11+
--shell "/sbin/nologin" \
12+
--no-create-home \
13+
--uid 10001 \
14+
codefresh
15+
16+
COPY go.mod .
17+
COPY go.sum .
18+
19+
RUN go mod download -x
20+
RUN go mod verify
21+
22+
############################### CLI ###############################
23+
### Compile
24+
FROM golang:1.16.3-alpine3.13 as codefresh-build
25+
26+
WORKDIR /go/src/github.com/codefresh-io/cli-v2
27+
28+
RUN apk -U add --no-cache git make
29+
30+
COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
31+
COPY --from=base /go/pkg/mod /go/pkg/mod
32+
33+
COPY . .
34+
35+
ENV GOPATH /go
36+
ENV GOBIN /go/bin
37+
38+
RUN make local DEV_MODE=false
39+
40+
### Run
41+
FROM alpine:3.13 as codefresh
42+
43+
WORKDIR /go/src/github.com/codefresh-io/cli-v2
44+
45+
RUN apk -U add --no-cache git
46+
47+
# copy ca-certs and user details
48+
COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
49+
COPY --from=base /etc/passwd /etc/passwd
50+
COPY --from=base /etc/group /etc/group
51+
COPY --chown=codefresh:codefresh --from=codefresh-build /go/src/github.com/codefresh-io/cli-v2/dist/* /usr/local/bin/codefresh
52+
53+
USER codefresh:codefresh
54+
55+
ENTRYPOINT [ "cf" ]

0 commit comments

Comments
 (0)