-
Notifications
You must be signed in to change notification settings - Fork 59
Add Sonatype Nexus repository integration module #262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MAVRICK-1
wants to merge
25
commits into
coder:main
Choose a base branch
from
MAVRICK-1:feat/nexus-repository-module
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+611
−0
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
e32a0b7
feat: add Sonatype Nexus repository integration module
MAVRICK-1 e2d8aad
Update registry/mavrickrishi/modules/nexus/main.tf
MAVRICK-1 2a892ad
Update registry/mavrickrishi/modules/nexus/main.tf
MAVRICK-1 20e9a32
Update registry/mavrickrishi/modules/nexus/main.tf
MAVRICK-1 af94e5b
fix: apply code formatting
MAVRICK-1 db7afc8
fixed changes
MAVRICK-1 09905c3
Update registry/mavrickrishi/modules/nexus/README.md
MAVRICK-1 56f5990
Update registry/mavrickrishi/modules/nexus/main.tf
MAVRICK-1 3c890d0
Update registry/mavrickrishi/modules/nexus/main.tf
MAVRICK-1 88f8284
fix: update Nexus module configurations and README details
MAVRICK-1 f375e5f
feat: add support for Go package manager in Nexus module and update R…
MAVRICK-1 97d144b
feat: add test for configuring Go module proxy in Nexus module
MAVRICK-1 1bd0085
feat: Add Nexus Repository module and related configurations
MAVRICK-1 1b01b37
Merge branch 'main' into feat/nexus-repository-module
MAVRICK-1 5534564
Delete .icons/nexus.svg
MAVRICK-1 0854c5e
fix: remove false positive entries from typos.toml and adjust usernam…
MAVRICK-1 c520a19
fix: correct username entry for mavrickrishi in typos.toml
MAVRICK-1 f42da8f
Merge branch 'main' into feat/nexus-repository-module
MAVRICK-1 9f2fe38
Merge branch 'main' into feat/nexus-repository-module
MAVRICK-1 0a10b4d
Merge branch 'main' into feat/nexus-repository-module
MAVRICK-1 8de8da8
Merge branch 'main' into feat/nexus-repository-module
DevelopmentCats 0fd038a
Merge branch 'main' into feat/nexus-repository-module
DevelopmentCats 9f2f3a4
Update registry/mavrickrishi/modules/nexus-repository/README.md
MAVRICK-1 4a45f09
Merge branch 'main' into feat/nexus-repository-module
MAVRICK-1 3bdcac7
chore: remove trailing newline from README.md
MAVRICK-1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fixed changes
- Loading branch information
commit db7afc85fbd89571dd1bc5809b434336eb7582dd
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
display_name: mavrickrishi | ||
bio: Coder module contributor | ||
github: MAVRICK-1 | ||
status: community | ||
--- | ||
|
||
# mavrickrishi | ||
|
||
This directory contains Coder modules and templates created by mavrickrishi. | ||
|
||
## Modules | ||
|
||
- [nexus](./modules/nexus/) - Configure package managers to use Sonatype Nexus Repository |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
#!/usr/bin/env bash | ||
|
||
not_configured() { | ||
type=$1 | ||
echo "🤔 no $type repository is set, skipping $type configuration." | ||
} | ||
|
||
config_complete() { | ||
echo "🥳 Configuration complete!" | ||
} | ||
|
||
register_docker() { | ||
repo=$1 | ||
echo -n "${NEXUS_PASSWORD}" | docker login "${NEXUS_HOST}" --username "${NEXUS_USERNAME}" --password-stdin | ||
MAVRICK-1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
echo "🚀 Configuring Nexus repository access..." | ||
|
||
# Configure Maven | ||
if [ -n "${HAS_MAVEN}" ]; then | ||
echo "☕ Configuring Maven..." | ||
mkdir -p ~/.m2 | ||
cat > ~/.m2/settings.xml << 'EOF' | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"> | ||
<servers> | ||
<server> | ||
<id>nexus</id> | ||
<username>${NEXUS_USERNAME}</username> | ||
<password>${NEXUS_PASSWORD}</password> | ||
</server> | ||
</servers> | ||
<mirrors> | ||
<mirror> | ||
<id>nexus-mirror</id> | ||
<mirrorOf>*</mirrorOf> | ||
<url>${NEXUS_URL}/repository/${MAVEN_REPO}</url> | ||
</mirror> | ||
</mirrors> | ||
</settings> | ||
EOF | ||
config_complete | ||
else | ||
not_configured maven | ||
fi | ||
|
||
# Configure npm | ||
if [ -n "${HAS_NPM}" ]; then | ||
echo "📦 Configuring npm..." | ||
cat > ~/.npmrc << 'EOF' | ||
${NPMRC} | ||
EOF | ||
config_complete | ||
else | ||
not_configured npm | ||
fi | ||
|
||
# Configure pip | ||
if [ -n "${HAS_PYPI}" ]; then | ||
echo "🐍 Configuring pip..." | ||
mkdir -p ~/.pip | ||
# Create .netrc file for secure credential storage | ||
cat > ~/.netrc << EOF | ||
machine ${NEXUS_HOST} | ||
login ${NEXUS_USERNAME} | ||
password ${NEXUS_PASSWORD} | ||
EOF | ||
chmod 600 ~/.netrc | ||
|
||
# Update pip.conf to use index-url without embedded credentials | ||
cat > ~/.pip/pip.conf << 'EOF' | ||
[global] | ||
index-url = https://${NEXUS_HOST}/repository/${PYPI_REPO}/simple | ||
EOF | ||
config_complete | ||
else | ||
not_configured pypi | ||
fi | ||
|
||
# Configure Docker | ||
if [ -n "${HAS_DOCKER}" ]; then | ||
if command -v docker > /dev/null 2>&1; then | ||
echo "🐳 Configuring Docker credentials..." | ||
mkdir -p ~/.docker | ||
${REGISTER_DOCKER} | ||
config_complete | ||
else | ||
echo "🤔 Docker is not installed, skipping Docker configuration." | ||
fi | ||
else | ||
not_configured docker | ||
fi | ||
|
||
echo "✅ Nexus repository configuration completed!" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.