This repository was archived by the owner on May 19, 2020. It is now read-only.
File tree 1 file changed +17
-10
lines changed 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -12,26 +12,33 @@ Drone plugin to clone `git` repositories. For the usage information and a listin
12
12
13
13
## Build
14
14
15
- Build the binary with the following commands :
15
+ Build the binary with the following command :
16
16
17
- ```
18
- go build
17
+ ``` console
18
+ export GOOS=linux
19
+ export GOARCH=amd64
20
+ export CGO_ENABLED=0
21
+ export GO111MODULE=on
22
+
23
+ go build -v -a -tags netgo -o release/linux/amd64/drone-git
19
24
```
20
25
21
26
## Docker
22
27
23
- Build the Docker image with the following commands :
28
+ Build the Docker image with the following command :
24
29
25
- ```
26
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -o release/linux/amd64/drone-git
27
- docker build --rm -t plugins/git .
30
+ ``` console
31
+ docker build \
32
+ --label org.label-schema.build-date=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
33
+ --label org.label-schema.vcs-ref=$(git rev-parse --short HEAD) \
34
+ --file docker/Dockerfile.linux.amd64 --tag plugins/git .
28
35
```
29
36
30
37
## Usage
31
38
32
39
Clone a commit:
33
40
34
- ```
41
+ ``` console
35
42
docker run --rm \
36
43
-e DRONE_REMOTE_URL=https://github.com/garyburd/redigo.git \
37
44
-e DRONE_WORKSPACE=/go/src/github.com/garyburd/redigo \
@@ -43,7 +50,7 @@ docker run --rm \
43
50
44
51
Clone a pull request:
45
52
46
- ```
53
+ ``` console
47
54
docker run --rm \
48
55
-e DRONE_REMOTE_URL=https://github.com/garyburd/redigo.git \
49
56
-e DRONE_WORKSPACE=/go/src/github.com/garyburd/redigo \
@@ -55,7 +62,7 @@ docker run --rm \
55
62
56
63
Clone a tag:
57
64
58
- ```
65
+ ``` console
59
66
docker run --rm \
60
67
-e DRONE_REMOTE_URL=https://github.com/garyburd/redigo.git \
61
68
-e DRONE_WORKSPACE=/go/src/github.com/garyburd/redigo \
You can’t perform that action at this time.
0 commit comments