Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Cloud Config Server + BitBucket

I'm trying to get Spring Cloud's Config Server setup with a BitBucket private repository and haven't had any luck. No matter what configuration I use, I always seem to get a 404 returned when trying to load a configuration.

I've also tried setting breakpoints in JGitEnvironmentRepository but it never seems to get called outside of afterPropertiesSet. If I manually triggering the findOne(application,profile,label) while debugging, I get an error that Branch name <null> not allowed. If I specify "master" for label property, then I get the dreaded Ref master cannot be resolved error.

The app loads fine but no results. From all the documentation I've read, it seems like this should work out of the box. Any help would be appreciated.

bootstrap.yml

server:
  port: 8888

spring:
  application:
    name: config-service
  cloud:
    bus.amqp.enabled: false
    config:
      enabled: false
      failFast: true
      server:
        prefix: /configs
        git :
          uri: https://bitbucket.org/[team]/[repo].git
          username: [user]
          password: [pass]

Repo files

- demo.app.yml

Attempted URL

http://localhost:8888/configs/demo.app

like image 510
David Welch Avatar asked Oct 20 '22 07:10

David Welch


1 Answers

  1. you need to add a profile name to the url. The default profile is 'default'. http://localhost:8888/configs/demo.app/default

  2. this only works with the 1.0.0.RELEASE version to me, but with the 1.0.1.RELEASE version I found a problem on Windows (there is a problem with the file separators so the config server didn't find the YAML files in the local cloned repository). Maybe this is the related issue: Spring Cloud Config | Git Based | Not working on windows machine

like image 164
Tyutyutyu Avatar answered Oct 22 '22 01:10

Tyutyutyu