-
Notifications
You must be signed in to change notification settings - Fork 6
/
manifest.jps
88 lines (82 loc) · 3.81 KB
/
manifest.jps
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
type: install
version: 0.2
id: nexus
name: Nexus Repository Manager
baseUrl: https://raw.githubusercontent.com/jelastic-jps/nexus/master/
logo: images/Nexus.png
homepage: https://www.sonatype.com/products/repository-oss
description: Nexus Repository OSS is an open source repository that supports many
artifact formats, including Docker, Java and npm. With the Nexus tool integration,
pipelines in your toolchain can publish and retrieve versioned apps and their dependencies
by using central repositories that are accessible from other environments.
categories:
- apps/dev-tools
- apps/dev-and-admin-tools
ssl: true
nodes:
- cloudlets: 32
fixedCloudlets: 1
nodeType: nginxphp
onInstall:
- install-nexus
- setup-nginx
- installAddon:
id: update-nexus
nodeGroup: cp
actions:
install-nexus:
- cmd[cp]: |-
wget -P /etc/yum.repos.d/ https://repo.sonatype.com/repository/community-hosted/rpm/sonatype-community.repo &>> /var/log/run.log
if grep -a 'AlmaLinux' /etc/system-release ; then
dnf -y install nexus-repository-manager java-17-openjdk-headless --nogpgcheck &>> /var/log/run.log
update-alternatives --remove-all java-1.8.0-openjdk.x86_64 &>> /var/log/run.log
systemctl restart nexus-repository-manager.service
else
yum -y install nexus-repository-manager --nogpgcheck &>> /var/log/run.log
wget https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz
tar xf openjdk-17.0.2_linux-x64_bin.tar.gz
rm -f openjdk-17.0.2_linux-x64_bin.tar.gz
mv jdk-17.0.2 /opt/
echo 'export JAVA_HOME=/opt/jdk-17.0.2' >>/etc/profile.d/jdk17.sh
echo 'export PATH=$PATH:$JAVA_HOME/bin' >>/etc/profile.d/jdk17.sh
echo /opt/jdk-17.0.2 >> /etc/jelastic/redeploy.conf
ln -sf /opt/jdk-17.0.2/bin/java /etc/alternatives/java
systemctl restart nexus-repository-manager.service
fi
echo /opt/sonatype/ >> /etc/jelastic/redeploy.conf
until [[ -f /opt/sonatype/sonatype-work/nexus3/etc/nexus.properties ]] ; do
sleep 1
echo '.'
done
chmod 664 /opt/sonatype/sonatype-work/nexus3/etc/nexus.properties
usermod -a -G nexus3 jelastic
user: root
sayYes: true
setup-nginx:
- cmd[cp]: |-
sed -i 's|index index.html index.htm index.php;|index index.html index.htm index.php;\n\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;|g' /etc/nginx/conf.d/sites-enabled/default.conf
sed -i 's|index index.html index.htm index.php;|index index.html index.htm index.php;\n\n proxy_set_header X-Real-IP $remote_addr;|g' /etc/nginx/conf.d/sites-enabled/default.conf
sed -i 's|index index.html index.htm index.php;|index index.html index.htm index.php;\n\n proxy_set_header Host $host;|g' /etc/nginx/conf.d/sites-enabled/default.conf
sed -i 's|index index.html index.htm index.php;|index index.html index.htm index.php;\n\n proxy_pass http://localhost:8081/;|g' /etc/nginx/conf.d/sites-enabled/default.conf
sed -i 's|\#\s*application-host=.*|application-host=127.0.0.1|' /opt/sonatype/sonatype-work/nexus3/etc/nexus.properties
chown nexus3:nexus3 /opt/sonatype/sonatype-work/nexus3/etc/nexus.properties
user: root
sayYes: true
- api [cp]: jelastic.environment.control.RestartNodes
- cmd [cp]: sleep 15
addons:
- id: update-nexus
name: Update Nexus Repository Manager
description: Update of Nexus
buttons:
- caption: Update
action: update
loadingText: Updating...
confirmText: Do you want to update Nexus?
successText: Nexus has been successfully updated!
actions:
update:
- log: launching nexus update JPS
- install: https://raw.githubusercontent.com/jelastic-jps/nexus/master/scripts/update-nexus.jps
skipEmail: true
success: text/success-email.md