Skip to content

Commit

Permalink
Merge pull request #252 from commerceblock/dpkg_build_update
Browse files Browse the repository at this point in the history
Fix debian builds
  • Loading branch information
paulius authored Oct 31, 2019
2 parents a2cc55f + 0b4d883 commit fd5f15e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
44 changes: 22 additions & 22 deletions contrib/docker/dpkg-build/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
FROM commerceblock/debbase:latest

ARG token
ENV GITHUB_RELEASE_ACCESS_TOKEN=$token
ARG repository
ENV GITHUB_RELEASE_REPOSITORY=$repository
ARG commit
ENV GITHUB_RELEASE_COMMIT=$commit
ARG tag
ENV GITHUB_RELEASE_TAG=$tag

RUN set -ex \
&& apt install -y jq \
&& export repo="repos/commerceblock/ocean/releases" \
&& export release_url="https://api.github.com/${repo}/latest" \
&& export id=$(curl -sH "Authorization: token ${token}" ${release_url} | jq .id) \
&& export tag_name=$(curl -sH "Authorization: token ${token}" ${release_url} | jq -r .tag_name) \
&& export upload_url="https://uploads.github.com/${repo}/${id}/assets?name=ocean-${tag_name}.deb" \
&& cd ocean \
&& git pull \
&& export gittag=$(git describe --tags --match '[0-9].[0-9].[0-9]*') \
&& export GITHUB_RELEASE_TAG=$gittag \
&& git checkout $gittag \
&& git checkout ${tag_name} \
&& ./autogen.sh \
&& ./configure --enable-glibc-back-compat \
--prefix=`pwd`/depends/x86_64-pc-linux-gnu \
LDFLAGS="-static-libstdc++" \
&& make \
&& mkdir -p ocean-$gittag/usr/local/bin \
&& cp src/oceand ocean-$gittag/usr/local/bin/ \
&& cp src/ocean-cli ocean-$gittag/usr/local/bin/ \
&& cp src/ocean-tx ocean-$gittag/usr/local/bin/ \
&& mkdir -p ocean-$gittag/DEBIAN \
&& make -j$(nproc) \
&& mkdir -p ocean-${tag_name}/usr/local/bin \
&& cp src/oceand ocean-${tag_name}/usr/local/bin/ \
&& cp src/ocean-cli ocean-${tag_name}/usr/local/bin/ \
&& cp src/ocean-tx ocean-${tag_name}/usr/local/bin/ \
&& mkdir -p ocean-${tag_name}/DEBIAN \
&& cp contrib/docker/dpkg-build/control \
ocean-$gittag/DEBIAN/ \
&& sed -i "s/Version: .*/Version: $gittag/" \
ocean-$gittag/DEBIAN/control \
&& dpkg-deb --build ocean-$gittag \
&& go run github-release/main.go "Debian package" \
ocean-$gittag.deb
ocean-${tag_name}/DEBIAN/ \
&& sed -i "s/Version: .*/Version: ${tag_name}/" \
ocean-${tag_name}/DEBIAN/control \
&& dpkg-deb --build ocean-${tag_name} \
&& curl -v -d @ocean-${tag_name}.deb \
-H "Content-Type: multipart/form-data" \
-H "Authorization: token $(echo $token)" \
-H "Content-Type: application/octet-stream" \
${upload_url}
2 changes: 1 addition & 1 deletion contrib/docker/dpkg-build/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ Section: base
Priority: optional
Architecture: amd64
Depends: libc6 (>= 2.27)
Maintainer: Martin Tsvetanov <[email protected]>
Maintainer: CommerceBlock
Description: oceand ocean-cli and ocean-tx binaries

0 comments on commit fd5f15e

Please sign in to comment.