Merge pull request #2 from yardstick/feature/QUANT-987-solver-service-container

QUANT-987: Solver service container
This commit is contained in:
brmnjsh 2021-08-11 13:18:01 -04:00 committed by GitHub
commit 9cbe38140d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 1 deletions

25
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,25 @@
def label = "docker-${UUID.randomUUID().toString()}"
podTemplate(label: label, inheritFrom: 'base') {
node(label) {
stage('Checkout Repository') {
container('base') {
checkout scm
}
}
stage('Login to Dockerhub') {
withCredentials([usernamePassword(credentialsId: 'DockerHubAccessYardstick', usernameVariable: 'USER', passwordVariable: 'PASS')]) {
container('base') {
sh "docker login --username ${USER} --password ${PASS}"
}
}
}
stage('Build Docker image') {
container('base') {
sh "make display full branch=${BRANCH_NAME}"
}
}
}
}

View File

@ -0,0 +1,31 @@
.PHONY: help
# from https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n\n", $$1, $$2}'
repo=yardstick
project=measure-solver
branch=$(shell git rev-parse --abbrev-ref HEAD)
tag=$(shell echo $(branch) | grep -Eo 'feature/([A-Za-z]+-[0-9]*)' | grep -Eo '[A-Za-z]+-[0-9]*' || \
echo $(branch) | grep -Eo '(release|hotfix)/[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' | grep -Eo '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+' || \
echo $(branch) | grep -Eo 'QUANT-([[:digit:]]*)')
full: build push
build: ## build the production dockerfile
@if [[ -n "$(tag)" ]]; then \
echo "$(tag)" > docker_tag.txt; \
docker build -t $(repo)/$(project):$(tag) .; \
else \
echo "Nothing to build."; \
fi
push: ## push the production dockerfile
@if [[ -n "$(tag)" ]]; then \
docker push $(repo)/$(project):$(tag); \
else \
echo "Nothing to push."; \
fi
display: ## display the tag/branch values for development testing
@echo "branch: $(branch)"
@echo "tag: $(tag)"

View File

@ -1 +1 @@
0.1 QUANT-987