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

DEPLOY.log

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

~/deploy.log
1 2