Add jenkinsfile and makefiles to test it

This commit is contained in:
Sameer Rahmani 2021-01-15 18:28:36 +00:00
parent 09a6d92c08
commit e0c6960b6b
4 changed files with 46 additions and 19 deletions

23
Jenkinsfile vendored Normal file
View File

@ -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....'
}
}
}
}

View File

@ -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

13
bootstrap/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
FROM golang:1-alpine
LABEL maintainer="Sameer Rahmani <lxsameer@gnu.org>"
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"]

7
bootstrap/Makefile Normal file
View File

@ -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)