Remove npm mirroring components

The npm mirror was removed with
Id539d336814cce2ce18898526e561b8b6977f62f.  This change is "inspired"
by a proposed puppet-nodejs update in
Ia7966fb9578d0d79f3a7f9480e3a956555737dc8.  Rather than fixing it up
for the new version, remove it (also, puppet is failing trying to
access /afs/.openstack.org/mirror/npm).

I believe the npmrc.erb file is actually a vestige of prior release
methods and is also no longer required.

Change-Id: I6fa48e4700779d2c90194f0129c770bf2d6d865f
This commit is contained in:
Ian Wienand 2017-12-15 10:25:18 +11:00
parent 759c3db50a
commit 7ace3799f1
7 changed files with 0 additions and 154 deletions

View File

@ -632,7 +632,6 @@ node /^mirror-update\d*\.openstack\.org$/ {
opensuse_keytab => hiera('opensuse_keytab'),
reprepro_keytab => hiera('reprepro_keytab'),
gem_keytab => hiera('gem_keytab'),
npm_keytab => hiera('npm_keytab'),
centos_keytab => hiera('centos_keytab'),
epel_keytab => hiera('epel_keytab'),
sysadmins => hiera('sysadmins', []),

View File

@ -17,7 +17,6 @@ class openstack_project::mirror (
$mirror_root = '/afs/openstack.org/mirror'
$pypi_root = "${mirror_root}/pypi"
$wheel_root = "${mirror_root}/wheel"
$npm_root = "${mirror_root}/npm"
$ceph_deb_hammer_root = "${mirror_root}/ceph-deb-hammer"
$ceph_deb_jewel_root = "${mirror_root}/ceph-deb-jewel"
$ceph_deb_luminous_root = "${mirror_root}/ceph-deb-luminous"
@ -147,16 +146,6 @@ class openstack_project::mirror (
]
}
file { "${www_root}/npm":
ensure => link,
target => "${npm_root}",
owner => root,
group => root,
require => [
File["${www_root}"],
]
}
# Create the symlink to ceph-deb-hammer.
file { "${www_root}/ceph-deb-hammer":
ensure => link,

View File

@ -6,7 +6,6 @@ class openstack_project::mirror_update (
$reprepro_keytab = '',
$admin_keytab = '',
$gem_keytab = '',
$npm_keytab = '',
$centos_keytab = '',
$epel_keytab = '',
$fedora_keytab = '',
@ -20,13 +19,6 @@ class openstack_project::mirror_update (
afs => true,
}
$data_directory = '/afs/.openstack.org/mirror/npm'
$uri_rewrite = 'localhost'
class { 'openstack_project::npm_mirror':
data_directory => $data_directory,
uri_rewrite => $uri_rewrite,
}
class { 'openstack_project::gem_mirror': }
class { 'bandersnatch': }
@ -53,13 +45,6 @@ class openstack_project::mirror_update (
require => Class['openstack_project::gem_mirror'],
}
file { '/etc/npm.keytab':
owner => 'root',
group => 'root',
mode => '0400',
content => $npm_keytab,
}
file { '/etc/afsadmin.keytab':
owner => 'root',
group => 'root',
@ -83,14 +68,6 @@ class openstack_project::mirror_update (
source => 'puppet:///modules/openstack_project/gem-mirror-update.sh',
}
file { '/usr/local/bin/npm-mirror-update':
ensure => present,
owner => 'root',
group => 'root',
mode => '0755',
content => template('openstack_project/npm-mirror-update.sh'),
}
cron { 'bandersnatch':
user => $user,
minute => '*/5',

View File

@ -1,61 +0,0 @@
# == Class: openstack_project::npm_mirror
#
class openstack_project::npm_mirror (
$uri_rewrite,
$data_directory,
) {
file { $data_directory:
ensure => directory,
owner => 'root',
group => 'root',
}
class { '::nodejs':
repo_url_suffix => 'node_4.x',
}
# See: https://github.com/davglass/registry-static/pull/45
package { 'patch-package-json':
ensure => '0.0.4',
provider => 'npm',
require => Class['nodejs'],
}
package { 'follow-registry':
ensure => '2.0.0',
provider => 'npm',
require => [
Class['nodejs'],
]
}
# The registry mirroring script.
package { 'registry-static':
ensure => '2.2.0',
provider => 'npm',
require => [
Class['nodejs'],
Package['follow-registry'],
Package['patch-package-json'],
]
}
# The afs-blob-store file structure rewriter.
package { 'afs-blob-store':
ensure => '1.0.1',
provider => 'npm',
require => [
Class['nodejs'],
]
}
# Common registry hooks
package { 'openstack-registry-hooks':
ensure => '1.1.0',
provider => 'npm',
require => [
Class['nodejs'],
]
}
}

View File

@ -52,15 +52,6 @@ NameVirtualHost <%= @vhost_name %>:8081
RewriteCond %{DOCUMENT_ROOT}/wheel/$1/$2/$2$3 -d
RewriteRule ^/wheel/([^/]+)/([^/])([^/]*)(/.*)?$ /wheel/$1/$2/$2$3$4 [L]
# npm's URL's are:
# /npm/-/index.json
# /npm/a/aabc/index.json
# /npm/a/aabc/latest/index.json
# /npm/a/aabc/-/aabc-0.0.0.tgz
RewriteCond %{REQUEST_URI} ^/npm/([^/])([^/]*)
RewriteCond %{DOCUMENT_ROOT}/npm/$1/$1$2 -d
RewriteRule ^/npm/([^/])([^/]*)(/.*)?$ /npm/$1/$1$2$3 [L]
# TODO(jhesketh): Remove this after bandersnatch implements pep503
# https://bitbucket.org/pypa/bandersnatch/pull-requests/20/fully-implement-pep-503-normalization/diff
@ -81,12 +72,6 @@ NameVirtualHost <%= @vhost_name %>:8081
RewriteCond %{DOCUMENT_ROOT}/pypi/simple/$1/$1$2 -d
RewriteRule ^/pypi/simple/([^/])([^/]*)(/.*)?$ /pypi/simple/$1/$1$2$3 [L]
<DirectoryMatch "<%= @docroot %>\/npm\/[^/]+\/.*">
DirectoryIndex index.json
AddOutputFilterByType SUBSTITUTE application/json
Substitute "s|http://localhost|http://<%= @srvname %>/npm|ni"
</DirectoryMatch>
ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log
LogLevel warn
CustomLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_access.log combined

View File

@ -1,31 +0,0 @@
#!/bin/bash
# Copyright 2016 Hewlett Packard Enterprise Development Corporation, LP
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
set -e
CMD="/usr/bin/registry-static"
CMD_ARGS="-d <%= @uri_rewrite %> -o <%= @data_directory %> --blobstore afs-blob-store --hooks openstack-registry-hooks"
date --iso-8601=ns
echo "Obtaining npm tokens and running registry-static."
k5start -t -f /etc/npm.keytab service/npm -- timeout -k 2m 30m $CMD $CMD_ARGS
date --iso-8601=ns
echo "registry-static completed successfully, running vos release."
k5start -t -f /etc/afsadmin.keytab service/afsadmin -- vos release -v mirror.npm
date --iso-8601=ns
echo "Done."

View File

@ -1,12 +0,0 @@
<%
require 'base64'
%>
init.author.name=<%= jenkins_gitfullname %>
init.author.email=<%= jenkins_gitemail %>
init.author.url=<%= npm_userurl %>
tag-version-prefix=
sign-git-tag=true
//registry.npmjs.org/:username=<%= npm_username %>
//registry.npmjs.org/:_password=<%= Base64.encode64(npm_userpassword) %>
//registry.npmjs.org/:email=<%= jenkins_gitemail %>