arrow-left

All pages
gitbookPowered by GitBook
1 of 2

Loading...

Loading...

Automation of releasing (CI/CD)

This page describes the release train for Ampersand.

hashtag
The purpose of automation.

The release of Ampersand is largely automated because we want:

  1. to save ourselves work;

  2. to release frequently in a predictable rythm, to bring new functionality to users quickly and predictably;

  3. reliable releases, to prevent our mistakes to hit users and to avoid delays caused by the release process;

  4. reproducible releases, to allow any team members to step in when the release is due.

hashtag
What we want to achieve.

hashtag
Version managment

First of all, we want to be in control of our software. We use Git(hub) to do version management. We use git flow strategy. We have a master branch that holds the code of the latest stable release. Then we have a development branch that holds the latest added features and bugfixes. We want this branch to be stable too. It must be buildable at all times, and no half-on-its-way functionality should be in it. For new features or other issues, we use feature branches. These branches are work in progress. They might be buildable, or they might not. Feature branches should be used for work in progress only. This keeps the amount of branches manageable. Tags can be created for all kind of other reference purposes to specific commits.

circle-info

To learn more about Git, head over to .

hashtag
Automatic build & test

We use to build and test the code whenever a commit is done on github. Github actions is pretty well . Our specific code can be found in the repository at the designated directory: .github/workflows/ .

this documentationarrow-up-right
github actionsarrow-up-right
documentedarrow-up-right

Github packages

hashtag
Querying packages using Github's GraphQL API

  • The query below returns a list of all packages and package versions pushed to github repo of Ampersand

  • The packages api is still in development, therefore you must include a HTTP Accept header to indicate you want to use this feature

  • Make sure the right access right are set for your personal access token. Inluding read repo + read/write packages

    POST https://api.github.com/graphql

headers: >

body (grapql query):

hashtag
Deleting specific packages

NOTE! Doesn't work with public packages, like we have

POST https://api.github.com/graphql

headers: >

body (graphql query) >

Content-Type: application/json
Authorization: bearer [put your personal access token here]
Accept: application/vnd.github.packages-preview+json
{
    "query": "query {
        viewer { login }
        repository(name: \"ampersand\", owner: \"ampersandtarski\") {
            id
            packages (first: 10) {
                nodes {
                    id
                    name
                    versions (first: 100) {
                        nodes {
                            id version
                        }
                    }
                }
            }
        }
    }"
}
Content-Type: application/json
Authorization: bearer [put your personal access token here]
Accept: application/vnd.github.package-deletes-preview+json
{ "query" : "mutation { deletePackageVersion(input:{packageVersionId:\"[package-version-id]==\"}) { success }}" }