Skip to content
This repository has been archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
using xgo container again.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Sep 11, 2019
1 parent 02c0fd2 commit 4748b0b
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
31 changes: 23 additions & 8 deletions Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,37 @@
# Use `docker pull analogj/capsulecd:<language>`
#
###############################################################################
FROM analogj/libgit2-crossbuild:linux-amd64
FROM analogj/libgit2-xgo:slim
MAINTAINER Jason Kulatunga <jason@thesparktree.com>

ARG go_version=1.10.8
ARG engine_type="golang"


WORKDIR /go/src/github.com/analogj/capsulecd

ENV PATH="/go/src/github.com/analogj/capsulecd:/go/bin:${PATH}" \
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
git \
curl \
# Install build tooling.
RUN echo "go version: $go_version" \
&& apt-get update \
&& apt-get install -y gcc git build-essential binutils curl apt-transport-https ca-certificates pkg-config --no-install-recommends \
&& rm -rf /usr/share/doc && rm -rf /usr/share/man \
&& rm -rf /var/lib/apt/lists/* \
&& go get -u gopkg.in/alecthomas/gometalinter.v2 \
&& gometalinter.v2 --install \
&& apt-get clean


ENV PATH="/go/bin:/usr/local/go/bin:${PATH}" \
GOPATH="/go:${GOPATH}" \
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

# install go and dep
RUN which go || (curl -fsSL "https://storage.googleapis.com/golang/go${go_version}.linux-amd64.tar.gz" | tar -xzC /usr/local) \
&& mkdir -p /go/bin \
&& mkdir -p /go/src \
&& go get -u gopkg.in/alecthomas/gometalinter.v2 \
&& gometalinter.v2 --install \
&& curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh

COPY ./ci/capsulecd.sh /scripts/capsulecd.sh
Expand Down
11 changes: 6 additions & 5 deletions capsule.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---

## - cp /usr/local/osx-ndk-x86/macports/pkgs/opt/local/lib/pkgconfig/libgit2.pc vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/libgit2.pc
## - '. /scripts/toolchains/osx/osx-build-env.sh && go build -ldflags "-X main.goos=darwin -X main.goarch=amd64" -o capsulecd-darwin-amd64 -tags "static" $(go list ./cmd/...)'
engine_enable_code_mutation: true
engine_cmd_compile:
- mkdir -p vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/
- cp /usr/local/osx-ndk-x86/macports/pkgs/opt/local/lib/pkgconfig/libgit2.pc vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/libgit2.pc
- '. /scripts/toolchains/osx/osx-build-env.sh && go build -ldflags "-X main.goos=darwin -X main.goarch=amd64" -o capsulecd-darwin-amd64 -tags "static" $(go list ./cmd/...)'
- cp /usr/local/lib/libgit2/lib/pkgconfig/libgit2.pc vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/libgit2.pc
- 'export PKG_CONFIG_PATH="/usr/lib/pkgconfig/:/usr/local/lib/pkgconfig/:/usr/local/lib/libgit2/lib/pkgconfig:/usr/local/lib/openssl/lib/pkgconfig:/usr/local/lib/libssh2" && go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o capsulecd-linux-amd64 -tags "static" $(go list ./cmd/...)'
- '. /scripts/toolchains/linux/linux-build-env.sh && go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o capsulecd-linux-amd64 -tags "static" $(go list ./cmd/...)'
- 'echo "listing linked libraries" && ldd capsulecd-linux-amd64'
engine_cmd_test: 'go test -v -tags "static" ./...'
engine_cmd_lint: 'gometalinter.v2 --vendor --config=gometalinter.json ./...'
engine_disable_lint: true
Expand All @@ -16,5 +17,5 @@ scm_enable_branch_cleanup: true
scm_release_assets:
- local_path: capsulecd-linux-amd64
artifact_name: capsulecd-linux-amd64
# - local_path: capsulecd-darwin-amd64
# artifact_name: capsulecd-darwin-amd64
- local_path: capsulecd-darwin-amd64
artifact_name: capsulecd-darwin-amd64
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ WORKDIR /go/src/github.com/analogj/capsulecd
# Install build tooling.
RUN echo "go version: $go_version" \
&& apt-get update \
&& apt-get install -y gcc git build-essential binutils curl apt-transport-https ca-certificates pkg-config --no-install-recommends \
&& apt-get install -y gcc git build-essential binutils curl apt-transport-https ca-certificates pkg-config zlib1g-dev --no-install-recommends \
&& rm -rf /usr/share/doc && rm -rf /usr/share/man \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean
Expand Down
5 changes: 3 additions & 2 deletions ci/development.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ cd /go/src/github.com/analogj/capsulecd
rm -rf vendor
dep ensure

mkdir -p /go/src/github.com/analogj/capsulecd/vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build
cp -r /usr/local/lib/libgit2/lib/pkgconfig/. /go/src/github.com/analogj/capsulecd/vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/
mkdir -p vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/
cp -r /usr/local/linux/lib/pkgconfig/. /go/src/github.com/analogj/capsulecd/vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/
. /scripts/toolchains/linux/linux-build-env.sh


export DEV_MODE=true
Expand Down

0 comments on commit 4748b0b

Please sign in to comment.