Commit 0e9d35f6 authored by Finn's avatar Finn

Add nginx and rsync config, some other stuff

parent 9d893144
Pipeline #3081 failed with stage
in 20 minutes and 2 seconds
/packer_cache
http/user-data
*.qcow2
*.qcow2.xz
ssh_key
ssh_key.pub
......@@ -5,9 +5,9 @@ build:
- git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@${CI_SERVER_HOST}/".insteadOf "git@${CI_SERVER_HOST}:"
- git -C .. clone git@${CI_SERVER_HOST}:entanglement.garden/vm-images/common.git
script:
- make
- make image-host.qcow2
- qemu-img info image-host.qcow2
artifacts:
paths:
- image-host.qcow2
expire_in: 1 hour
- xz -vzT 0 image-host.qcow2
- xz -l image-host.qcow2.xz
- sha256sum image-host.* | tee SHA256SUMS
- rsync image-host.qcow2.xz SHA256SUMS rsync://172.18.100.75/images/image-host/
all: image-host.qcow2
all: image-host.qcow2.xz
ssh_key.pub: ssh_key
......@@ -8,5 +8,8 @@ ssh_key:
http/user-data: ssh_key.pub
sed "s#SSH_KEY#$(shell cat ssh_key.pub)#g" ../common/user-data-template.yaml > http/user-data
image-host.qcow2: http/user-data
image-host.qcow2: http/user-data files/ scripts/ image-host.json
packer build -timestamp-ui -var-file ../common/vars.json image-host.json
image-host.qcow2.xz: image-host.qcow2
xz -zT 0 image-host.qcow2
server {
listen 80;
listen [::]:80;
server_name image-host;
root /var/www/images;
location / {
autoindex on;
}
}
uid = image-uploads
gid = image-uploads
use chroot = yes
[base-images]
path = /var/www/images
comment = base images
choose-mirror-bin mirror/http/proxy string
d-i netcfg/get_hostname string image-host
d-i apt-setup/use_mirror boolean true
d-i base-installer/kernel/override-image string linux-server
d-i clock-setup/utc boolean true
......
......@@ -25,8 +25,8 @@
"provisioners": [
{
"type": "file",
"source": "files/nginx.conf",
"destination": "/tmp/nginx.conf"
"source": "files",
"destination": "/tmp/files"
}, {
"type": "shell",
"scripts": [
......
......@@ -5,4 +5,5 @@ sudo mkdir /var/www/images /var/lib/image-uploads
sudo useradd -d /var/lib/image-uploads image-uploads
sudo chown image-uploads /var/www/images /var/lib/image-uploads
sudo rm -rfv /etc/nginx/sites-enabled/*
sudo mv /tmp/nginx.conf /etc/nginx/sites-enabled/image-host.conf
sudo mv /tmp/files/nginx.conf /etc/nginx/sites-enabled/image-host.conf
sudo mv /tmp/files/rsyncd.conf /etc/rsyncd.conf
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment