Skip to content
This repository has been archived by the owner on May 31, 2024. It is now read-only.

Commit

Permalink
build: Revamp build and release process (#127)
Browse files Browse the repository at this point in the history
We are updating our build pipeline to better automate the release process. This requires a few build related changes in our source code.
  • Loading branch information
tneely authored Nov 1, 2021
1 parent 1aef83b commit ac10580
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 82 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/github-pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ name: github pages

on:
workflow_dispatch: # Allow manual triggering of the action
release:
types: [published]


jobs:
Expand All @@ -13,6 +15,8 @@ jobs:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v2
with:
ref: 'release'

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2 # see /~https://github.com/peaceiris/actions-hugo for details
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ venv
coverage.out
vendor
/docs/
/site/content/en/docs/Reference/agc*
/site/content/en/docs/Reference/agc*
/dist/
1 change: 1 addition & 0 deletions .versionrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"infile": "CHANGELOG.md",
"packageFiles": [
{
"filename": "version.json",
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

All notable changes to this project will be documented in this file. See [standard-version](/~https://github.com/conventional-changelog/standard-version) for commit guidelines.

## 1.0.1 (2021-10-01)

### Bug Fixes

* Updated documentation
* Scoped down engine IAM permissions
* Improved error messages

## 1.0.0 (2021-09-26)

### Features

* First release!
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ build-cli:
(cd packages/cli; $(MAKE) build)

release: release-cli release-cdk
./scripts/package-release.sh

release-cli:
(cd packages/cli; $(MAKE) release)
Expand All @@ -43,4 +44,4 @@ clean-docs:
start-docs: build-cli
packages/cli/bin/local/agc --docs site/content/en/docs/Reference/
git submodule update --init --recursive
cd site && npm install && hugo server -D
cd site && npm install && hugo server -D
25 changes: 3 additions & 22 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,23 @@ version: 0.2

env:
shell: bash
variables:
# These variables should be over-ridden as appropriate by the CI/CD pipeline
BUCKET_NAME: "healthai-public-assets-us-east-1"
WES_ECR_TAG: ""
CROMWELL_ECR_TAG: ""
NEXTFLOW_ECR_TAG: ""

phases:
install:
commands:
- (cd ~/.goenv; git pull)
- goenv install
- go env -w GOPROXY=direct
- make init
pre_build:
commands:
- make test
- SEMANTIC_VERSION=$(./scripts/version.sh "$BUCKET_NAME")
- echo "Using semantic version '${SEMANTIC_VERSION}'"
- ./scripts/update-tags.sh
build:
on-failure: ABORT
commands:
- make release
post_build:
commands:
# Package Amazon Genomics CLI
- mkdir -p tmp
- cp -a scripts/cli/. tmp
- cp -a examples tmp
- cp -a packages/cli/bin/local/. tmp
- cp packages/cdk/cdk.tgz tmp
- cp LICENSE tmp
- cp THIRD-PARTY tmp
- mkdir -p amazon-genomics-cli amazon-genomics-cli/$SEMANTIC_VERSION
- (cd tmp && zip -r ../amazon-genomics-cli/$SEMANTIC_VERSION/amazon-genomics-cli.zip ./*)

artifacts:
files:
- "amazon-genomics-cli/**/*"
- '**/*'
base-directory: dist
11 changes: 7 additions & 4 deletions bump.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#!/bin/bash

set -eo pipefail

#----------------------------------------------------------------------------------------------------------
#
# This script is intended to be used to bump up the version of the AGC modules for minor and patch releases
# ----------------------------------------------------------------------------------------------------------

releaseAs=${1:-}
if [ "${releaseAs}" != "minor" ] || [ "${releaseAs}" != "patch" ]; then
echo "usage: ./bump.sh minor or patch. Defaulting to a minor release"
releaseAs="${1:-minor}"
releaseAs=${1:-minor}
if [ "${releaseAs}" != "minor" ] && [ "${releaseAs}" != "patch" ]; then
echo "usage: ./bump.sh minor or patch. Major version bumps will require more intention."
exit 1
fi

echo "Releasing a $releaseAs version bump..."
npx standard-version --release-as "$releaseAs"
11 changes: 8 additions & 3 deletions packages/cli/internal/pkg/environment/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import (
const DefaultEcrRegistry = "555741984805"
const DefaultEcrRegion = "us-east-1"

// TODO: Implement better tag versioning system
const DefaultCromwellTag = "2021-10-01T21-33-26Z"
const DefaultNextflowTag = "2021-10-01T21-33-26Z"
const DefaultWesTag = "2021-10-01T21-33-26Z"

const WesImageKey = "WES"
const CromwellImageKey = "CROMWELL"
const NextflowImageKey = "NEXTFLOW"
Expand All @@ -18,19 +23,19 @@ var CommonImages = map[string]ecr.ImageReference{
RegistryId: LookUpEnvOrDefault("ECR_WES_ACCOUNT_ID", DefaultEcrRegistry),
Region: LookUpEnvOrDefault("ECR_WES_REGION", DefaultEcrRegion),
RepositoryName: "agc-wes-adapter-cromwell",
ImageTag: LookUpEnvOrDefault("ECR_WES_TAG", "WES_ECR_TAG_PLACEHOLDER"),
ImageTag: LookUpEnvOrDefault("ECR_WES_TAG", DefaultWesTag),
},
CromwellImageKey: {
RegistryId: LookUpEnvOrDefault("ECR_CROMWELL_ACCOUNT_ID", DefaultEcrRegistry),
Region: LookUpEnvOrDefault("ECR_CROMWELL_REGION", DefaultEcrRegion),
RepositoryName: "cromwell",
ImageTag: LookUpEnvOrDefault("ECR_CROMWELL_TAG", "CROMWELL_ECR_TAG_PLACEHOLDER"),
ImageTag: LookUpEnvOrDefault("ECR_CROMWELL_TAG", DefaultCromwellTag),
},
NextflowImageKey: {
RegistryId: LookUpEnvOrDefault("ECR_NEXTFLOW_ACCOUNT_ID", DefaultEcrRegistry),
Region: LookUpEnvOrDefault("ECR_NEXTFLOW_REGION", DefaultEcrRegion),
RepositoryName: "nextflow",
ImageTag: LookUpEnvOrDefault("ECR_NEXTFLOW_TAG", "NEXTFLOW_ECR_TAG_PLACEHOLDER"),
ImageTag: LookUpEnvOrDefault("ECR_NEXTFLOW_TAG", DefaultNextflowTag),
},
}

Expand Down
22 changes: 22 additions & 0 deletions scripts/package-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -eo pipefail

RELEASE_DIR="dist"

mkdir -p ${RELEASE_DIR}
cp ./{LICENSE,THIRD-PARTY,CHANGELOG.md} ${RELEASE_DIR}
cp packages/cdk/cdk.tgz ${RELEASE_DIR}
cp -a scripts/cli/. ${RELEASE_DIR}
cp -a examples ${RELEASE_DIR}
cp -a packages/cli/bin/local/. ${RELEASE_DIR}
version=$(jq .version -r < version.json)
commit="${CODEBUILD_RESOLVED_SOURCE_VERSION:-$(git rev-parse --verify HEAD)}"

cat > ${RELEASE_DIR}/build.json <<HERE
{
"name": "amazon-genomics-cli",
"version": "${version}",
"commit": "${commit}"
}
HERE
20 changes: 0 additions & 20 deletions scripts/update-tags.sh

This file was deleted.

31 changes: 0 additions & 31 deletions scripts/version.sh

This file was deleted.

0 comments on commit ac10580

Please sign in to comment.