-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add working CI setup * rename the project to gangplank * fix dockerfile build and tests * use golang image for goreleaser * fix goreleaser docker build * push docker image * reset docker image push to auto
- Loading branch information
1 parent
9454972
commit cf0edcb
Showing
39 changed files
with
802 additions
and
518 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 |
---|---|---|
@@ -0,0 +1,103 @@ | ||
# Copyright 2017-present SIGHUP s.r.l | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
kind: pipeline | ||
type: docker | ||
name: main | ||
|
||
steps: | ||
- name: prepare | ||
image: quay.io/sighup/golang:1.22.1 | ||
commands: | ||
- mkdir -p .go/cache .go/modcache .go/tmp | ||
- go mod download | ||
environment: | ||
GOCACHE: /drone/src/.go/cache | ||
GOMODCACHE: /drone/src/.go/modcache | ||
GOTMPDIR: /drone/src/.go/tmp | ||
depends_on: | ||
- clone | ||
|
||
- name: check-license | ||
image: quay.io/sighup/golang:1.22.1 | ||
pull: always | ||
commands: | ||
- make license-check | ||
environment: | ||
GOCACHE: /drone/src/.go/cache | ||
GOMODCACHE: /drone/src/.go/modcache | ||
GOTMPDIR: /drone/src/.go/tmp | ||
depends_on: | ||
- prepare | ||
|
||
- name: build | ||
image: quay.io/sighup/golang:1.22.1 | ||
commands: | ||
- make build | ||
environment: | ||
GOCACHE: /drone/src/.go/cache | ||
GOMODCACHE: /drone/src/.go/modcache | ||
GOTMPDIR: /drone/src/.go/tmp | ||
GITHUB_TOKEN: | ||
from_secret: GITHUB_TOKEN | ||
volumes: | ||
- name: dockersock | ||
path: /var/run/docker.sock | ||
depends_on: | ||
- check-license | ||
|
||
- name: release | ||
image: quay.io/sighup/golang:1.22.1 | ||
commands: | ||
- ./scripts/drone/install-cosign.sh | ||
- mkdir -p /root/.docker | ||
- printf "%s" "$DOCKER_CONFIG_JSON" > /root/.docker/config.json | ||
- git reset --hard | ||
- git fetch --tags | ||
- make release | ||
environment: | ||
GOCACHE: /drone/src/.go/cache | ||
GOMODCACHE: /drone/src/.go/modcache | ||
GOTMPDIR: /drone/src/.go/tmp | ||
GITHUB_TOKEN: | ||
from_secret: GITHUB_TOKEN | ||
DOCKER_CONFIG_JSON: | ||
from_secret: DOCKERCONFIGJSON_UCS | ||
COSIGN_KEY: | ||
from_secret: COSIGN_KEY | ||
COSIGN_PWD: | ||
from_secret: COSIGN_PASSWORD | ||
volumes: | ||
- name: dockersock | ||
path: /var/run/docker.sock | ||
depends_on: | ||
- check-license | ||
when: | ||
ref: | ||
include: | ||
- refs/tags/v** | ||
|
||
volumes: | ||
- name: dockersock | ||
host: | ||
path: /var/run/docker.sock | ||
|
||
trigger: | ||
event: | ||
exclude: | ||
- pull_request | ||
- promote | ||
ref: | ||
exclude: | ||
- refs/tags/helm-chart-v** |
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,8 +1 @@ | ||
*.swp | ||
*.swo | ||
config.yml | ||
/gangway | ||
vendor/ | ||
cmd/gangway/bindata.go | ||
.idea/ | ||
gangway.kubeconfig | ||
dist/ |
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,63 @@ | ||
# Copyright 2017-present SIGHUP s.r.l | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
project_name: gangplank | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
goos: | ||
- linux | ||
main: ./cmd/gangplank | ||
|
||
archives: | ||
- name_template: "{{ tolower .ProjectName }}-{{ tolower .Os }}-{{ tolower .Arch }}" | ||
|
||
checksum: | ||
name_template: checksums.txt | ||
|
||
snapshot: | ||
name_template: "{{ incpatch .Version }}-develop" | ||
|
||
changelog: | ||
filters: | ||
exclude: | ||
- "^docs:" | ||
- "^test:" | ||
sort: asc | ||
|
||
release: | ||
github: | ||
owner: sighupio | ||
name: gangplank | ||
name_template: "{{ .Tag }}" | ||
prerelease: auto | ||
|
||
dockers: | ||
- dockerfile: ./Dockerfile | ||
extra_files: | ||
- ./ | ||
image_templates: | ||
- "registry.sighup.io/fury/gangplank:latest" | ||
- "registry.sighup.io/fury/gangplank:v{{ .Major }}" | ||
- "registry.sighup.io/fury/gangplank:v{{ .Major }}.{{ .Minor }}" | ||
- "registry.sighup.io/fury/gangplank:{{ .Tag }}" | ||
skip_push: auto |
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 +1,3 @@ | ||
golang 1.22.0 | ||
golang 1.22.1 | ||
make 4.4.1 | ||
goreleaser 1.24.0 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,15 +1,35 @@ | ||
FROM golang:1.14.2-stretch | ||
WORKDIR /go/src/github.com/heptiolabs/gangway | ||
# Copyright 2017-present SIGHUP s.r.l | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
FROM golang:1.22.1-alpine as dev | ||
|
||
ENV CGO_ENABLED=0 | ||
|
||
WORKDIR /src | ||
|
||
RUN go get -u github.com/mjibson/esc/... | ||
COPY . . | ||
RUN esc -o cmd/gangway/bindata.go templates/ | ||
|
||
ENV GO111MODULE on | ||
RUN go mod verify | ||
RUN CGO_ENABLED=0 GOOS=linux go install -ldflags="-w -s" -v github.com/heptiolabs/gangway/... | ||
RUN go mod download | ||
|
||
ENTRYPOINT [ "go", "run", "./cmd/gangplank" ] | ||
|
||
FROM dev as builder | ||
|
||
RUN go build ./cmd/gangplank | ||
|
||
FROM scratch | ||
|
||
COPY --from=builder /src/gangplank /usr/local/bin/gangplank | ||
|
||
FROM debian:9.12-slim | ||
RUN apt-get update && apt-get install -y ca-certificates | ||
USER 1001:1001 | ||
COPY --from=0 /go/bin/gangway /bin/gangway | ||
ENTRYPOINT ["gangplank"] |
Oops, something went wrong.