File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,10 @@ namespace :docker do
28
28
task :staging do
29
29
Gitlab ::Util . section ( 'docker:push:staging' ) do
30
30
Build ::GitlabImage . tag_and_push_to_gitlab_registry ( Build ::Info ::Docker . tag )
31
+
32
+ # Also tag with CI_COMMIT_REF_SLUG so that manual testing using Docker
33
+ # can use the same image name/tag.
34
+ Build ::GitlabImage . tag_and_push_to_gitlab_registry ( Build ::Info ::CI . commit_ref_slug )
31
35
end
32
36
end
33
37
Original file line number Diff line number Diff line change 55
55
56
56
allow ( ENV ) . to receive ( :[] ) . and_call_original
57
57
allow ( ENV ) . to receive ( :[] ) . with ( 'CI_REGISTRY_IMAGE' ) . and_return ( 'dev.gitlab.org:5005/gitlab/omnibus-gitlab' )
58
+ allow ( ENV ) . to receive ( :[] ) . with ( 'CI_COMMIT_REF_SLUG' ) . and_return ( 'foo-bar' )
58
59
allow ( Build ::Info ::Package ) . to receive ( :name ) . and_return ( 'gitlab-ce' )
59
60
allow ( Build ::Info ::Docker ) . to receive ( :tag ) . and_return ( '9.0.0' )
60
61
allow ( DockerOperations ) . to receive ( :authenticate ) . and_return ( true )
65
66
66
67
it 'pushes to staging correctly' do
67
68
expect ( dummy_image ) . to receive ( :push ) . with ( dummy_creds , repo_tag : 'dev.gitlab.org:5005/gitlab/omnibus-gitlab/gitlab-ce:9.0.0' )
69
+ expect ( dummy_image ) . to receive ( :push ) . with ( dummy_creds , repo_tag : 'dev.gitlab.org:5005/gitlab/omnibus-gitlab/gitlab-ce:foo-bar' )
68
70
Rake ::Task [ 'docker:push:staging' ] . invoke
69
71
end
70
72
You can’t perform that action at this time.
0 commit comments