To use artifacts during snapshot setup, you will need to authenticate with them during repository configuration.If you require access to an artifact during session runtime, use the secrets store within Devin Settings. Below are sections for AWS, Azure, and JfrogIf your artifacts are on a private network, please see VPC Deployment
#!/bin/bash# VariablesROLE_NAME="robot-artifact-iam-role"POLICY_ARN="arn:aws:iam::aws:policy/AWSArtifactReadOnlyAccess"KEY_PAIR_NAME="robot-artifact-key-pair"# Step 1: Create IAM Role for AWS Artifactecho "Creating IAM Role: $ROLE_NAME"aws iam create-role \ --role-name "$ROLE_NAME" \ --assume-role-policy-document '{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "sts:AssumeRole", "Principal": { "Service": "artifact.amazonaws.com" } } ] }' > create_role_output.json# Check if IAM Role was created successfullyif [ $? -eq 0 ]; then echo "IAM Role $ROLE_NAME created successfully."else echo "Failed to create IAM Role $ROLE_NAME." exit 1fiStep 2: Attach Policy to Role for Artifact Accessecho "Attaching AWSArtifactReadOnlyAccess policy to IAM Role $ROLE_NAME"aws iam attach-role-policy \ --role-name "$ROLE_NAME" \ --policy-arn "$POLICY_ARN"if [ $? -eq 0 ]; then echo "Policy attached successfully."else echo "Failed to attach policy." exit 1fiStep 3: Create IAM Access Keys (for programmatic access)echo "Creating Access Keys for IAM Role: $ROLE_NAME"aws iam create-access-key \ --user-name "$ROLE_NAME" \ > access_keys_output.json# Check if keys were createdif [ $? -eq 0 ]; then echo "Access keys created successfully." ACCESS_KEY_ID=$(jq -r '.AccessKey.AccessKeyId' access_keys_output.json) SECRET_ACCESS_KEY=$(jq -r '.AccessKey.SecretAccessKey') echo "Access Key ID: $ACCESS_KEY_ID" echo "Secret Access Key: $SECRET_ACCESS_KEY"else echo "Failed to create access keys." exit 1fiStep 4: Display the IAM Role and Access Key Informationecho "IAM Role $ROLE_NAME has been created with the policy: $POLICY_ARN"echo "Access Key ID: $ACCESS_KEY_ID"echo "Secret Access Key: $SECRET_ACCESS_KEY"
AWS Repo Setup
Step 2: Downloading Artifact
Copy
Ask AI
#!/bin/bash# VariablesARTIFACT_ID="example-artifact-id" # Replace with the actual Artifact ID# Step 1: Get Artifact URL for downloading the reportecho "Fetching artifact download URL for Artifact ID: $ARTIFACT_ID"DOWNLOAD_URL=$(aws artifact describe-artifact \ --artifact-id "$ARTIFACT_ID" \ --query "artifactDetails[0].downloadUrl" \ --output text)
#!/bin/bash# Set variables for your Artifactory instance and artifact detailsARTIFACTORY_URL="https://your-artifactory-instance.jfrog.io/artifactory" # Change this to your Artifactory URLREPO="my-repository" # Replace with your repository nameARTIFACT_PATH="my-artifact/my-package/1.0.0/my-package-1.0.0.jar" # Path to your artifact in ArtifactoryOUTPUT_DIR="./downloads" # Directory to save downloaded artifact## Step 1: Download the artifactecho "Downloading artifact $ARTIFACT_PATH from $ARTIFACTORY_URL"jfrog rt dl "$REPO/$ARTIFACT_PATH" "$OUTPUT_DIR/"## Step 2: Check if download was successfulif [ $? -eq 0 ]; then echo "Artifact downloaded successfully to $OUTPUT_DIR/"else echo "Failed to download the artifact." exit 1fi