Package: wev-awscodeartifact
wev-awscodeartifact:A wev plugin to support Amazon Web Services CodeArtifact authorisation on the command line⚙️ Plugin forwev(withenvironmentvariables).📋RequestsandcachesCodeArtifact authorisation tokens.👩🏼‍💻Great for freelancersworking with multiple clients hosting CodeArtifact repositories.The Problem 🔥Say yourPipfileis configured to pull packages from a private Amazon Web Services CodeArtifact repository:[[source]]
name = "private"
url = "https://aws:$CODEARTIFACT_AUTH_TOKEN@corp-012345678901.d.codeartifact.eu-west-1.amazonaws.com/pypi/pypi-mirror/simple/"
verify_ssl = true

[packages]
tupper = "*"

[requires]
python = "3.9"YourPipfileexpects theCODEARTIFACT_AUTH_TOKENenvironment variable to be set to your authorisation token.If you try to usepipenvbefore settingCODEARTIFACT_AUTH_TOKENor if it holds an expired token, your pull from the repository will fail.wev-awscodeartifactextendswevto handle your CodeArtifact authorisation token for you.Installation 🎁wev-awscodeartifactrequires Python 3.8 or later.wevandwevplugins are usually happy to run within virtual environments, but that's tricky if your project'sPipfilehasonlyprivate sources that require a token.wev-awscodeartifactcannot generate a token before it's installed.For an easy life, I recommend installingwevandwev-awscodeartifactglobally,outsideof your virtual environment.pip3installwev
pip3installwev-awscodeartifactConfiguration ⚙️Locationwevconfiguration files apply to theworkingandchilddirectories.This gives you a few options for where to place your configuration:If you always use the same CodeArtifact repository then place the configuration in your home directory (i.e.~/.wev.yml).If you're a contractor working on a few projects for a client with a CodeArtifact repository (i.e. you have~/client-foo/project-aand~/client-foo/project-bon your machine) then place the configuration in your client's project directory (i.e.~/client-foo/.wev.yml).If you have only one project that requires a CodeArtifact token then place the configuration in that project's directory (i.e.~/project-foo/.wev.yml).ContentA minimal configuration would look like this:CODEARTIFACT_AUTH_TOKEN:plugin:id:wev-awscodeartifactdomain:corpRequired properties:domain: Name of the CodeArtifact domain hosting the private repository.Optional properties:account: ID of the AWS account hosting the CodeArtifact domain. Defaults to the account that your credentials authenticate into.region: AWS region hosting the CodeArtifact domain. Defaults to your AWS credentials profile's region.profile: Name of the AWS credentials profile to use.Configuring your profile when you work in a teamYou probably don't want to add theprofileproperty to.wev.ymlif you plan to commit and share it with your team mates. Profile names are personal, and you don't want to force everyone to use the same as you.If youdoneed to setprofile, I suggest you create it in.wev.user.yml(which should not be shared) and letwevmerge it in.For example:# .wev.ymlCODEARTIFACT_AUTH_TOKEN:plugin:id:wev-awscodeartifactaccount:"012345678901"domain:corpregion:eu-west-1# .wev.user.ymlCODEARTIFACT_AUTH_TOKEN:plugin:id:wev-awscodeartifactprofile:workUsage ⌨️Withwevandwev-awscodeartifactinstalled and configured, you can runpipenv installviawevto set your CodeArtifact authorisation token:wevpipenvinstallFAQs 🙋‍♀️Can I change the environment variable from CODEARTIFACT_AUTH_TOKEN?Yes! Call it anything you like.Does wev-awscodeartifact work with other package managers?Yes!wev-awscodeartifactwill work withanycommand line tool that needs CodeArtifact authorisation tokens in environment variables.Thank you! 🎉My name isCariad, and I'm anindependent freelance DevOps engineer.I'd love to spend more time working on projects like this, but--as a freelancer--my income is sporadic and I need to chase gigs that pay the rent.If this project has value to you, please consider☕️ sponsoringme. Sponsorships grant me time to work onyourwants rather thansomeone else's.Thank you! ❤️