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

DEPLOY.log

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

~/deploy.log
1 2