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
578a98fb
Commit
578a98fb
authored
Feb 09, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Save host-verification test against SHA1 checksum
parent
09a3b8fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
qa/qa/specs/features/cicd/pull_with_deploy_key_spec.rb
qa/qa/specs/features/cicd/pull_with_deploy_key_spec.rb
+11
-3
No files found.
qa/qa/specs/features/cicd/pull_with_deploy_key_spec.rb
View file @
578a98fb
require
'digest/sha1'
module
QA
feature
'pull codes with a deploy key'
,
:core
,
:docker
do
let
(
:runner_name
)
{
"qa-runner-
#{
Time
.
now
.
to_i
}
"
}
...
...
@@ -43,19 +45,25 @@ module QA
repository_location
end
repository_uri
=
URI
.
parse
(
repository_url
)
gitlab_ci
=
<<~
YAML
cat-config:
script:
- mkdir -p ~/.ssh
- ssh-keyscan -p
#{
repository_uri
.
port
}
#{
repository_uri
.
host
}
>> ~/.ssh/known_hosts
- eval $(ssh-agent -s)
- echo "$DEPLOY_KEY" |
tr -d '
\\
r' | ssh-add - > /dev/null
- echo "$DEPLOY_KEY" |
ssh-add -
- git clone
#{
repository_url
}
-
cat
#{
project
.
name
}
/.gitlab-ci.yml
-
sha1sum
#{
project
.
name
}
/.gitlab-ci.yml
tags:
- qa
- docker
YAML
sha1sum
=
Digest
::
SHA1
.
hexdigest
(
gitlab_ci
)
Factory
::
Repository
::
Push
.
fabricate!
do
|
push
|
push
.
project
=
project
push
.
file_name
=
'.gitlab-ci.yml'
...
...
@@ -76,7 +84,7 @@ module QA
end
Page
::
Project
::
Job
::
Show
.
perform
do
|
job
|
expect
(
job
.
output
).
to
include
(
gitlab_ci
.
tr
(
"
\n
"
,
' '
)
)
expect
(
job
.
output
).
to
include
(
sha1sum
)
end
end
end
...
...
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