Skip to content

Commit 18481be

Browse files
committed
Remove unused code
1 parent 2a2400d commit 18481be

File tree

2 files changed

+0
-261
lines changed

2 files changed

+0
-261
lines changed

cookbooks/boxcutter_sonatype/README.md

Lines changed: 0 additions & 231 deletions
Original file line numberDiff line numberDiff line change
@@ -32,234 +32,3 @@ node.run_state['boxcutter_sonatype']['nexus_repository']['admin_password'] = 'Su
3232

3333
NOTE: Instructions for recovery if Chef ever gets out of sync with the current
3434
admin password are located as this [link](https://support.sonatype.com/hc/en-us/articles/213467158-How-to-reset-a-forgotten-admin-password-in-Sonatype-Nexus-Repository-3).
35-
36-
Raw Repository
37-
--------------
38-
39-
```bash
40-
# Create file - Direct Upload using HTTP PUT
41-
cat >hello.txt <<EOF
42-
Hello Sonatype Nexus!
43-
EOF
44-
45-
NEXUS_USERNAME=test
46-
NEXUS_PASSWORD=superseekret
47-
NEXUS_SERVER=https://example-nexus.boxcutter.dev
48-
curl --verbose --user ${NEXUS_USERNAME}:${NEXUS_PASSWORD} \
49-
--request PUT --upload-file hello.txt \
50-
"${NEXUS_SERVER}/repository/testy-hosted/sandbox/hello.txt"
51-
52-
# Create file - Direct Upload using HTTP POST
53-
NEXUS_USERNAME=test
54-
NEXUS_PASSWORD=superseekret
55-
NEXUS_SERVER=https://hq0-nexus01.sandbox.polymathrobotics.dev
56-
curl --verbose --user ${NEXUS_USERNAME}:${NEXUS_PASSWORD} \
57-
--request POST "${NEXUS_SERVER}/service/rest/v1/components?repository=testy-hosted" \
58-
--header "accept: application/json" \
59-
--header "Content-Type: multipart/form-data" \
60-
--form "raw.directory=/sandbox" \
61-
--form "raw.asset1=@hello.txt" \
62-
--form "raw.asset1.filename=hello.txt"
63-
64-
# List files
65-
NEXUS_USERNAME=test
66-
NEXUS_PASSWORD=superseekret
67-
NEXUS_SERVER=https://example-nexus.boxcutter.dev
68-
curl --user ${NEXUS_USERNAME}:${NEXUS_PASSWORD} \
69-
"${NEXUS_SERVER}/service/rest/v1/components?repository=testy-hosted"
70-
71-
# Delete file
72-
NEXUS_USERNAME=test
73-
NEXUS_PASSWORD=superseekret
74-
NEXUS_SERVER=https://example-nexus.boxcutter.dev
75-
curl --verbose --user ${NEXUS_USERNAME}:${NEXUS_PASSWORD} \
76-
--request DELETE \
77-
"${NEXUS_SERVER}/repository/testy-hosted/sandbox/hello.txt"
78-
79-
NEXUS_USERNAME=test
80-
NEXUS_PASSWORD=superseekret
81-
NEXUS_SERVER=https://hq0-nexus01.sandbox.polymathrobotics.dev
82-
COMPONENT_ID=cG9seW1hdGgtaW1hZ2VzOjE3MTU2MGEy
83-
curl --verbose --user ci-sandbox:${CI_PASSWORD} \
84-
--request DELETE "${NEXUS_SERVER}/service/rest/v1/components/${COMPONENT_ID}"
85-
# Downlaod
86-
NEXUS_SERVER=https://example-nexus.boxcutter.dev
87-
curl --verbose -LOJ \
88-
"${NEXUS_SERVER}/repository/ubuntu-releases-proxy/24.04.2/ubuntu-24.04.2-live-server-amd64.iso"
89-
90-
NEXUS_USERNAME=test
91-
NEXUS_PASSWORD=superseekret
92-
NEXUS_SERVER=http://example-nexus.boxcutter.dev
93-
curl --verbose --user ${NEXUS_USERNAME}:${NEXUS_PASSWORD} \
94-
--output hello.txt \
95-
"${NEXUS_SERVER}/repository/polymath-images/sandbox/tmp/hello.txt"
96-
```
97-
98-
Apt Repositories
99-
----------------
100-
101-
https://help.sonatype.com/en/apt-repositories.html
102-
103-
```bash
104-
# Depoy package with HTTP POST (equivalent of Upload in the UI)
105-
NEXUS_USER=admin
106-
NEXUS_PASSWORD=superseekret
107-
NEXUS_SERVER=https://hq0-nexus01.sandbox.polymathrobotics.dev
108-
curl --verbose --user "${NEXUS_USER}:${NEXUS_PASSWORD}" \
109-
-H "Content-Type: multipart/form-data" \
110-
--data-binary "@./test.deb" \
111-
"${NEXUS_SERVER}/repository/apt-hosted/"
112-
```
113-
114-
Docker Repositories
115-
-------------------
116-
117-
```bash
118-
docker login docker.hq0-nexus01.sandbox.polymathrobotics.dev
119-
docker pull docker.hq0-nexus01.sandbox.polymathrobotics.dev/ubuntu:22.04
120-
docker run -it --rm docker.hq0-nexus01.sandbox.polymathrobotics.dev/ubuntu:22.04
121-
docker logout docker.hq0-nexus01.sandbox.polymathrobotics.dev
122-
123-
cat >Containerfile <<EOF
124-
FROM docker.hq0-nexus01.sandbox.polymathrobotics.dev/ubuntu:22.04
125-
126-
RUN apt-get update
127-
RUN apt-get install -y figlet
128-
EOF
129-
130-
cat >docker-bake.hcl <<EOF
131-
target "default" {
132-
tags = ["docker.hq0-nexus01.sandbox.polymathrobotics.dev/testy"]
133-
dockerfile = "Containerfile"
134-
platforms = ["linux/amd64", "linux/arm64/v8"]
135-
}
136-
EOF
137-
138-
docker login docker.hq0-nexus01.sandbox.polymathrobotics.dev
139-
docker buildx create --use --name testy-buildkit --driver docker-container
140-
docker buildx bake --metadata-file metadata.json --push
141-
docker buildx rm testy-buildkit
142-
docker logout
143-
```
144-
145-
Pypi Repositories
146-
-----------------
147-
148-
```bash
149-
# Per-install (one-time use)
150-
NEXUS_SERVER=https://example-nexus.boxcutter.dev
151-
pip install --index-url "${NEXUS_SERVER}/repository/python-proxy/simple/" pulumi
152-
153-
154-
# Global (in pip.conf or pip.ini)
155-
NEXUS_SERVER=https://example-nexus.boxcutter.dev
156-
mkdir -p ~/.config/pip
157-
cat >~/.config/pip/pip.conf <<EOF
158-
[global]
159-
# pip search --index (XML-RPC search)
160-
# https://pip.pypa.io/en/stable/cli/pip_search/
161-
index = https://example-nexus.boxcutter.dev/repository/python-proxy/pypi
162-
163-
# pip install --index-url
164-
# https://pip.pypa.io/en/stable/cli/pip_install/
165-
index-url = https://example-nexus.boxcutter.dev/repository/python-proxy/simple
166-
EOF
167-
168-
pip config list -v
169-
pip install pulumi
170-
```
171-
172-
```bash
173-
# Per-install (one-time use)
174-
docker run -it --rm \
175-
--entrypoint /bin/bash \
176-
docker.io/boxcutter/python:3.10-noble
177-
178-
NEXUS_SERVER=http://host.docker.internal:2404
179-
pip install \
180-
--trusted-host host.docker.internal \
181-
--index-url "${NEXUS_SERVER}/repository/python-proxy/simple/" pulumi
182-
183-
# Global (in pip.conf or pip.ini)
184-
docker run -it --rm \
185-
--entrypoint /bin/bash \
186-
docker.io/boxcutter/python:3.10-noble
187-
188-
mkdir -p ~/.config/pip
189-
cat >~/.config/pip/pip.conf <<EOF
190-
[global]
191-
# pip search --index (XML-RPC search)
192-
# https://pip.pypa.io/en/stable/cli/pip_search/
193-
index = http://host.docker.internal:2404/repository/python-proxy/pypi
194-
195-
# pip install --index-url
196-
# https://pip.pypa.io/en/stable/cli/pip_install/
197-
index-url = http://host.docker.internal:2404/repository/python-proxy/simple
198-
trusted-host = host.docker.internal
199-
EOF
200-
201-
# Check config
202-
pip config list -v
203-
pip install pulumi
204-
```
205-
206-
```bash
207-
cat >~/.netrc <<EOF
208-
machine example-nexus.boxcutter.dev
209-
login admin
210-
password superseekret
211-
EOF
212-
213-
chmod 600 ~/.netrc
214-
215-
mkdir -p mypackage/src/mypackage
216-
cat >mypackage/src/mypackage/__init__.py <<EOF
217-
def hello():
218-
return "Hello from mypackage"
219-
EOF
220-
221-
cat >mypackage/pyproject.toml <<EOF
222-
# pyproject.toml
223-
[build-system]
224-
requires = ["setuptools", "wheel"]
225-
build-backend = "setuptools.build_meta"
226-
227-
[project]
228-
name = "mypackage"
229-
version = "0.1.0"
230-
description = "A simple example package"
231-
authors = [{name="Your Name", email="you@example.com"}]
232-
readme = "README.md"
233-
license = {text = "MIT"}
234-
requires-python = ">=3.6"
235-
236-
[tool.setuptools.packages.find]
237-
where = ["src"]
238-
EOF
239-
240-
cat >mypackage/README.md <<EOF
241-
# My Package
242-
EOF
243-
244-
cd mypackage
245-
pip install --upgrade build
246-
python -m build
247-
248-
# (Optional) .pypirc for upload config
249-
cat >~/.pypirc <<EOF
250-
# ~/.pypirc
251-
[distutils]
252-
index-servers =
253-
nexus
254-
255-
[nexus]
256-
repository: https://nexus.example.com/repository/python-hosted/
257-
username: admin
258-
password: superseekret
259-
EOF
260-
261-
pip install --upgrade twine
262-
twine upload -r nexus dist/*
263-
264-
twine upload --repository-url https://nexus.example.com/repository/python-hosted/ dist/*
265-
```

cookbooks/boxcutter_sonatype/test/cookbooks/boxcutter_sonatype_test/recipes/default.rb

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
node.run_state['boxcutter_sonatype']['nexus_repository'] ||= {}
77
node.run_state['boxcutter_sonatype']['nexus_repository']['admin_username'] = 'admin'
88
node.run_state['boxcutter_sonatype']['nexus_repository']['admin_password'] = 'Superseekret63'
9-
# node.run_state['boxcutter_sonatype']['nexus_repository']['admin_username'] = 'chef'
10-
# node.run_state['boxcutter_sonatype']['nexus_repository']['admin_password'] = 'sucre-canonize-ROADSTER-bashful'
119

1210
node.default['boxcutter_sonatype']['nexus_repository']['roles'] = {
1311
'engineering-read-only' => {
@@ -161,31 +159,3 @@
161159
}
162160

163161
include_recipe 'boxcutter_sonatype::default'
164-
165-
# include_recipe 'boxcutter_acme::lego'
166-
# include_recipe 'fb_nginx'
167-
#
168-
# node.default['fb_nginx']['enable_default_site'] = false
169-
# node.default['fb_nginx']['config']['http']['proxy_send_timeout'] = '120'
170-
# node.default['fb_nginx']['config']['http']['proxy_read_timeout'] = '300'
171-
# node.default['fb_nginx']['config']['http']['proxy_buffering'] = 'off'
172-
# node.default['fb_nginx']['config']['http']['proxy_request_buffering'] = 'off'
173-
# node.default['fb_nginx']['config']['http']['keepalive_timeout'] = '5 5'
174-
# node.default['fb_nginx']['config']['http']['tcp_nodelay'] = 'on'
175-
#
176-
# node.default['fb_nginx']['sites']['nexus'] = {
177-
# 'listen 443' => 'ssl',
178-
# 'server_name' => 'hq0-nexus01.sandbox.polymathrobotics.dev',
179-
# 'client_max_body_size' => '1G',
180-
# 'ssl_certificate' =>
181-
# '/etc/lego/certificates/hq0-nexus01.sandbox.polymathrobotics.dev.crt',
182-
# 'ssl_certificate_key' =>
183-
# '/etc/lego/certificates/hq0-nexus01.sandbox.polymathrobotics.dev.key',
184-
# 'location /' => {
185-
# 'proxy_set_header Host' => '$host:$server_port',
186-
# 'proxy_set_header X-Real-IP' => '$remote_addr',
187-
# 'proxy_set_header X-Forwarded-For' => '$proxy_add_x_forwarded_for',
188-
# 'proxy_set_header X-Forwarded-Proto' => '"https"',
189-
# 'proxy_pass' => 'http://127.0.0.1:8081',
190-
# },
191-
# }

0 commit comments

Comments
 (0)