-
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 basic functionalities support. ci: Add pipeline to push docker image and Dockerfile for kube deployment
- Loading branch information
Showing
21 changed files
with
3,946 additions
and
0 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,67 @@ | ||
--- | ||
name: 'build container images' | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Prepare | ||
id: prep | ||
run: | | ||
DOCKER_IMAGE=quay.io/mudler/containerbay | ||
VERSION=latest | ||
SHORTREF=${GITHUB_SHA::8} | ||
# If this is git tag, use the tag name as a docker tag | ||
if [[ $GITHUB_REF == refs/tags/* ]]; then | ||
VERSION=${GITHUB_REF#refs/tags/} | ||
fi | ||
TAGS="${DOCKER_IMAGE}:${VERSION},${DOCKER_IMAGE}:${SHORTREF}" | ||
# If the VERSION looks like a version number, assume that | ||
# this is the most recent version of the image and also | ||
# tag it 'latest'. | ||
if [[ $VERSION =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then | ||
TAGS="$TAGS,${DOCKER_IMAGE}:latest" | ||
fi | ||
# Set output parameters. | ||
echo ::set-output name=tags::${TAGS} | ||
echo ::set-output name=docker_image::${DOCKER_IMAGE} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.DOCKER_RELEASE_USERNAME }} | ||
password: ${{ secrets.DOCKER_RELEASE_PASSWORD }} | ||
|
||
- name: Build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: ${{ steps.prep.outputs.tags }} | ||
- name: Build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
builder: ${{ steps.buildx.outputs.name }} | ||
context: website | ||
file: ./website/Dockerfile | ||
push: true | ||
tags: quay.io/mudler/containerbay:website |
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,26 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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 @@ | ||
containerbay |
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,38 @@ | ||
builds: | ||
- ldflags: | ||
- -w -s | ||
- -X github.com/mudler/containerbay/internal.Version={{.Tag}} | ||
- -X github.com/mudler/containerbay/internal.Commit={{.Commit}} | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
- arm | ||
- 386 | ||
- arm64 | ||
source: | ||
enabled: true | ||
name_template: '{{ .ProjectName }}-{{ .Tag }}-source' | ||
archives: | ||
# Default template uses underscores instead of - | ||
- name_template: "{{ .ProjectName }}-{{ .Tag }}-{{ .Os }}-{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" | ||
replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
checksum: | ||
name_template: '{{ .ProjectName }}-{{ .Tag }}-checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- '^Merge pull request' |
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,10 @@ | ||
FROM golang as builder | ||
RUN apt-get update && apt-get install -y upx | ||
ADD . /containerbay | ||
RUN cd /containerbay && CGO_ENABLED=0 go build | ||
|
||
FROM scratch | ||
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=builder /containerbay/containerbay /usr/bin/containerbay | ||
|
||
ENTRYPOINT ["/usr/bin/containerbay"] |
Oops, something went wrong.