Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc65a71d

Browse files
authored
Merge pull request#238 from video-dev/post-migration
Post-migration updates & Drone migration
2 parents2976483 +1e7b3ca commitc65a71d

File tree

13 files changed

+425
-261
lines changed

13 files changed

+425
-261
lines changed

‎.dockerignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.git

‎.travis.yml‎

Lines changed: 0 additions & 44 deletions
This file was deleted.

‎Dockerfile‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM golang:1.12.7-alpine AS build
2+
3+
ARG GOPROXY=https://proxy.golang.org
4+
5+
ENV CGO_ENABLED 0
6+
WORKDIR /code
7+
ADD . ./
8+
RUN go install
9+
10+
FROM alpine:3.10.1
11+
RUN apk add --no-cache ca-certificates
12+
COPY --from=build /go/bin/video-transcoding-api /usr/bin/video-transcoding-api
13+
ENTRYPOINT ["/usr/bin/video-transcoding-api"]

‎Makefile‎

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
.PHONY: all testdeps lint test gotest build run
1+
.PHONY: all testdeps lintrunlinttest gotest coverage gocoverage build run
22

33
HTTP_PORT ?= 8080
44
LOG_LEVEL ?= debug
5-
CI_TAG ?=$(shell git describe --tags$(shell git rev-list --tags --max-count=1))
65

76
all: test
87

98
testdeps:
109
GO111MODULE=off go get github.com/golangci/golangci-lint/cmd/golangci-lint
1110
go mod download
1211

13-
lint: testdeps
12+
lint: testdeps runlint
13+
14+
runlint:
1415
golangci-lint run\
1516
--enable-all\
1617
-D errcheck\
@@ -24,16 +25,18 @@ lint: testdeps
2425
-D unparam\
2526
--deadline 5m ./...
2627

27-
gotest: testdeps
28-
gotest ./...
28+
gotest:
29+
gotest -vet=all -mod=readonly$(GO_TEST_EXTRA_FLAGS) ./...
30+
31+
test: lint testdeps gotest
2932

30-
test: lintgotest
33+
coverage: lintgocoverage
3134

32-
coverage: lint
33-
gotest-coverprofile=coverage.txt -covermode=atomic ./...
35+
gocoverage:
36+
make gotest GO_TEST_EXTRA_FLAGS="-coverprofile=coverage.txt -covermode=atomic"
3437

3538
build:
36-
go build
39+
go build -mod=readonly
3740

3841
run: build
3942
HTTP_PORT=$(HTTP_PORT) APP_LOG_LEVEL=$(LOG_LEVEL) ./video-transcoding-api

‎README.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
#Video Transcoding API
44

