diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f6c30eb --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,23 @@ +pipeline { + agent docker + + stages { + stage('Build') { + steps { + sh("make build") + echo 'Building..' + sh("make clean") + } + } + stage('Test') { + steps { + echo 'Testing..' + } + } + stage('Deploy') { + steps { + echo 'Deploying....' + } + } + } +} \ No newline at end of file diff --git a/Makefile b/Makefile index cbecf97..271c55f 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,8 @@ THIS_DIR=$(dir $(realpath $(firstword $(MAKEFILE_LIST)))) -.PHONY: lint -lint: - cd $(THIS_DIR)/bootstrap && cargo fmt -- --check +include $(THIS_DIR)/bootstrap/Makefile -.PHONY: test-bootstrap -test-bootstrap: - cd $(THIS_DIR)/bootstrap && cargo test +.PHONY: compile +compile: compile-bootstrap -.PHONY: test -test: test-bootstrap - - -.PHONY: clean-bootstrap -clean-bootstrap: - cd $(THIS_DIR)/bootstrap && cargo clean - -.PHONY: bootstrap-repl -bootstrap-repl: - cd $(THIS_DIR)/bootstrap && cargo run repl - -.PHONY: clean clean: clean-bootstrap diff --git a/bootstrap/Dockerfile b/bootstrap/Dockerfile new file mode 100644 index 0000000..54d1f1c --- /dev/null +++ b/bootstrap/Dockerfile @@ -0,0 +1,13 @@ +FROM golang:1-alpine +LABEL maintainer="Sameer Rahmani " + +RUN mkdir -p /usr/src/serene +WORKDIR /usr/src/serene + +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +# Build the Go app +RUN go build -v ./serene.go + +CMD ["./serene"] diff --git a/bootstrap/Makefile b/bootstrap/Makefile new file mode 100644 index 0000000..cf18950 --- /dev/null +++ b/bootstrap/Makefile @@ -0,0 +1,7 @@ +BOOTSTRAP_TAG ?= latest + +compile-bootstrap: + docker build -t serene-lang/serene-bootstrap:$(BOOTSTRAP_TAG) . + +clean-bootstrap: + docker rmi serene-lang/serene-bootstrap:$(BOOTSTRAP_TAG)