Skip to content

Mutex server for synchronizing commits to GitOps repositories using CI/CD

Notifications You must be signed in to change notification settings

themisir/mutexserver

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mutexserver

Simple http service for setting up mutex service. For example set mutex for parallel GitOps repository commits.

Server

To start mutex server you need to install Node.js and simply run node server.js. You can customize mutex lifetime using TTL and server port using PORT environment variable. You can also use docker image for running mutex server.

docker pull themisir/mutexserver
docker run -p 5000:80 themisir/mutexserver
URI Description
POST http://localhost:5000/<key> Waits for key unlock then locks the mutex.
DELETE http://localhost:5000/<key> Unlocks mutex.

cURL

Using curl commands you can easily lock/unlock mutexes.

# Will lock the mutex, if mutex is already locked the command will wait until mutex becomes unlocked
curl -XPOST http://localhost:5000/key

# Unlocks mutex
curl -XDELETE http://localhost:5000/key

Github Actions

You can use GitHub actions jobs to queue parallel jobs.

- name: Create mutex
  uses: themisir/mutexserver@v1
  with:
    server: http://example.com
    key: my-mutex-key