diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index abdf8c764472b0f6e3c427d81e08485bf8663198..47dedef38d02cfebe536048e3d445584ccbc3dbd 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -79,13 +79,14 @@ module Ci
 
       after_transition any => [:success] do |build|
         if build.environment.present?
-          service = CreateDeploymentService.new(build.project, build.user,
-                                                environment: build.environment,
-                                                sha: build.sha,
-                                                ref: build.ref,
-                                                tag: build.tag,
-                                                options: build.options[:environment],
-                                                variables: variables)
+          service = CreateDeploymentService.new(
+            build.project, build.user,
+            environment: build.environment,
+            sha: build.sha,
+            ref: build.ref,
+            tag: build.tag,
+            options: build.options[:environment],
+            variables: variables)
           service.execute(build)
         end
       end
diff --git a/lib/ci/api/entities.rb b/lib/ci/api/entities.rb
index 3f5bdaba3f5d0f757e23411ce83c72282fe54d52..66c05773b68451bbd438855369d385702f89afa6 100644
--- a/lib/ci/api/entities.rb
+++ b/lib/ci/api/entities.rb
@@ -15,6 +15,15 @@ module Ci
         expose :filename, :size
       end
 
+      class BuildOptions < Grape::Entity
+        expose :image
+        expose :services
+        expose :artifacts
+        expose :cache
+        expose :dependencies
+        expose :after_script
+      end
+
       class Build < Grape::Entity
         expose :id, :ref, :tag, :sha, :status
         expose :name, :token, :stage