Skip to content
Snippets Groups Projects
meteor-kubernetes.yml 1.26 KiB
Newer Older
include:
Marco's avatar
Marco committed
  - project: gitlab-ci/kubernetes-base
Marco's avatar
Marco committed
    ref: v5
Marco's avatar
Marco committed
    file: panter-kubernetes-base.yml

app-build:
  extends: .app-build
  script:
    - cd $APP_PATH
    - echo "add healthcheck package"
    - meteor add panter:healthroute --allow-superuser
    - meteor add qualia:prod-shell --allow-superuser
    - echo "current path is $(pwd)"
    - yarn
    - echo "building into $CI_PROJECT_DIR"
    - TOOL_NODE_FLAGS="--max_old_space_size=3072 --min_semi_space_size=8 --max_semi_space_size=256" --optimize_for_size meteor build $CI_PROJECT_DIR --architecture os.linux.x86_64 --allow-superuser --server-only --directory
Marco's avatar
Marco committed
  artifacts:
    paths:
      - $CI_PROJECT_DIR/bundle

.ensureDocker: &ensureDocker |
  function ensureDockerfile() {
    # this is for meteor
      
    if [ ! -f Dockerfile ]; then
      echo "Creating Dockerfile"
      NODE_VERSION_FULL=$(cat bundle/.node_version.txt)
      NODE_VERSION=${NODE_VERSION_FULL/v} # remove v
      
      cat > Dockerfile <<EOF
  FROM node:$NODE_VERSION
  ADD . /src
  RUN cd /src && rm -rf node_modules
  RUN cd /src/bundle/programs/server && npm install

  WORKDIR /src/bundle
  EXPOSE 8888
  CMD ["node", "main.js"]
  EOF

    fi

  }

docker-build:
Marco's avatar
Marco committed
  extends: .docker-build
  before_script:
Marco's avatar
Marco committed
    - *ensureDocker
    - ensureDockerfile