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

Commit

Permalink
Merge fce1a29 into fc227cf
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ authored Sep 12, 2019
2 parents fc227cf + fce1a29 commit 8a94389
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
7 changes: 3 additions & 4 deletions capsule.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
engine_disable_cleanup: true

engine_enable_code_mutation: true
#- 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" cmd/capsulecd/capsulecd.go'

engine_cmd_compile:
- mkdir -p vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/
- cp /usr/local/linux/lib/pkgconfig/libgit2.pc vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/libgit2.pc
- '. /scripts/toolchains/linux/linux-build-env.sh && go build -ldflags "-X main.goos=linux -X main.goarch=amd64" -o capsulecd-linux-amd64 -tags "static" cmd/capsulecd/capsulecd.go'
# - 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" cmd/capsulecd/capsulecd.go'
- '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 ./...'
Expand Down
16 changes: 9 additions & 7 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG engine_type="golang"
FROM analogj/libgit2-crossbuild:linux-amd64-slim as base
FROM analogj/libgit2-xgo:slim as base

ARG go_version=1.10.8
ARG engine_type="golang"
Expand All @@ -10,30 +10,32 @@ 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 zlib1g-dev --no-install-recommends \
&& 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/* \
&& apt-get clean


ENV PATH="/go/bin:/usr/local/go/bin:${PATH}" \
GOPATH="/go:${GOPATH}" \
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
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"
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt


# install go and dep
RUN curl -fsSL "https://storage.googleapis.com/golang/go${go_version}.linux-amd64.tar.gz" | tar -xzC /usr/local \
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 \
&& curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh


COPY . .

## download deps & move libgit2 library into expected location.
RUN git --version \
&& 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 \
&& ./ci/test-build.sh ${engine_type}

##################################################
Expand Down
3 changes: 0 additions & 3 deletions pkg/mgr/mgr_golang_dep.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ func (m *mgrGolangDep) MgrDependenciesStep(currentMetadata interface{}, nextMeta
updatedEnv = append(updatedEnv, currentEnv[i])
}
}

print(updatedEnv)

if cerr := utils.BashCmdExec("dep ensure -v", m.PipelineData.GitLocalPath, updatedEnv, ""); cerr != nil {
return errors.EngineTestDependenciesError("dep ensure failed. Check dep dependencies")
}
Expand Down

0 comments on commit 8a94389

Please sign in to comment.