AWS CodeArtifact, NPM, PyPI, Twine, Django & Demo Project.

AWS Code Artifact

Let’s START

Step1: AWS Environment Setup

Step 2: Linux & Software installation

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"unzip awscliv2.zipsudo ./aws/installaws --version
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"codeartifact:*"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "sts:GetServiceBearerToken",
"Resource": "*",
"Condition": {
"StringEquals": {
"sts:AWSServiceName": "codeartifact.amazonaws.com"
}
}
}
]
}

Step 3: Connect to you code artifact repo

aws codeartifact login --tool npm --repository varunArtifact --domain varunartifact --domain-owner 276701924684
yum install tree -ycurl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
Yum install nodejs -y
npm --versionnode --versioncurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bashnvm --versioncd /opt/nvm --versionnvm install --ltsnode --versionnvm -lsyum install gcc-c++ make
nvm use 12npm install -g aws-cdk
mkdir npm_packagecd npm_package/npm initnpm publishnpm install maniknpm
cd ../mkdir npmtempcd npmcd npmtemp/npm install maniknpmtree
git clone https://github.com/manikcloud/CodeArtifact-npm.git
vim package-lock.json
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"maniknpm": {
"version": "1.0.0",
"resolved": "https://varunartifact-276701924684.d.codeartifact.us-east-1.amazonaws.com:443/npm/varunArtifact/maniknpm/-/maniknpm-1.0.0.tgz",
"integrity": "sha512-Znm5+nCW+wwEqguBpR8a9fGV6gukdUC4Bdx7QiipXOWoR7Z8kjGoTL7DZhrO/5HaPUB3OHEAaougimSWgY2UaA=="
}
}
}

PYTHON PyPI

Step 4: Python installation & PyPi setup

wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.shsh Miniconda3-latest-Linux-x86_64.sh
aws codeartifact login --tool pip --repository pypi-store --domain varunartifact --domain-owner 276701924684
pip install django==2.2

Step 5: Create your own Python Package Twine

aws codeartifact login --tool twine --repository pypi-store --domain varunartifact --domain-owner 276701924684mkdir projectscd projects
git clone https://github.com/manikcloud/AwsCodeArtifact
python setup.py sdist bdist_wheel

Step 6: Artifact creation and upload AWS Code Artifact

pip install twine
twine upload --repository codeartifact dist/manik_notebookc-1.1.3.tar.gz

Step 7: Create a new Django project

django-admin startproject djangocodecd djangocode/
https://github.com/manikcloud/AwsCodeArtifact/tree/master/djangocode
python manage.py runserver 0.0.0.0:8080

Step 8: Verification

Step 9: Verify with New version of your Artifact

twine upload --repository codeartifact dist/manik_notebookc-1.1.4.tar.gz
pip install manik-notebookc==1.1.4
python manage.py runserver 0.0.0.0:8080

Conclusion:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store