File tree Expand file tree Collapse file tree 3 files changed +46
-1
lines changed
Expand file tree Collapse file tree 3 files changed +46
-1
lines changed Original file line number Diff line number Diff line change 1+ version : 2
2+ jobs :
3+ build :
4+ machine :
5+ image : ubuntu-1604:201903-01
6+ working_directory : /home/circleci/go/src/github.com/docker-lvm-plugin
7+ steps :
8+ - checkout
9+ - run : make circleci
10+ - run : sudo make test
Original file line number Diff line number Diff line change 11# Installation Directories
22SYSCONFDIR ?=$(DESTDIR ) /etc/docker
33SYSTEMDIR ?=$(DESTDIR ) /usr/lib/systemd/system
4- GOLANG ?= /usr/bin/go
4+ ifndef $(GOLANG)
5+ GOLANG =$(shell which go)
6+ export GOLANG
7+ endif
58BINARY ?= docker-lvm-plugin
69MANINSTALLDIR? = ${DESTDIR}/usr/share/man
710BINDIR ?=$(DESTDIR ) /usr/libexec/docker
@@ -28,6 +31,10 @@ install:
2831 install -D -m 755 $(BINARY ) $(BINDIR ) /$(BINARY )
2932 install -D -m 644 docker-lvm-plugin.8 ${MANINSTALLDIR} /man8/docker-lvm-plugin.8
3033
34+ .PHONY : circleci
35+ circleci :
36+ ./tests/setup_circleci.sh
37+
3138.PHONY : test
3239test :
3340 ./tests/run_tests.sh
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ setup_circleci (){
6+ if [ " $CIRCLECI " = " true" ]; then
7+ sudo apt-get update
8+ sudo apt-get install -y make xfsprogs lvm2 go-md2man thin-provisioning-tools
9+
10+ # Remove default golang (1.10.3) and install a custom version (1.14.3) of golang.
11+ # This is required for supporting go mod, and to be able to compile docker-lvm-plugin.
12+ sudo rm -rf /usr/local/go
13+
14+ # Install golang 1.14.3
15+ curl -L -o go1.14.3.linux-amd64.tar.gz https://dl.google.com/go/go1.14.3.linux-amd64.tar.gz
16+ sudo tar -C /usr/local -xzf go1.14.3.linux-amd64.tar.gz
17+ sudo chmod +x /usr/local/go
18+ rm -f go1.14.3.linux-amd64.tar.gz
19+ make
20+ sudo make install
21+ sudo systemctl start docker-lvm-plugin
22+ # Sleep for 5 seconds, to allow docker-lvm-plugin to start completely.
23+ sleep 5s
24+ echo " INFO: Circleci setup successful."
25+ fi
26+ }
27+
28+ setup_circleci
You can’t perform that action at this time.
0 commit comments