skcc321 / deploy_pin Goto Github PK
View Code? Open in Web Editor NEWpin task around deployment
License: MIT License
pin task around deployment
License: MIT License
The uuid
column does not contain actually uuid
.
So would be great to rename it to identifier
recurring
tasks & deployment
state track.# frozen_string_literal: true
DeployPin.setup do
tasks_path "deploy_pin"
groups %w[pre I II III rollback]
fallback_group "III"
statement_timeout 10.minutes
deployment_state track: true, ongoing: %w[pre III], pending: "rollback"
# hide in deploy pin library
def self.ongoing_deployment?
deployment_state == "ongoing"
end
def self.ongoing_deployment?
deployment_state == "pending"
end
def self.deployment_state
if Thread.current[:deploy_pin][:deployment].blank? ||
Thread.current[:deploy_pin][:deployment][:expiration] < Time.current
Thread.current[:deploy_pin][:deployment] = {
expiration: 5.minutes.from,
state: Rails.cache.read("deploy_pin:deployment")
}
end
Thread.current[:deploy_pin][:deployment][:state]
end
end
always
running tasks (./deploy_pin/always/ )# we are not going to store them in the DB
# 1:pre
# task_title: TurnOn
Rails.cache.write("deploy_pin:deployment", "ongoing")
# 1:post
# task_title: TurnOff
Rails.cache.delete("deploy_pin:deployment")
# 1:rollback
# task_title: TurnOn
Rails.cache.write("deploy_pin:deployment", "pending")
DeployPin.config do
cleanup_safe_timewindow 2.month
...
end
bundle exec rake deploy_pin:cleanup # removes all deploy_pin files older then 2.months
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.