Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run "devspace use space" command in CircleCI build #763

Closed
slevine111 opened this issue Oct 27, 2019 · 5 comments
Closed

Unable to run "devspace use space" command in CircleCI build #763

slevine111 opened this issue Oct 27, 2019 · 5 comments
Assignees
Labels
kind/bug Something isn't working p/high High priority will be done as soon as possible

Comments

@slevine111
Copy link

What happened?
When I try running the "devspace use space [name of space]" in a CircleCI build, I get an error. See below for my config.yml for CircleCI and the messages for successful devspace related commands (installing it and devspace login) and the error message for devspace use space

SuccessfulDevspaceSteps

DevspaceusespaceError

version: 2
jobs:
  build_and_deploy:
    docker:
      # specify the version you desire here
      - image: circleci/buildpack-deps:jessie

    steps:
      - checkout

      - run:
          name: put environment variables in secrets
          command: |
            POSTGRES_USER_ENCODED=$(echo $POSTGRES_USER | base64)
            POSTGRES_PASSWORD_ENCODED=$(echo $POSTGRES_PASSWORD | base64)
            REDIS_PASSWORD_ENCODED=$(echo $REDIS_PASSWORD | base64)
            JWT_SECRET_ENCODED=$(echo $JWT_SECRET | base64)
            jwt_secret_lines=$(echo $JWT_SECRET_ENCODED | tr " " "\n")
            sed -i "s/ENV-VAR-POSTGRES-USER/${POSTGRES_USER_ENCODED}/" ./k8s/secret.yaml
            sed -i "s/ENV-VAR-POSTGRES-PASSWORD/${POSTGRES_PASSWORD_ENCODED}/" ./k8s/secret.yaml
            sed -i "s/ENV-VAR-REDIS-PASSWORD/${REDIS_PASSWORD_ENCODED}/" ./k8s/secret.yaml
            for line in $jwt_secret_lines
            do
                sed -i "s/ENV-VAR-JWT-SECRET/${line}ENV-VAR-JWT-SECRET/" ./k8s/secret.yaml
            done
            sed -i "s/ENV-VAR-JWT-SECRET//" ./k8s/secret.yaml

      - run:
          name: install devspace
          command: |
            curl -s -L "https://github.com/devspace-cloud/devspace/releases/latest" |\
            sed -nE 's!.*"([^"]*devspace-linux-amd64)".*!https://github.com\1!p' | xargs -n 1 curl -L -o devspace && chmod +x devspace;
            sudo mv devspace /usr/local/bin;

      - run:
          name: devspace login
          command: devspace login --key ${DEVSPACE_CLOUD_ACCESS_KEY}

      - run:
          name: set up space to use
          command: devspace use space worldofchatting

      - run:
          name: deploy
          command: devspace deploy

  test:
    docker:
      # specify the version you desire here
      - image: circleci/buildpack-deps:jessie

    steps:
      - checkout
      - setup_remote_docker

      - run:
          name: build test image
          command: docker-compose build

      - run:
          name: test
          command: docker-compose run webserver npm run test

      - run:
          name: containers
          command: |
            docker container ls
            docker container ls -a

      - run:
          name: copy coverage file
          command: docker cp worldofchatting-webserver-test:/user/src/app/coverage-circleci ./coverage-circleci

      - run:
          name: check
          command: |
            pwd
            ls

      - store_artifacts:
          path: ./coverage-circleci

workflows:
  version: 2
  test_build_and_deploy:
    jobs:
      - test
      - build_and_deploy:
          requires:
            - test
          filters:
            branches:
              ignore: master

What did you expect to happen instead?
"devspace use space worldofchatting" to have run successfully, as it does when running it on my computer

How can we reproduce the bug? (as minimally and precisely as possible)

  1. create a CircleCI project
  2. create a devspace space
  3. create a config.yml with installing devspace, logging in, and then running "devspace use space [name of space]"

CircleCI Docker container

/kind bug

@FabianKramm FabianKramm self-assigned this Oct 28, 2019
@FabianKramm FabianKramm added kind/bug Something isn't working p/high High priority will be done as soon as possible labels Oct 28, 2019
@FabianKramm
Copy link
Collaborator

@slevine111 thanks for opening this issue! I will add a fix to this issue to the next release

@slevine111
Copy link
Author

@FabianKramm is the issue solved or did you reopen this b/c still working on it? thanks for the update

@FabianKramm
Copy link
Collaborator

@slevine111 issue is solved and in the current master, however there is currently no release including that fix. I will close this issue as soon as the release is out

@slevine111
Copy link
Author

@FabianKramm ok sounds good. Thanks for the update

@FabianKramm
Copy link
Collaborator

@slevine111 should be fixed in v4.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working p/high High priority will be done as soon as possible
Projects
None yet
Development

No branches or pull requests

2 participants