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

bundle exec kuby -e production deploy #26

Closed
StoneCX opened this issue Oct 14, 2020 · 7 comments
Closed

bundle exec kuby -e production deploy #26

StoneCX opened this issue Oct 14, 2020 · 7 comments

Comments

@StoneCX
Copy link

StoneCX commented Oct 14, 2020

error: 403: Forbidden

can't figures out what's wrong

@camertron
Copy link
Member

Hey @StoneCX, thanks for reaching out. I'm going to need more information in order to help figure out what's wrong. Can you post your kuby.rb config? What cloud provider are you using?

@StoneCX
Copy link
Author

StoneCX commented Oct 14, 2020

require 'active_support/core_ext'
require 'active_support/encrypted_configuration'
require 'kuby/digitalocean'

# Define a production Kuby deploy environment
Kuby.define('Payment0928') do
  environment(:production) do
    # Because the Rails environment isn't always loaded when
    # your Kuby config is loaded, provide access to Rails
    # credentials manually.
    app_creds = ActiveSupport::EncryptedConfiguration.new(
      config_path: File.join('config', 'credentials.yml.enc'),
      key_path: File.join('config', 'master.key'),
      env_key: 'RAILS_MASTER_KEY',
      raise_if_missing_key: true
    )

    docker do
      # Configure your Docker registry credentials here. Add them to your
      # Rails credentials file by running `bundle exec rake credentials:edit`.
      credentials do
        username app_creds[:KUBY_DOCKER_USERNAME]
        password app_creds[:KUBY_DOCKER_PASSWORD]
        email app_creds[:KUBY_DOCKER_EMAIL]
      end

      distro :alpine
      # Configure the URL to your Docker image here, eg:
      # image_url 'foo.bar.com/me/myproject'
      #
      # If you're using Gitlab's Docker registry, try something like this:
      image_url 'registry.gitlab.com/stonecx/kubytry'
    end

    kubernetes do
      # Add a plugin that facilitates deploying a Rails app.
      add_plugin :rails_app do
        hostname 'treenewbee.store'
        # configure database credentials
        database do
          user app_creds[:KUBY_DB_USER]
          password app_creds[:KUBY_DB_PASSWORD]
        end
      end

      # Use Docker Desktop as the provider.
      # See: https://www.docker.com/products/docker-desktop
      #
      # Note: you will likely want to use a different provider when deploying
      # your application into a production environment. To configure a different
      # provider, add the corresponding gem to your gemfile and update the
      # following line according to the provider gem's README.
      provider :digitalocean do
        # access_token app_creds[:DIGITALOCEAN_ACCESS_TOKEN]
        access_token '619b95491622f80486.....'
        cluster_id 'cf7979c3-50d9-41......'
      end
    end
  end
end

thanks

@camertron
Copy link
Member

Everything looks good in your config. I do see that you're using Gitlab's Docker registry though, so I think I might know what's going on. Gitlab requires you to use a personal access or deploy token instead of your password. Here's a link to their documentation that explains how to create a token. I'll add something to Kuby's documentation as well, since I'm sure this will happen to other people.

@camertron
Copy link
Member

Hey @StoneCX, were you able to get things working?

@StoneCX
Copy link
Author

StoneCX commented Oct 20, 2020

I havn't try ,will telling you if I try

@lazyatom
Copy link
Contributor

It's possible that this is related to #40 -- if you ever ran kuby in the past for the same provider but with different credentials, kuby may be used an old configuration.

@camertron
Copy link
Member

@StoneCX I'm going to close this for now. If you have any additional info, please comment here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants