add circleci config and update makefile for ci
This commit is contained in:
parent
3b378e2f3d
commit
d8f1665dc6
11
.circleci/config.yml
Normal file
11
.circleci/config.yml
Normal file
@ -0,0 +1,11 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
machine: true
|
||||
steps:
|
||||
- checkout
|
||||
- run: make dist
|
||||
- store_artifacts:
|
||||
path: output
|
||||
- run: echo "$DOCKER_PASS" | docker login --username $DOCKER_USER --password-stdin
|
||||
- run: make ci-upload-images
|
28
Makefile
28
Makefile
@ -1,7 +1,27 @@
|
||||
default: build
|
||||
APPNAME := docker-linux-vm
|
||||
IMAGENAME := sneak/$(APPNAME)
|
||||
BUILDTIMEFILENAME := $(shell date -u '+%Y%m%d-%H%M%SZ')
|
||||
|
||||
build:
|
||||
docker build -t sneak/docker-linux-vm .
|
||||
default: build-docker-image
|
||||
|
||||
run:
|
||||
docker run -ti sneak/docker-linux-vm
|
||||
docker run -ti $(IMAGENAME)
|
||||
|
||||
dist: build-docker-image
|
||||
-mkdir -p ./output
|
||||
docker save $(IMAGENAME) | bzip2 > output/$(BUILDTIMEFILENAME).$(APPNAME).tbz2
|
||||
|
||||
hub: upload-docker-image
|
||||
|
||||
build-docker-image:
|
||||
docker build -t $(IMAGENAME) .
|
||||
|
||||
upload-docker-image: build-docker-image
|
||||
docker tag $(IMAGENAME) $(IMAGENAME):$(BUILDTIMETAG)
|
||||
docker push $(IMAGENAME):$(BUILDTIMETAG)
|
||||
|
||||
ci-upload-images:
|
||||
docker tag $(IMAGENAME) $(IMAGENAME):$(CIRCLE_SHA1)
|
||||
docker tag $(IMAGENAME) $(IMAGENAME):$(CIRCLE_BRANCH)
|
||||
docker push $(IMAGENAME):$(CIRCLE_SHA1)
|
||||
docker push $(IMAGENAME):$(CIRCLE_BRANCH)
|
||||
|
Reference in New Issue
Block a user