diff --git a/Dockerfile b/Dockerfile index 118c991..8254ce1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,9 @@ RUN apt-get update && \ apt-get -y install nodejs && \ apt-get -y clean -COPY . /build-window +RUN gem install bundler +RUN mkdir /build-window +COPY ./Gemfile /build-window +RUN cd /build-window && bundle install WORKDIR /build-window - -RUN bundle install diff --git a/README.md b/README.md index 8487e68..ccdf00f 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ See https://github.com/Smashing/smashing/wiki for more details. ### Authentication -Place your API credentials in a `.env` file at the root of the project. (Please note that authentication is currently only supported for Go CD and Jenkins.) Example: +Place your API credentials in a `.env` file at the root of the project. (Please note that authentication is currently only supported for Go CD, Jenkins and TeamCity.) Example: #### Go @@ -63,6 +63,11 @@ JENKINS_USER=user JENKINS_TOKEN=password ``` +#### TeamCity + + TEAM_CITY_USER=user + TEAM_CITY_PASSWORD=password + ## Different Base URLs If you have multiple build servers of the same type you'd like to keep an eye on you can specify the `baseUrl` for each build: diff --git a/config.ru b/config.ru index bea70f9..2c4f331 100644 --- a/config.ru +++ b/config.ru @@ -21,7 +21,13 @@ end if Builds::BUILD_CONFIG['teamCityBaseUrl'] require 'teamcity' TeamCity.configure do |config| - config.endpoint = Builds::BUILD_CONFIG['teamCityBaseUrl'] + '/app/rest?guest=1' + if ENV['TEAM_CITY_USER'] + config.endpoint = Builds::BUILD_CONFIG['teamCityBaseUrl'] + '/app/rest' + config.http_user = ENV['TEAM_CITY_USER'] + config.http_password = ENV['TEAM_CITY_PASSWORD'] + else + config.endpoint = Builds::BUILD_CONFIG['teamCityBaseUrl'] + '/app/rest?guest=1' + end end end diff --git a/docker-compose.yml b/docker-compose.yml index bdd34e9..98c3694 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,11 @@ -build-window: - build: . - ports: - - "3030:3030" - - "3031:3031" - command: smashing start +version: "3" +services: + build-window: + build: . + image: rouanw/build-window:latest + volumes: + - .:/build-window + ports: + - "3030:3030" + - "3031:3031" + command: smashing start