Reprepro working

This commit is contained in:
Max Fowler 2020-11-12 17:21:48 +01:00
parent e9feefa035
commit fed137f82d
10 changed files with 6 additions and 78 deletions

View File

@ -1,8 +0,0 @@
Origin: PeachCloud
Label: PeachCloud
Codename: buster
Architectures: amd64
Components: main
Description: Apt repository for PeachCloud debian packages
SignWith: {{gpg_key_id}}
DebOverride: override.buster

View File

@ -1,3 +0,0 @@
verbose
basedir {{debian_rep_dir}}
ask-passphrase

View File

@ -1,4 +0,0 @@
{% for service in services %}
{{service}} Priority optional
{{service}} Section net
{% endfor %}

View File

@ -1,7 +1,7 @@
Origin: PeachCloud
Label: PeachCloud
Codename: buster
Architectures: amd64
Architectures: amd64 arm64
Components: main
Description: Apt repository for PeachCloud debian packages
SignWith: {{gpg_key_id}}

View File

@ -1,6 +1,6 @@
server {
listen 80;
server_name 167.99.136.83;
server_name deb.peachcloud.org;
access_log /var/log/nginx-debian.log;
error_log /var/log/nginx-debian.error;

View File

@ -1,13 +0,0 @@
#!/bin/bash
while read oldrev newrev ref
do
if [[ $ref =~ .*/master$ ]];
then
echo "Master ref received. Deploying master branch to build directory..."
git --work-tree={{src_dir}}/devdocs_build --git-dir={{src_dir}}/devdocs_bare checkout -f
echo "Building docs and deploying to production..."
/root/.cargo/bin/mdbook build {{src_dir}}/devdocs_build --dest-dir {{web_dir}}/docs:peachcloud:org/html
else
echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
fi
done

View File

@ -1,31 +0,0 @@
user www-data;
worker_processes 1;
worker_rlimit_nofile 8192;
events {
worker_connections 3000;
}
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

View File

@ -1,10 +0,0 @@
server {
listen 80;
server_name 159.89.5.141;
location / {
root {{web_dir}}/docs:peachcloud:org/html;
index index.html;
try_files $uri $uri/ /index.html;
}
}

View File

@ -98,11 +98,8 @@ for service in SERVICES:
service_path = os.path.join(MICROSERVICES_SRC_DIR, service_name)
print("[ BUILIDING SERVICE {} ]".format(service_name))
subprocess.call(["git", "pull"], cwd=service_path)
debian_package_path = str(subprocess.check_output(["/root/.cargo/bin/cargo", "deb", "--target", "aarch64-unknown-linux-gnu"], cwd=service_path))
debian_package_path = subprocess.check_output(["/root/.cargo/bin/cargo", "deb", "--target", "aarch64-unknown-linux-gnu"], cwd=service_path).decode("utf-8").strip()
print('OUTPUT: {}'.format(debian_package_path))
subprocess.call("reprepro includedeb buster {deb_path}".format(
debian_dir=DEBIAN_REPO_DIR,
deb_path=debian_package_path
), cwd=DEBIAN_REPO_DIR)
subprocess.call(["reprepro", "includedeb", "buster", debian_package_path], cwd=DEBIAN_REPO_DIR)

View File

@ -7,7 +7,7 @@ print('PROJECT_PATH: {}'.format(PROJECT_PATH))
template_path = os.path.join(PROJECT_PATH, 'conf/templates')
template_loader = jinja2.FileSystemLoader(searchpath=template_path)
template_env = jinja2.Environment(loader=template_loader)
template_env = jinja2.Environment(loader=template_loader, keep_trailing_newline=True)
def render_template(src, dest, template_vars=None):
@ -20,7 +20,7 @@ def render_template(src, dest, template_vars=None):
template = template_env.get_template(src)
if not template_vars:
template_vars= {}
output_text = template.render(template_vars=template_vars)
output_text = template.render(**template_vars)
if os.path.exists(dest):
os.remove(dest)
with open(dest, 'w') as f: