--- menu.sh ---
try { await deploy(); } catch (e) { rollback(); }
child_process.exec("nginx -t", callback);
redis.set(`session:${id}`, JSON.stringify(user));
INSERT INTO logs (msg, level) VALUES ($1, $2);
const { rows } = await pool.query(sql);
$ git commit -m "fix: resolve memory leak"
$ docker push registry.io/app:v2.1.0
setInterval(() => healthCheck(), 30000);
if (!token) return res.status(401).json({ error });
export const middleware = (req, res, next) => {
const [state, setState] = useState(null);
const app = express();
$ certbot renew --nginx --quiet
$ helm upgrade --install api ./chart
setInterval(() => healthCheck(), 30000);
app.listen(PORT, () => console.log("ready"));
for (let i = 0; i < nodes.length; i++) {
const token = jwt.sign(payload, SECRET);
SELECT COUNT(*) FROM requests WHERE ts > NOW() - 1h;
$ rsync -avz ./dist/ server:/var/www/html/
$ terraform plan -var-file=prod.tfvars
fn main() -> Result<(), Box<dyn Error>> {
$ docker push registry.io/app:v2.1.0
$ docker build -t app:latest .
router.get("/api/v1/users", getUsers);
try { await deploy(); } catch (e) { rollback(); }
INSERT INTO logs (msg, level) VALUES ($1, $2);
const result = await fetch(API_URL);
module.exports = { config, deploy };
$ certbot renew --nginx --quiet
func deploy(ctx context.Context) error {
fn main() -> Result<(), Box<dyn Error>> {
INSERT INTO logs (msg, level) VALUES ($1, $2);
$ certbot renew --nginx --quiet
func deploy(ctx context.Context) error {
$ ssh root@10.0.0.1 "systemctl restart app"
const db = new PrismaClient();
import React from "react";
UPDATE services SET replicas = 3 WHERE name = $1;
$ npm run build && npm run deploy
$ certbot renew --nginx --quiet
INSERT INTO logs (msg, level) VALUES ($1, $2);
addEventListener("DOMContentLoaded", init);
EXPLAIN ANALYZE SELECT * FROM metrics ORDER BY ts;
const { rows } = await pool.query(sql);
server.on("error", (err) => logger.fatal(err));
export default function main() {
console.log("[INFO] server started on :3000");
process.env.NODE_ENV = "production";
document.querySelector("#root").innerHTML = html;
$ docker build -t app:latest .
server.on("error", (err) => logger.fatal(err));
redis.set(`session:${id}`, JSON.stringify(user));
child_process.exec("nginx -t", callback);
while (queue.length > 0) process(queue.shift());
SELECT COUNT(*) FROM requests WHERE ts > NOW() - 1h;
process.env.NODE_ENV = "production";
$ pm2 restart ecosystem.config.js --env prod
module.exports = { config, deploy };
$ certbot renew --nginx --quiet
$ tail -f /var/log/nginx/access.log
server.on("error", (err) => logger.fatal(err));
const { rows } = await pool.query(sql);
class Pipeline extends EventEmitter {
app.listen(PORT, () => console.log("ready"));
Object.keys(env).forEach(k => validate(k));
export default function main() {
Array.from(nodes).filter(n => n.active).map(fn);
$ npm run build && npm run deploy
const token = jwt.sign(payload, SECRET);
class Pipeline extends EventEmitter {
Array.from(nodes).filter(n => n.active).map(fn);
$ curl -X POST https://api.example.com/deploy
await Promise.all(tasks.map(t => t.execute()));
$ git commit -m "fix: resolve memory leak"
if (!token) return res.status(401).json({ error });
INSERT INTO logs (msg, level) VALUES ($1, $2);
Array.from(nodes).filter(n => n.active).map(fn);
export default function main() {
const { rows } = await pool.query(sql);
// TODO: implement circuit breaker pattern
fn main() -> Result<(), Box<dyn Error>> {
child_process.exec("nginx -t", callback);
// TODO: implement circuit breaker pattern
return new Promise((resolve, reject) => {
$ docker build -t app:latest .
addEventListener("DOMContentLoaded", init);
async function handleRequest(req, res) {
if (status === 200) return data;
app.listen(PORT, () => console.log("ready"));
const app = express();
document.querySelector("#root").innerHTML = html;
/* eslint-disable no-console */
const result = await fetch(API_URL);
$ npm run build && npm run deploy
$ docker push registry.io/app:v2.1.0
// TODO: implement circuit breaker pattern
const result = await fetch(API_URL);
try { await deploy(); } catch (e) { rollback(); }
$ grep -rn "ERROR" /var/log/app/*.log
CREATE INDEX idx_deploy ON builds (created_at);
INSERT INTO logs (msg, level) VALUES ($1, $2);
$ helm upgrade --install api ./chart
const result = await fetch(API_URL);
router.get("/api/v1/users", getUsers);
$ helm upgrade --install api ./chart
app.listen(PORT, () => console.log("ready"));
const db = new PrismaClient();
await Promise.all(tasks.map(t => t.execute()));
process.env.NODE_ENV = "production";
$ docker push registry.io/app:v2.1.0
child_process.exec("nginx -t", callback);
$ grep -rn "ERROR" /var/log/app/*.log
const token = jwt.sign(payload, SECRET);
// TODO: implement circuit breaker pattern
const hash = crypto.createHash("sha256").update(pw);
addEventListener("DOMContentLoaded", init);
async function handleRequest(req, res) {
module.exports = { config, deploy };
const db = new PrismaClient();
$ npm run build && npm run deploy
#!/bin/bash
module.exports = { config, deploy };
Object.keys(env).forEach(k => validate(k));
const token = jwt.sign(payload, SECRET);
const db = new PrismaClient();
$ rsync -avz ./dist/ server:/var/www/html/
SELECT * FROM deployments WHERE status = 1;
def run_pipeline(config: dict) -> None:
child_process.exec("nginx -t", callback);
child_process.exec("nginx -t", callback);
$ grep -rn "ERROR" /var/log/app/*.log
app.listen(PORT, () => console.log("ready"));
pipe(stream).on("data", chunk => buffer.push(chunk));
export const middleware = (req, res, next) => {
$ tail -f /var/log/nginx/access.log
const result = await fetch(API_URL);
if (status === 200) return data;
const hash = crypto.createHash("sha256").update(pw);
$ docker push registry.io/app:v2.1.0
import React from "react";
const app = express();
useEffect(() => { fetchData(); }, [id]);
export const middleware = (req, res, next) => {
Object.keys(env).forEach(k => validate(k));
$ git push origin main --force-with-lease
/* eslint-disable no-console */
$ docker push registry.io/app:v2.1.0
fn main() -> Result<(), Box<dyn Error>> {
SELECT * FROM deployments WHERE status = 1;
$ tail -f /var/log/nginx/access.log
def run_pipeline(config: dict) -> None:
console.log("[INFO] server started on :3000");
for (let i = 0; i < nodes.length; i++) {
Array.from(nodes).filter(n => n.active).map(fn);
process.env.NODE_ENV = "production";
$ certbot renew --nginx --quiet
child_process.exec("nginx -t", callback);
Array.from(nodes).filter(n => n.active).map(fn);
module.exports = { config, deploy };
document.querySelector("#root").innerHTML = html;
$ helm upgrade --install api ./chart
fs.writeFileSync("/tmp/config.json", data);
redis.set(`session:${id}`, JSON.stringify(user));
const token = jwt.sign(payload, SECRET);
const hash = crypto.createHash("sha256").update(pw);
CREATE INDEX idx_deploy ON builds (created_at);
app.listen(PORT, () => console.log("ready"));
$ terraform plan -var-file=prod.tfvars
const db = new PrismaClient();
fn main() -> Result<(), Box<dyn Error>> {
process.env.NODE_ENV = "production";
while (queue.length > 0) process(queue.shift());
const hash = crypto.createHash("sha256").update(pw);
$ npm run build && npm run deploy
/* eslint-disable no-console */
CREATE INDEX idx_deploy ON builds (created_at);
Array.from(nodes).filter(n => n.active).map(fn);
#!/bin/bash
redis.set(`session:${id}`, JSON.stringify(user));
child_process.exec("nginx -t", callback);
router.get("/api/v1/users", getUsers);
CREATE INDEX idx_deploy ON builds (created_at);
$ tail -f /var/log/nginx/access.log
async function handleRequest(req, res) {
document.querySelector("#root").innerHTML = html;
const [state, setState] = useState(null);
#!/bin/bash
$ kubectl apply -f deployment.yaml
$ tail -f /var/log/nginx/access.log
router.get("/api/v1/users", getUsers);
if (status === 200) return data;
// TODO: implement circuit breaker pattern
return new Promise((resolve, reject) => {
router.get("/api/v1/users", getUsers);
async function handleRequest(req, res) {
child_process.exec("nginx -t", callback);
if (!token) return res.status(401).json({ error });
while (queue.length > 0) process(queue.shift());
const token = jwt.sign(payload, SECRET);
export default function main() {
return new Promise((resolve, reject) => {
server.on("error", (err) => logger.fatal(err));
exit 0
class Pipeline extends EventEmitter {
await Promise.all(tasks.map(t => t.execute()));
export default function main() {
const token = jwt.sign(payload, SECRET);
import React from "react";
$ docker push registry.io/app:v2.1.0
app.listen(PORT, () => console.log("ready"));
try { await deploy(); } catch (e) { rollback(); }
const hash = crypto.createHash("sha256").update(pw);
#!/bin/bash
class Pipeline extends EventEmitter {
process.env.NODE_ENV = "production";
const app = express();
CREATE INDEX idx_deploy ON builds (created_at);
#!/bin/bash
// TODO: implement circuit breaker pattern
if (!token) return res.status(401).json({ error });
process.env.NODE_ENV = "production";
$ rsync -avz ./dist/ server:/var/www/html/
fn main() -> Result<(), Box<dyn Error>> {
if (status === 200) return data;
module.exports = { config, deploy };
router.get("/api/v1/users", getUsers);
return new Promise((resolve, reject) => {
pipe(stream).on("data", chunk => buffer.push(chunk));
exit 0
const token = jwt.sign(payload, SECRET);
console.log("[INFO] server started on :3000");
CREATE INDEX idx_deploy ON builds (created_at);
$ ssh root@10.0.0.1 "systemctl restart app"
const app = express();
useEffect(() => { fetchData(); }, [id]);
$ pm2 restart ecosystem.config.js --env prod
await Promise.all(tasks.map(t => t.execute()));
SELECT COUNT(*) FROM requests WHERE ts > NOW() - 1h;
// TODO: implement circuit breaker pattern
const { rows } = await pool.query(sql);
$ grep -rn "ERROR" /var/log/app/*.log
$ certbot renew --nginx --quiet
const result = await fetch(API_URL);
server.on("error", (err) => logger.fatal(err));
pipe(stream).on("data", chunk => buffer.push(chunk));
$ curl -X POST https://api.example.com/deploy
$ ssh root@10.0.0.1 "systemctl restart app"
await Promise.all(tasks.map(t => t.execute()));
$ curl -X POST https://api.example.com/deploy

DEPLOY.log

DevOps・クラウド・インフラの実録

~/deploy.log
1 2