Skip to content

Commit

Permalink
Merge pull request #337 from garden-io/pkg
Browse files Browse the repository at this point in the history
feat: experimental single-binary build via zeit/pkg
  • Loading branch information
edvald committed Oct 28, 2018
2 parents 1b1044e + 70aa3dc commit b86c463
Show file tree
Hide file tree
Showing 22 changed files with 4,078 additions and 3,348 deletions.
27 changes: 15 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,31 +65,34 @@ jobs:
- restore_cache:
keys:
- garden-service-{{ checksum "garden-service/package-lock.json" }}
# Install npm deps
- run: npm ci
- run: node_modules/.bin/lerna bootstrap --ci

- run: git submodule update --init --recursive

# only install if node_modules wasn't cached
- run: if [ ! -d "node_modules" ]; then npm ci; fi
- save_cache:
paths: [node_modules]
key: root-{{ checksum "package-lock.json" }}

- run: cd garden-service && npm install
- save_cache:
paths: [garden-service/node_modules]
key: garden-service-{{ checksum "garden-service/package-lock.json" }}

- run:
name: Make sure generated docs are up-to-date
command: |
npm run generate-docs
npm run check-docs
name: build
command: npm run ci-build

# build, lint and run tests
- run:
name: ci-build
command: npm run ci-build
name: Make sure generated docs are up-to-date
command: npm run check-docs

- run:
name: npm run lint
name: lint
command: npm run lint

- run:
name: npm test
name: test
command: npm run ci-test

workflows:
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ npm-debug.log*

# vendor dependencies
node_modules
vendor/
/vendor/

# IDEs
.idea
*.iml
/.vscode
/.vs
.vscode
.vs

# Runtime files
.garden
Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "garden-service/vendor/github.com/garden-io/javascript"]
path = garden-service/vendor/github.com/garden-io/javascript
url = git+ssh://git@github.com/garden-io/javascript
branch = fix-electron-issues
1 change: 1 addition & 0 deletions garden-service/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ gulpfile.ts
.gitignore
tsconfig.*
**/.garden
**/node_modules
22 changes: 11 additions & 11 deletions garden-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
FROM node:10.11.0-alpine

WORKDIR /project
ENTRYPOINT [ "garden" ]

# system dependencies
RUN apk add --no-cache \
bash \
Expand All @@ -14,27 +11,30 @@ RUN apk add --no-cache \
&& curl -L https://storage.googleapis.com/kubernetes-helm/helm-v2.11.0-linux-amd64.tar.gz | tar xvz --strip-components=1 -C /usr/local/bin linux-amd64/helm \
&& chmod +x /usr/local/bin/helm \
&& helm init --client-only \
&& curl -L -o /usr/local/bin/stern "https://github.com/wercker/stern/releases/download/1.8.0/stern_linux_amd64" \
&& chmod +x /usr/local/bin/stern \
&& curl -L -o /usr/local/bin/faas-cli "https://github.com/openfaas/faas-cli/releases/download/0.7.3/faas-cli" \
&& chmod +x /usr/local/bin/faas-cli \
&& curl -L -o /usr/local/bin/kubectl "https://storage.googleapis.com/kubernetes-release/release/v1.11.3/bin/linux/amd64/kubectl" \
&& chmod +x /usr/local/bin/kubectl

WORKDIR /garden

# npm dependencies
ADD scripts /garden/scripts
ADD vendor /garden/vendor
ADD package.json package-lock.json /garden/

RUN apk add --no-cache --virtual .deps \
python2 \
make \
g++ \
&& cd /garden && npm install --production \
&& apk del .deps
# npm screws up the preinstall script, so we need to run it manually
RUN ./scripts/installVendorDeps.sh && \
npm install --production --ignore-scripts && \
npm cache clean --force

# garden code
ADD bin /garden/bin
ADD build /garden/build
ADD static /garden/static

WORKDIR /project
ENTRYPOINT [ "garden" ]

RUN ln -s /garden/static/bin/garden /bin/garden \
&& chmod +x /bin/garden
13 changes: 0 additions & 13 deletions garden-service/bin/build-pkg.sh

This file was deleted.

16 changes: 0 additions & 16 deletions garden-service/bin/garden

This file was deleted.

Loading

0 comments on commit b86c463

Please sign in to comment.