Skip to content

Commit 6e589de

Browse files
committed
broke out docker config into its own block. added a task to create keys for git
1 parent ae7b6cf commit 6e589de

File tree

1 file changed

+36
-11
lines changed

1 file changed

+36
-11
lines changed

concourse/pipeline.yml

+36-11
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,60 @@ resources:
77
private_key: ((deploy-keys))
88
uri: [email protected]:alphagov/gds-pre-commit.git
99

10+
blocks:
11+
- config: &pre_commit_docker
12+
13+
platform: linux
14+
15+
image_resource:
16+
type: docker-image
17+
source: {repository: gdscyber/cyber-security-concourse-base-image}
18+
19+
inputs:
20+
- name: pre-commit-git
1021

1122
jobs:
1223
- name: pre_commit_tests
1324
serial: false
1425
plan:
1526
- get: pre-commit-git
1627
trigger: true
28+
29+
- task: test_detection_keys
30+
config:
31+
<<: *pre_commit_docker
32+
outputs:
33+
- name: ssh
34+
run:
35+
path: /bin/bash
36+
args:
37+
- -exc
38+
- |
39+
cat > deploy_key <<'EOF'
40+
((deploy-keys))
41+
EOF
42+
echo "Host github.com" > config
43+
echo " IdentityFile {workdir}/deploy_key" >> config
44+
echo " StrictHostKeyChecking no" >> config
45+
chmod 400 deploy_key
46+
dir: ssh
47+
1748
- task: run_pre_commit_tests
1849
config:
19-
inputs:
20-
- name: pre-commit-git
21-
platform: linux
22-
image_resource:
23-
type: docker-image
24-
source: {repository: gdscyber/cyber-security-concourse-base-image}
50+
<<: *pre_commit_docker
2551
run:
2652
path: /bin/bash
2753
args:
2854
- -exc
2955
- |
30-
python3 -m venv virtualenv
56+
python -m venv virtualenv
3157
source virtualenv/bin/activate
3258
cd pre-commit-git/test-detection
3359
pip install wheel
3460
pip install -r requirements-pipeline.txt
35-
git config --global --unset core.hookspath
3661
pre-commit install -c .gds/.pre-commit-config.yaml
3762
git config --global core.hookspath ../global_install/hooks
38-
source ../concourse/bin/sts-assume-role.sh /
39-
'arn:aws:iam::103495720024:role/gds_pre_commit_tests_role)' /
63+
source ../concourse/bin/sts-assume-role.sh \
64+
'arn:aws:iam::103495720024:role/gds_pre_commit_tests_role' \
4065
'eu-west-2'
41-
make run
66+
#make run

0 commit comments

Comments
 (0)