What would be the easiest way for running automated local builds of websites on a Linux computer?
-
What would be the easiest way for running automated local builds of websites on a Linux computer? I have been using Netlify since ~2017, but it has been getting worse every year. I have a web hosting account on a traditional service provider, and would want to run builds locally when Git push commits happen. That way I would have somewhat similar basic functionality for building static site generated websites, without relying on 3rd party build services.
-
System shared this topic
-
What would be the easiest way for running automated local builds of websites on a Linux computer? I have been using Netlify since ~2017, but it has been getting worse every year. I have a web hosting account on a traditional service provider, and would want to run builds locally when Git push commits happen. That way I would have somewhat similar basic functionality for building static site generated websites, without relying on 3rd party build services.
@autiomaa I run this on a local machine to verify my changes are working as expected.
```#!/usr/bin/env python3
import http.server
from http.server import HTTPServer, BaseHTTPRequestHandler
import socketserverPORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map={
'.css': 'text/css',
'.html': 'text/html',
'': 'text/html', # Default is 'application/octet-stream'
}httpd = socketserver.TCPServer(("", PORT), Handler)
print("serving at port", PORT)
httpd.serve_forever()
``` -
@autiomaa I run this on a local machine to verify my changes are working as expected.
```#!/usr/bin/env python3
import http.server
from http.server import HTTPServer, BaseHTTPRequestHandler
import socketserverPORT = 8080
Handler = http.server.SimpleHTTPRequestHandler
Handler.extensions_map={
'.css': 'text/css',
'.html': 'text/html',
'': 'text/html', # Default is 'application/octet-stream'
}httpd = socketserver.TCPServer(("", PORT), Handler)
print("serving at port", PORT)
httpd.serve_forever()
```@lcisec That can be useful after a build process, but might also get that kind of output previews with a traditional HTTP server.
Previews are smaller issue than the automated build pipeline.
-
T tsrono@mastodon.social shared this topic