Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
3d32f0e9
Unverified
Commit
3d32f0e9
authored
2 years ago
by
yjqg6666
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[#9067] archive offline-files and support env-var NO_HTTP_SERVER to skip nginx-running (#9068)
parent
d821bed2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+2
-1
2 additions, 1 deletion
.gitignore
contrib/offline/manage-offline-files.sh
+17
-8
17 additions, 8 deletions
contrib/offline/manage-offline-files.sh
with
19 additions
and
9 deletions
.gitignore
+
2
−
1
View file @
3d32f0e9
...
...
@@ -3,7 +3,8 @@
**/vagrant_ansible_inventory
*.iml
temp
offline-files
contrib/offline/offline-files
contrib/offline/offline-files.tar.gz
.idea
.vscode
.tox
...
...
This diff is collapsed.
Click to expand it.
contrib/offline/manage-offline-files.sh
+
17
−
8
View file @
3d32f0e9
#!/bin/bash
CURRENT_DIR
=
$(
cd
$(
dirname
$0
)
;
pwd
)
OFFLINE_FILES_DIR
=
"
${
CURRENT_DIR
}
/offline-files"
CURRENT_DIR
=
$(
dirname
"
$(
readlink
-f
"
$0
"
)
"
)
OFFLINE_FILES_DIR_NAME
=
"offline-files"
OFFLINE_FILES_DIR
=
"
${
CURRENT_DIR
}
/
${
OFFLINE_FILES_DIR_NAME
}
"
OFFLINE_FILES_ARCHIVE
=
"
${
CURRENT_DIR
}
/offline-files.tar.gz"
FILES_LIST
=
${
FILES_LIST
:-
"
${
CURRENT_DIR
}
/temp/files.list"
}
NGINX_PORT
=
8080
# download files
if
[
!
-f
${
FILES_LIST
}
]
;
then
echo
"
${
FILES_LIST
}
should exist."
if
[
!
-f
"
${
FILES_LIST
}
"
]
;
then
echo
"
${
FILES_LIST
}
should exist
, run ./generate_list.sh first
."
exit
1
fi
rm
-rf
${
OFFLINE_FILES_DIR
}
mkdir
${
OFFLINE_FILES_DIR
}
wget
-x
-P
${
OFFLINE_FILES_DIR
}
-i
${
FILES_LIST
}
rm
-rf
"
${
OFFLINE_FILES_DIR
}
"
rm
"
${
OFFLINE_FILES_ARCHIVE
}
"
mkdir
"
${
OFFLINE_FILES_DIR
}
"
wget
-x
-P
"
${
OFFLINE_FILES_DIR
}
"
-i
"
${
FILES_LIST
}
"
tar
-czvf
"
${
OFFLINE_FILES_ARCHIVE
}
"
"
${
OFFLINE_FILES_DIR_NAME
}
"
[
-n
"
$NO_HTTP_SERVER
"
]
&&
echo
"skip to run nginx"
&&
exit
0
# run nginx container server
if
command
-v
nerdctl 1>/dev/null 2>&1
;
then
...
...
@@ -25,11 +33,12 @@ else
echo
"No supported container runtime found"
exit
1
fi
sudo
"
${
runtime
}
"
container inspect nginx
>
/dev/null 2>&1
if
[
$?
-ne
0
]
;
then
sudo
"
${
runtime
}
"
run
\
--restart
=
always
-d
-p
${
NGINX_PORT
}
:80
\
--volume
${
OFFLINE_FILES_DIR
}
:/usr/share/nginx/html/download
\
--volume
"
${
OFFLINE_FILES_DIR
}
:/usr/share/nginx/html/download
"
\
--volume
"
$(
pwd
)
"
/nginx.conf:/etc/nginx/nginx.conf
\
--name
nginx nginx:alpine
fi
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment