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

Commit

Permalink
handle nodejs.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Jul 23, 2017
1 parent 003e3ba commit 4fc14c0
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 15 deletions.
42 changes: 41 additions & 1 deletion ci/Dockerfile.node
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,44 @@
## Node
##
##################################################
FROM analogj/libgit2-crossbuild:linux-amd64 AS base
FROM analogj/libgit2-crossbuild:linux-amd64 AS base
FROM node AS node
MAINTAINER Jason Kulatunga <jason@thesparktree.com>

RUN apt-get update && apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
git \
curl \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g eslint \
&& npm install -g nsp

# Install GOLANG
ENV GO_VERSION 1.8.3
RUN curl -fsSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" \
| tar -xzC /usr/local

ENV PATH="/go/bin:/usr/local/go/bin:${PATH}" \
GOPATH="/go"

ENV 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"
RUN go get github.com/Masterminds/glide
COPY --from=base /usr/local/lib/libgit2/ /usr/local/lib/libgit2/
COPY --from=base /usr/local/lib/libssh2/ /usr/local/lib/libssh2/
COPY --from=base /usr/local/lib/openssl/ /usr/local/lib/openssl/

WORKDIR /go/src/capsulecd

COPY . .

## download glide deps & move libgit2 library into expected location.
RUN glide install \
&& mkdir -p /go/src/capsulecd/vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build \
&& cp -r /usr/local/lib/libgit2/lib/pkgconfig/. /go/src/capsulecd/vendor/gopkg.in/libgit2/git2go.v25/vendor/libgit2/build/

ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

CMD ci/coverage.sh
48 changes: 34 additions & 14 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
add go build-base bash curl \
&& rm -rf /var/cache/apk/*
mkdir -p /coverage
# Configure Go
mkdir -p ${GOPATH}/src ${GOPATH}/bin
Expand All @@ -32,39 +34,57 @@ jobs:
docker build -f ci/Dockerfile.base --tag analogj/capsulecd-build:base .
docker build -f ci/Dockerfile.chef --tag analogj/capsulecd-build:chef .
# docker build -f ci/Dockerfile.golang --tag analogj/capsulecd-build:golang .
# docker build -f ci/Dockerfile.node --tag analogj/capsulecd-build:node .
docker build -f ci/Dockerfile.node --tag analogj/capsulecd-build:node .
# docker build -f ci/Dockerfile.python --tag analogj/capsulecd-build:python .
# docker build -f ci/Dockerfile.ruby --tag analogj/capsulecd-build:ruby .
- run:
name: Run Docker containers with coverage
name: Run Base Docker containers with coverage
shell: bash
command: |
mkdir -p /coverage
echo "#################################################### BASE"
CAPSULECD_ENV=base
echo "#################################################### $CAPSULECD_ENV"
docker run -e "CI=true" \
--name base \
analogj/capsulecd-build:base \
./ci/coverage.sh base
analogj/capsulecd-build:$CAPSULECD_ENV \
./ci/coverage.sh $CAPSULECD_ENV
docker cp base:/coverage/coverage-base.txt /coverage
docker cp base:/coverage/coverage-$CAPSULECD_ENV.txt /coverage
- run:
name: Run Chef Docker containers with coverage
shell: bash
command: |
CAPSULECD_ENV=chef
echo "#################################################### $CAPSULECD_ENV"
docker run -e "CI=true" \
--name base \
analogj/capsulecd-build:$CAPSULECD_ENV \
./ci/coverage.sh $CAPSULECD_ENV
echo "#################################################### CHEF"
docker cp base:/coverage/coverage-$CAPSULECD_ENV.txt /coverage
- run:
name: Run Node Docker containers with coverage
shell: bash
command: |
CAPSULECD_ENV=node
echo "#################################################### $CAPSULECD_ENV"
docker run -e "CI=true" \
--name chef \
analogj/capsulecd-build:chef \
./ci/coverage.sh chef
--name base \
analogj/capsulecd-build:$CAPSULECD_ENV \
./ci/coverage.sh $CAPSULECD_ENV
docker cp chef:/coverage/coverage-chef.txt /coverage
docker cp base:/coverage/coverage-$CAPSULECD_ENV.txt /coverage
- run:
name: Merge coverage reports and submit
shell: bash
command: |
ls -alt /coverage
# upload to codecov.
bash <(curl -s https://codecov.io/bash) -f "*.txt" -s /coverage
# docker run -e "CI=true" -v /coverage:/tmp/coverage analogj/capsulecd-build:golang
# docker run -e "CI=true" -v /coverage:/tmp/coverage analogj/capsulecd-build:node
# docker run -e "CI=true" -v /coverage:/tmp/coverage analogj/capsulecd-build:python
# docker run -e "CI=true" -v /coverage:/tmp/coverage analogj/capsulecd-build:ruby

Expand Down
7 changes: 7 additions & 0 deletions cmd/capsulecd/capsulecd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ func main() {
Usage: "Start a new CapsuleCD package pipeline",
Action: func(c *cli.Context) error {

fmt.Println(`
___ __ ____ ____ _ _ __ ____ ___ ____
/ __) / _\ ( _ \/ ___)/ )( \( ) ( __)/ __)( \
( (__ / \ ) __/\___ \) \/ (/ (_/\ ) _)( (__ ) D (
\___)\_/\_/(__) (____/\____/\____/(____)\___)(____/`)


config, _ := config.Create()
config.Set("scm", c.String("scm"))
config.Set("package_type", c.String("package_type"))
Expand Down

0 comments on commit 4fc14c0

Please sign in to comment.