diff --git a/.github/workflows/docker-dev.yaml b/.github/workflows/docker-dev.yaml index 2ea0695..1180039 100644 --- a/.github/workflows/docker-dev.yaml +++ b/.github/workflows/docker-dev.yaml @@ -1,8 +1,11 @@ name: development docker on: push: - tags: - - '*' + branches: + - master + pull_request: + branches: + - master jobs: build: name: build and push @@ -15,10 +18,9 @@ jobs: run: docker build --tag pionwebrtc/ion-avp:latest-devel . - name: login + if: github.event_name == 'push' run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - name: tag - run: docker tag pionwebrtc/ion-avp:latest-devel pionwebrtc/ion-avp:"${{ github.event.release.tag_name }}"-devel - - name: push - run: docker push pionwebrtc/ion-avp:"${{ github.event.release.tag_name }}"-devel + if: github.event_name == 'push' + run: docker push pionwebrtc/ion-avp:latest-devel diff --git a/.github/workflows/docker-grpc.yaml b/.github/workflows/docker-grpc.yaml index fae7944..a796a78 100644 --- a/.github/workflows/docker-grpc.yaml +++ b/.github/workflows/docker-grpc.yaml @@ -1,8 +1,13 @@ name: grpc docker on: push: - tags: - - '*' + branches: + - master + release: + types: [published] + pull_request: + branches: + - master jobs: build: name: build and push @@ -10,15 +15,18 @@ jobs: timeout-minutes: 3 steps: - uses: actions/checkout@v2 - + - name: build run: docker build --tag pionwebrtc/ion-avp:latest-grpc -f cmd/server/grpc/Dockerfile . - name: login + if: github.event_name == 'release' run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - name: tag + if: github.event_name == 'release' run: docker tag pionwebrtc/ion-avp:latest-grpc pionwebrtc/ion-avp:"${{ github.event.release.tag_name }}"-grpc - name: push + if: github.event_name == 'release' run: docker push pionwebrtc/ion-avp:"${{ github.event.release.tag_name }}"-grpc diff --git a/cmd/server/grpc/Dockerfile b/cmd/server/grpc/Dockerfile new file mode 100644 index 0000000..8732b17 --- /dev/null +++ b/cmd/server/grpc/Dockerfile @@ -0,0 +1,24 @@ +FROM golang:1.14.8-stretch + +ENV GO111MODULE=on + +WORKDIR $GOPATH/src/github.com/pion/ion-avp + +COPY go.mod go.sum ./ +RUN cd $GOPATH/src/github.com/pion/ion-avp && go mod download + +COPY pkg/ $GOPATH/src/github.com/pion/ion-avp/pkg +COPY cmd/ $GOPATH/src/github.com/pion/ion-avp/cmd + +WORKDIR $GOPATH/src/github.com/pion/ion-avp/cmd/server/grpc +RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /avp . + +FROM alpine:3.12.0 + +RUN apk --no-cache add ca-certificates +COPY --from=0 /avp /usr/local/bin/avp + +COPY config.toml /configs/avp.toml + +ENTRYPOINT ["/usr/local/bin/avp"] +CMD ["-c", "/configs/avp.toml"] diff --git a/go.mod b/go.mod index ce4593d..81589a8 100644 --- a/go.mod +++ b/go.mod @@ -5,9 +5,9 @@ go 1.13 require ( github.com/at-wat/ebml-go v0.11.0 github.com/golang/protobuf v1.4.2 - github.com/pion/ion-sfu v1.0.6 + github.com/pion/ion-sfu v1.0.9 github.com/pion/rtp v1.6.0 - github.com/pion/webrtc/v3 v3.0.0-beta.4.0.20200902134452-789ff0975342 + github.com/pion/webrtc/v3 v3.0.0-beta.4.0.20200908143909-40eb1f2404c0 github.com/rs/zerolog v1.19.0 github.com/spf13/viper v1.7.1 google.golang.org/grpc v1.32.0 diff --git a/go.sum b/go.sum index 1b5a5b4..46e94d9 100644 --- a/go.sum +++ b/go.sum @@ -245,6 +245,8 @@ github.com/pion/ice/v2 v2.0.1 h1:uiWR6YOm6SaFAGET/fEdDsb+P67UD05Xig0sx0rP268= github.com/pion/ice/v2 v2.0.1/go.mod h1:e9mMZiQdz7f4uSp8umiOMa7JSAfmmtef3g4g29BkY5E= github.com/pion/ion-sfu v1.0.6 h1:LdYuKY4zj6M/72+bh3HpFo+TBVXtx8xrwcrkAWt7DT0= github.com/pion/ion-sfu v1.0.6/go.mod h1:fRetdp3x0yvCEaQvA9aZoJoea4UaWwpCS6iL+U/ZXJ4= +github.com/pion/ion-sfu v1.0.9 h1:BnEkpkd1JfT9o3p0h5w5c1msnLIzwECQz7LlIAViifQ= +github.com/pion/ion-sfu v1.0.9/go.mod h1:sxNFqdQZJWaujazY+HEmgPDsYBYXLP2PpFk2eUBcs4s= github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY= github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms= github.com/pion/mdns v0.0.4 h1:O4vvVqr4DGX63vzmO6Fw9vpy3lfztVWHGCQfyw0ZLSY= @@ -279,6 +281,7 @@ github.com/pion/udp v0.1.0 h1:uGxQsNyrqG3GLINv36Ff60covYmfrLoxzwnCsIYspXI= github.com/pion/udp v0.1.0/go.mod h1:BPELIjbwE9PRbd/zxI/KYBnbo7B6+oA6YuEaNE8lths= github.com/pion/webrtc/v3 v3.0.0-beta.4.0.20200902134452-789ff0975342 h1:Q4vocNHLyy8V8jeSPoqidX5IpJbbcrQAyRrEXmIx68U= github.com/pion/webrtc/v3 v3.0.0-beta.4.0.20200902134452-789ff0975342/go.mod h1:0OXkpoNfLp1pgvyu4zF3zkkoyj82LQEJCqnG9wQEc7o= +github.com/pion/webrtc/v3 v3.0.0-beta.4.0.20200908143909-40eb1f2404c0/go.mod h1:0OXkpoNfLp1pgvyu4zF3zkkoyj82LQEJCqnG9wQEc7o= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= diff --git a/scripts/release.sh b/scripts/release.sh deleted file mode 100755 index 5a8a69a..0000000 --- a/scripts/release.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -RE='[^0-9]*\([0-9]*\)[.]\([0-9]*\)[.]\([0-9]*\)\([0-9A-Za-z-]*\)' - -step="$1" -if [ -z "$1" ] -then - step=patch -fi - -base="$2" -if [ -z "$2" ] -then - base=$(git tag 2>/dev/null| tail -n 1) - if [ -z "$base" ] - then - base=0.0.0 - fi -fi - -MAJOR=`echo $base | sed -e "s#$RE#\1#"` -MINOR=`echo $base | sed -e "s#$RE#\2#"` -PATCH=`echo $base | sed -e "s#$RE#\3#"` - -case "$step" in - major) - let MAJOR+=1 - let MINOR=0 - let PATCH=0 - ;; - minor) - let MINOR+=1 - let PATCH=0 - ;; - patch) - let PATCH+=1 - ;; -esac - -next="v$MAJOR.$MINOR.$PATCH" -echo "$base -> $next" - -git commit --allow-empty -a -m "$next" -git tag $next -git push --atomic origin master $next \ No newline at end of file