From 04857fe955d31e39b06eb058a62fbdc58d6e9b06 Mon Sep 17 00:00:00 2001 From: lenape Date: Sun, 29 Jun 2025 15:39:27 +0000 Subject: [PATCH] automated terminal push --- Jenkinsfile | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..749ff95 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,78 @@ +pipeline { + agent any + + environment { + // Non‑secret config injected from Jenkins Credentials (Secret Text) + AWS_REGION = credentials('AWS_REGION') + AWS_ACCOUNT_ID = credentials('AWS_ACCOUNT_ID') + CODEART_DOMAIN = credentials('CODEART_DOMAIN') + CODEART_REPO = credentials('CODEART_REPO') + } + + stages { + stage('Checkout') { + steps { + checkout scm + } + } + + stage('Authenticate & Configure') { + steps { + // Use AWS Credentials Plugin to pick up your IAM user keys + withAWS(credentials: 'jenkins-codeartifact', region: "${AWS_REGION}") { + script { + // Fetch a short‑lived CodeArtifact token + env.CODEART_TOKEN = sh( + script: """ + aws codeartifact get-authorization-token \\ + --domain ${CODEART_DOMAIN} \\ + --domain-owner ${AWS_ACCOUNT_ID} \\ + --query authorizationToken --output text + """, returnStdout: true + ).trim() + } + // Point pip and twine at your CodeArtifact repo + sh ''' + pip config set global.index-url \ +"https://aws:${CODEART_TOKEN}@${CODEART_DOMAIN}-${AWS_ACCOUNT_ID}.d.codeartifact.${AWS_REGION}.amazonaws.com/pypi/${CODEART_REPO}/simple/" + cat > ~/.pypirc <