Skip to content

Commit

Permalink
feat: add makefile
Browse files Browse the repository at this point in the history
Signed-off-by: wangyizhi1 <wangyizhi1@cmss.chinamobile.com>
  • Loading branch information
wangyizhi1 committed Oct 9, 2023
1 parent bf3d70b commit 97f9b9a
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/ci-test.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM alpine:3.17.1

ARG BINARY

RUN apk add --no-cache ca-certificates
RUN apk update && apk upgrade
RUN apk add ip6tables iptables curl tcpdump busybox-extras

COPY ${BINARY} /bin/${BINARY}
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CGO_ENABLED:=0
GOOS?=linux
GOARCH?=amd64
VERSION?=1.0.0
REGISTRY?="ghcr.io/wangyizhi1"
BINARY:=citest

.PHONY: binary
binary:
CGO_ENABLED=$(CGO_ENABLED) GOOS=${GOOS} GOARCH=${GOARCH} go build -v -o $(BINARY)

.PHONY: image
image: binary
set -e;\
docker buildx build --output=type=docker --platform ${GOOS}/${GOARCH} --tag ${REGISTRY}/citest:v${VERSION} .
Binary file added citest
Binary file not shown.
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module wangyizhi.io/ci-test

go 1.21.0
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "fmt"

func main() {
fmt.Println("ci-test")
}

0 comments on commit 97f9b9a

Please sign in to comment.