5-
[![Build Status](https://travis-ci.org/nytimes/video-transcoding-api.svg?branch=master)](https://travis-ci.org/nytimes/video-transcoding-api)
6-
[![codecov](https://codecov.io/gh/nytimes/video-transcoding-api/branch/master/graph/badge.svg)](https://codecov.io/gh/nytimes/video-transcoding-api)
7-
[![Go Report Card](https://goreportcard.com/badge/github.com/nytimes/video-transcoding-api)](https://goreportcard.com/report/github.com/nytimes/video-transcoding-api)
5+
[![Build Status](https://cloud.drone.io/api/badges/video-dev/video-transcoding-api/status.svg)](https://cloud.drone.io/video-dev/video-transcoding-api)
6+
[![codecov](https://codecov.io/gh/video-dev/video-transcoding-api/branch/master/graph/badge.svg)](https://codecov.io/gh/video-dev/video-transcoding-api)
7+
[![Go Report Card](https://goreportcard.com/badge/github.com/video-dev/video-transcoding-api)](https://goreportcard.com/report/github.com/video-dev/video-transcoding-api)
88

99
The Video Transcoding API provides an agnostic API to transcode media assets
1010
across different cloud services. Currently, it supports the following
@@ -126,7 +126,7 @@ With all environment variables set and redis up and running, clone this
126126
repository and run:
127127

128128
```
129-
$ git clone https://github.com/NYTimes/video-transcoding-api.git
129+
$ git clone https://github.com/video-dev/video-transcoding-api.git
130130
$ make run
131131
```
132132

@@ -139,7 +139,7 @@ $ make test
139139
##Using the API
140140

141141
Check out on our Wiki[how
142-
to](https://github.com/NYTimes/video-transcoding-api/wiki/Using-Video-Transcoding-API)
142+
to](https://github.com/video-dev/video-transcoding-api/wiki/Using-Video-Transcoding-API)
143143
use this API.
144144

145145
##Contributing
@@ -153,7 +153,7 @@ use this API.
153153
##License
154154

155155
- This code is under[Apache 2.0
156-
license](https://github.com/NYTimes/video-transcoding-api/blob/master/LICENSE).
156+
license](https://github.com/video-dev/video-transcoding-api/blob/master/LICENSE).
157157
- The video-transcoding-api logo is a variation on the Go gopher that was
158158
designed by Renee French and copyrighted under the[Creative Commons
159159
Attribution 3.0 license](https://creativecommons.org/licenses/by/3.0/).

‎bin/build‎

Lines changed: 0 additions & 25 deletions
This file was deleted.

‎bump.sh‎

Lines changed: 0 additions & 70 deletions
This file was deleted.

‎drone/.drone.jsonnet‎

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
// the first version is used to build the binary that gets shipped to Docker Hub.
2+
local go_versions = ['1.12.7','1.11.12','1.13beta1'];
3+
4+
local test_dockerfile = {
5+
name:'test-dockerfile',
6+
image:'plugins/docker',
7+
settings: {
8+
repo:'videodev/video-transcoding-api',
9+
dry_run:true,
10+
},
11+
when: {
12+
event: ['push','pull_request'],
13+
},
14+
depends_on: ['clone'],
15+
};
16+
17+
local push_to_dockerhub = {
18+
name:'build-and-push-to-dockerhub',
19+
image:'plugins/docker',
20+
settings: {
21+
repo:'videodev/video-transcoding-api',
22+
auto_tag:true,
23+
dockerfile:'drone/Dockerfile',
24+
username: {from_secret:'docker_username' },
25+
password: {from_secret:'docker_password' },
26+
},
27+
when: {
28+
ref: [
29+
'refs/tags/*',
30+
'refs/heads/master',
31+
],
32+
},
33+
depends_on: ['coverage','lint','build'],
34+
};
35+
36+
local goreleaser = {
37+
name:'goreleaser',
38+
image:'goreleaser/goreleaser',
39+
commands: [
40+
'git fetch --tags',
41+
'goreleaser release',
42+
],
43+
environment: {
44+
GITHUB_TOKEN: {
45+
from_secret:'github_token',
46+
},
47+
},
48+
depends_on: ['coverage','lint'],
49+
when: {
50+
event: ['tag'],
51+
},
52+
};
53+
54+
local release_steps = [
55+
test_dockerfile,
56+
push_to_dockerhub,
57+
goreleaser,
58+
];
59+
60+
local mod_download(go_version) = {
61+
name:'mod-download',
62+
image:'golang:%(go_version)s' % {go_version: go_version },
63+
commands: ['go mod download'],
64+
environment: {GOPROXY:'https://proxy.golang.org' },
65+
depends_on: ['clone'],
66+
};
67+
68+
// TODO(fsouza): run redis as a service in Drone. This actually requires a
69+
// change to our test suite, because it requires Redis to be running on
70+
// localhost and that's not how Drone works.
71+
local coverage(go_version) = {
72+
name:'coverage',
73+
image:'golang:%(go_version)s' % {go_version: go_version },
74+
commands: [
75+
'apt update',
76+
'apt install -y redis-server',
77+
'redis-server &>/dev/null &',
78+
'timeout 10 sh -c "while ! redis-cli ping; do echo waiting for redis-server to start; sleep 1; done"',
79+
'make gocoverage',
80+
],
81+
depends_on: ['mod-download'],
82+
};
83+
84+
local lint = {
85+
name:'lint',
86+
image:'golangci/golangci-lint',
87+
pull:'always',
88+
commands: ['make runlint'],
89+
depends_on: ['mod-download'],
90+
};
91+
92+
local build(go_version) = {
93+
name:'build',
94+
image:'golang:%(go_version)s' % {go_version: go_version },
95+
commands: ['make build'],
96+
environment: {CGO_ENABLED:'0' },
97+
depends_on: ['mod-download'],
98+
};
99+
100+
local coverage_report = {
101+
name:'codecov-report',
102+
image:'golang',
103+
commands: ['curl -s https://codecov.io/bash | bash'],
104+
depends_on: ['coverage'],
105+
};
106+
107+
local test_ci_dockerfile = {
108+
name:'test-ci-dockerfile',
109+
image:'plugins/docker',
110+
settings: {
111+
repo:'videodev/video-transcoding-api',
112+
dockerfile:'drone/Dockerfile',
113+
dry_run:true,
114+
},
115+
when: {
116+
event: ['pull_request'],
117+
},
118+
depends_on: ['build'],
119+
};
120+
121+
local pipeline(go_version) = {
122+
kind:'pipeline',
123+
name:'go-%(go_version)s' % {go_version: go_version },
124+
workspace: {
125+
base:'/go',
126+
path:'video-transcoding-api',
127+
},
128+
steps: [
129+
mod_download(go_version),
130+
coverage(go_version),
131+
coverage_report,
132+
lint,
133+
build(go_version),
134+
test_ci_dockerfile,
135+
] +if go_version == go_versions[0]then release_stepselse [],
136+
};
137+
138+
std.map(pipeline, go_versions)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp