Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
5e9687a1
Commit
5e9687a1
authored
Jun 01, 2018
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add deploy_strategy to ProjectAutoDevops
parent
2de002b3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
1 deletion
+24
-1
app/models/project_auto_devops.rb
app/models/project_auto_devops.rb
+5
-0
db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb
...80601213245_add_deploy_strategy_to_project_auto_devops.rb
+15
-0
db/schema.rb
db/schema.rb
+2
-1
spec/models/project_auto_devops_spec.rb
spec/models/project_auto_devops_spec.rb
+2
-0
No files found.
app/models/project_auto_devops.rb
View file @
5e9687a1
class
ProjectAutoDevops
<
ActiveRecord
::
Base
belongs_to
:project
enum
deploy_strategy:
{
manual:
1
,
continuous:
2
}
scope
:enabled
,
->
{
where
(
enabled:
true
)
}
scope
:disabled
,
->
{
where
(
enabled:
false
)
}
...
...
db/migrate/20180601213245_add_deploy_strategy_to_project_auto_devops.rb
0 → 100644
View file @
5e9687a1
# See http://doc.gitlab.com/ce/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class
AddDeployStrategyToProjectAutoDevops
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
# Set this constant to true if this migration requires downtime.
DOWNTIME
=
false
def
change
change_table
:project_auto_devops
do
|
t
|
t
.
integer
:deploy_strategy
,
null:
false
,
default:
0
end
end
end
db/schema.rb
View file @
5e9687a1
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
20180
529093006
)
do
ActiveRecord
::
Schema
.
define
(
version:
20180
601213245
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -1490,6 +1490,7 @@ ActiveRecord::Schema.define(version: 20180529093006) do
t
.
datetime_with_timezone
"updated_at"
,
null:
false
t
.
boolean
"enabled"
t
.
string
"domain"
t
.
integer
"deploy_strategy"
,
default:
0
,
null:
false
end
add_index
"project_auto_devops"
,
[
"project_id"
],
name:
"index_project_auto_devops_on_project_id"
,
unique:
true
,
using: :btree
...
...
spec/models/project_auto_devops_spec.rb
View file @
5e9687a1
...
...
@@ -5,6 +5,8 @@ describe ProjectAutoDevops do
it
{
is_expected
.
to
belong_to
(
:project
)
}
it
{
is_expected
.
to
define_enum_for
(
:deploy_strategy
)
}
it
{
is_expected
.
to
respond_to
(
:created_at
)
}
it
{
is_expected
.
to
respond_to
(
:updated_at
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment