Giter Site home page Giter Site logo

Comments (6)

ruslantalpa avatar ruslantalpa commented on May 13, 2024

there was something similar in the past, check if
this #17 and
https://docs.subzero.cloud/build-and-deploy-pipeline/
https://docs.subzero.cloud/circleci/config.yml helps

from postgrest-starter-kit.

trafgals avatar trafgals commented on May 13, 2024

#17 proposed that by pinning the Node version in CircleCI, things would work.
I tried adding this to package.json:

   "engines": {
    "node": "=11.10.0",
    "npm": "=6.7.0"
  },

but no good! Same error still occurs.

This is my first foray into JS, so I'm pretty lost.

from postgrest-starter-kit.

ruslantalpa avatar ruslantalpa commented on May 13, 2024

strange because I am doing the tests in some of my circleci configs and I am using the latest node image.

here is a sample (lots of private lines removed but you should get the idea of how I am doing it)

version: 2
jobs:
  pull_docker_images:
    docker:
      - image: circleci/node:latest
    steps:
      - restore_cache:
          keys:
          - v5-docker-images
      - setup_remote_docker
      - run:
          name: docker pull & save images for testing
          command: |            
            if [ ! -f ~/.docker/images.tar ]; then
              mkdir -p ~/.docker
              docker pull postgres
              docker pull lren/pgtap
              docker pull subzerocloud/postgrest
              docker pull openresty/openresty:jessie
              docker pull subzerocloud/amqptools
              docker save --output ~/.docker/images.tar \
                postgres \
                subzerocloud/postgrest \
                lren/pgtap \
                openresty/openresty:jessie \
                subzerocloud/amqptools
            fi
      - save_cache:
          paths:
            - ~/.docker
          key: v5-docker-images

  install_npm_dependencies:
    docker:
      - image: circleci/node:latest
    steps:
      - checkout
      - restore_cache:
          keys:
          - v2-npm-dependencies-{{ checksum "package.json" }}
      - run: npm install
      - save_cache:
          paths:
            - node_modules
          key: v2-npm-dependencies-{{ checksum "package.json" }}
  test:
    machine:
      enabled: true
    steps:
      - checkout
      - restore_cache:
          keys:
          - v5-docker-images
      - restore_cache:
          keys:
          - v2-npm-dependencies-{{ checksum "package.json" }}
      - run:
          name: load cached docker images
          command: |
            docker load --input ~/.docker/images.tar
      - run:
         name: bring up application stack
         command: |
            # echo manual | sudo tee /etc/init/postgresql.override
            # sudo service postgresql stop
            # while sudo lsof -Pi :5432 -sTCP:LISTEN -t; do sleep 1; done
            docker-compose up -d db postgrest openresty
            sleep 10
      - run:
          name: run tests
          command: npm test
  
  deploy:
    machine:
      enabled: true
    steps:
      - checkout
   
      - deploy:
          name: login to aws docker repo
          command: aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION | sh
         

  
workflows:
  version: 2
  build-and-deploy:
    jobs:
      - pull_docker_images:
          filters:
            tags:
              only: /v[0-9]+(\.[0-9]+)*/
      - install_npm_dependencies:
          filters:
            tags:
              only: /v[0-9]+(\.[0-9]+)*/
      - test:
          filters:
            tags:
              only: /v[0-9]+(\.[0-9]+)*/
          requires:
            - pull_docker_images
            - install_npm_dependencies
      - deploy:
          requires:
            - test
          filters:
            tags:
              only: /v[0-9]+(\.[0-9]+)*/
            branches:
              ignore: /.*/



from postgrest-starter-kit.

trafgals avatar trafgals commented on May 13, 2024

I don't understand what you changed but using the above it works now, whereas the one linked to by the subzero docs doesn't work.
You could add the config to the repository, so users can fork and get successful tests immediately. :)

from postgrest-starter-kit.

ruslantalpa avatar ruslantalpa commented on May 13, 2024

can you share the previous config that failed and it's log output and this new one that worked along with it's load output? I want to pinpoint the difference and understand what's going on

from postgrest-starter-kit.

ruslantalpa avatar ruslantalpa commented on May 13, 2024

could it be that somehow the config was goo but you had "bad cache" and you just needed to clear it (and it got cleared now because in the new config I used some other name to refer to the cache)?

from postgrest-starter-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.