Initial commit
continuous-integration/drone Build is passing
Details
continuous-integration/drone Build is passing
Details
commit
1a1d324bc8
@ -0,0 +1,28 @@
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- cron
|
||||
- custom
|
||||
- tag
|
||||
|
||||
steps:
|
||||
- name: build-builder
|
||||
image: plugins/docker
|
||||
settings:
|
||||
registry: registry.fk.jochum.dev
|
||||
username: robot$jo-micro+drone
|
||||
password:
|
||||
from_secret: registry.fk.jochum.dev-robot
|
||||
dockerfile: ./docker/builder/Dockerfile
|
||||
context: ./docker/builder/
|
||||
repo: registry.fk.jochum.dev/jo-micro/builder
|
||||
tags:
|
||||
- latest
|
@ -0,0 +1,6 @@
|
||||
SPDXVersion: SPDX-2.1
|
||||
DataLicense: CC0-1.0
|
||||
Creator: René Jochum (rene@jochum.dev)
|
||||
PackageName: git.jochum.dev/jo-micro/builder
|
||||
PackageOriginator: René Jochum
|
||||
PackageLicenseDeclared: Apache-2.0 OR GPL-2.0-or-later
|
@ -0,0 +1,14 @@
|
||||
# builder
|
||||
|
||||
Contains the Dockerfile to build a builder for other microservices.
|
||||
|
||||
## Authors
|
||||
|
||||
- René Jochum - rene@jochum.dev
|
||||
|
||||
## License
|
||||
|
||||
Its dual licensed:
|
||||
|
||||
- Apache-2.0
|
||||
- GPL-2.0-or-later
|
@ -0,0 +1,20 @@
|
||||
FROM registry.fk.jochum.dev/docker_hub_cache/library/golang:1.19
|
||||
|
||||
# Install packages
|
||||
RUN apt-get update --allow-releaseinfo-change && \
|
||||
apt-get --no-install-recommends --no-install-suggests --yes --quiet install \
|
||||
git-core ca-certificates make wget unzip && \
|
||||
cd /tmp && wget https://github.com/protocolbuffers/protobuf/releases/download/v21.5/protoc-21.5-linux-x86_64.zip && \
|
||||
unzip protoc-21.5-linux-x86_64.zip -d /usr/local/ && chmod +x /usr/local/bin/protoc
|
||||
|
||||
VOLUME [ "/code", "/go" ]
|
||||
|
||||
# RUN go mod download
|
||||
ENV GOPATH="/go"
|
||||
|
||||
# Install protoc-gen-go + protoc-gen-micro
|
||||
RUN cd /tmp; go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28; go install github.com/go-micro/generator/cmd/protoc-gen-micro@v1.0.0
|
||||
|
||||
WORKDIR /code
|
||||
|
||||
COPY ./scripts /scripts
|
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
find . -name '*.proto' -print0 | xargs -0 -I {} /bin/sh -c 'cd $(dirname $1); PATH=$PATH:/go/bin protoc --micro_out=paths=source_relative:. --go_out=paths=source_relative:. $(basename $1)' '_' '{}'
|
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
go mod tidy -go=1.19
|
||||
|
||||
for i in $(find . -name 'main.go'); do
|
||||
pushd $(dirname $i)
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go get -installsuffix cgo -ldflags="-w -s" -u ./...
|
||||
popd
|
||||
done
|
Loading…
Reference in New Issue