Audit all pinned dependencies and preserve release evidence
myfileagent-python-ci/pipeline/head This commit looks good
myfileagent-python-ci/pipeline/head This commit looks good
This commit is contained in:
@@ -28,7 +28,7 @@ mkdir -p reports releases/generated
|
||||
python3 -m venv .test-venv
|
||||
.test-venv/bin/pip install -r requirements.txt pip-audit==2.10.1
|
||||
.test-venv/bin/python -m unittest -v
|
||||
.test-venv/bin/pip-audit -r requirements.txt
|
||||
.test-venv/bin/pip-audit --disable-pip --no-deps -r requirements.txt -f json -o "$WORKSPACE/reports/dependency-audit.json"
|
||||
''' } }
|
||||
}
|
||||
stage('Repository secret scan') { steps { sh 'sh secure-delivery/scan-secrets.sh' } }
|
||||
@@ -73,7 +73,7 @@ cat reports/target-pull.txt
|
||||
}
|
||||
stage('Deploy staging') {
|
||||
steps {
|
||||
script { writeFile file: "releases/generated/${env.RELEASE_VERSION}-staging.yml", text: "target_env: staging\nrelease_image: ${env.RELEASE_IMAGE}\nexpected_version: ${env.RELEASE_VERSION}\nexpected_commit: ${env.SOURCE_COMMIT}\nexpected_total: ${env.EXPECTED_TOTAL}\npublic_url: https://staging.myfileagent.tech\nproxy_network: myfileagent-gitea_gitea-private\n" }
|
||||
script { writeFile file: "releases/generated/${env.RELEASE_VERSION}-staging.yml", text: "target_env: staging\nrelease_image: ${env.RELEASE_IMAGE}\nexpected_version: ${env.RELEASE_VERSION}\nexpected_commit: ${env.SOURCE_COMMIT}\nconfiguration_commit: ${env.SOURCE_COMMIT}\nbuild_url: ${env.BUILD_URL}\nexpected_total: ${env.EXPECTED_TOTAL}\npublic_url: https://staging.myfileagent.tech\nproxy_network: myfileagent-gitea_gitea-private\n" }
|
||||
withCredentials([sshUserPrivateKey(credentialsId: 'assignment8-deploy-ssh', keyFileVariable: 'DEPLOY_KEY')]) {
|
||||
sh '''set +x
|
||||
export ANSIBLE_SSH_ARGS="-o StrictHostKeyChecking=yes -o UserKnownHostsFile=$WORKSPACE/secure-delivery/ansible/known_hosts"
|
||||
@@ -98,14 +98,14 @@ grep -Eq 'startup[[:space:]]*:.*changed=0[[:space:]]+unreachable=0[[:space:]]+fa
|
||||
stage('Production approval') {
|
||||
steps {
|
||||
script {
|
||||
def approver = timeout(time: 30, unit: 'MINUTES') { input message: "Promote ${env.SOURCE_COMMIT} / ${env.RELEASE_IMAGE} after successful staging and scans?", ok: 'Promote', submitter: 'ssw590', submitterParameter: 'APPROVER' }
|
||||
writeFile file: 'reports/approval.txt', text: "Approver: ${approver}\nBuild: ${env.BUILD_URL}\nSource: ${env.SOURCE_COMMIT}\nImage: ${env.RELEASE_IMAGE}\n"
|
||||
def approver = timeout(time: 30, unit: 'MINUTES') { input message: "Source/configuration: ${env.SOURCE_COMMIT}\nImage: ${env.RELEASE_IMAGE}\nSecurity gates: passed\nStaging checks and unchanged rerun: passed\nEvidence: ${env.BUILD_URL}\nApprove production promotion?", ok: 'Promote', submitter: 'ssw590', submitterParameter: 'APPROVER' }
|
||||
writeFile file: 'reports/approval.txt', text: "Approver: ${approver}\nDecision: approved\nTime (UTC): ${sh(script: 'date -u +%FT%TZ', returnStdout: true).trim()}\nBuild: ${env.BUILD_URL}\nSource and configuration commit: ${env.SOURCE_COMMIT}\nImage: ${env.RELEASE_IMAGE}\nVersion: ${env.RELEASE_VERSION}\nExpected total for 3: ${env.EXPECTED_TOTAL}\nStaging and scans: passed\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Deploy production') {
|
||||
steps {
|
||||
script { writeFile file: "releases/generated/${env.RELEASE_VERSION}-production.yml", text: "target_env: production\nrelease_image: ${env.RELEASE_IMAGE}\nexpected_version: ${env.RELEASE_VERSION}\nexpected_commit: ${env.SOURCE_COMMIT}\nexpected_total: ${env.EXPECTED_TOTAL}\npublic_url: https://app.myfileagent.tech\nproxy_network: myfileagent-gitea_gitea-private\n" }
|
||||
script { writeFile file: "releases/generated/${env.RELEASE_VERSION}-production.yml", text: "target_env: production\nrelease_image: ${env.RELEASE_IMAGE}\nexpected_version: ${env.RELEASE_VERSION}\nexpected_commit: ${env.SOURCE_COMMIT}\nconfiguration_commit: ${env.SOURCE_COMMIT}\nbuild_url: ${env.BUILD_URL}\nexpected_total: ${env.EXPECTED_TOTAL}\npublic_url: https://app.myfileagent.tech\nproxy_network: myfileagent-gitea_gitea-private\n" }
|
||||
withCredentials([sshUserPrivateKey(credentialsId: 'assignment8-deploy-ssh', keyFileVariable: 'DEPLOY_KEY')]) {
|
||||
sh '''set +x
|
||||
export ANSIBLE_SSH_ARGS="-o StrictHostKeyChecking=yes -o UserKnownHostsFile=$WORKSPACE/secure-delivery/ansible/known_hosts"
|
||||
|
||||
Reference in New Issue
Block a user