Skip to content

Commit

Permalink
Merge pull request #50 from docksal/develop
Browse files Browse the repository at this point in the history
Release 3.1.0
  • Loading branch information
lmakarov authored Nov 24, 2021
2 parents b819ade + cdad90d commit d1dcfa7
Show file tree
Hide file tree
Showing 6 changed files with 109 additions and 79 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Publish Templates

on:
push:
branches:
- "**"
tags:
- 'v*.*.*'
workflow_dispatch: # Allow manually triggering a build

defaults:
run:
shell: bash

env:
AWS_REGION: us-east-2
AWS_ACCESS_KEY_ID: AKIAIPJXMNOEV65OMURA
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_BUCKET: docksal-aws-templates
UPLOAD_DIR: sandbox-server
LOCAL_DIR: build

jobs:
aws-templates:
name: "Publish: ${{ matrix.template }} template"
runs-on: ubuntu-20.04

strategy:
fail-fast: false # Don't cancel other jobs if one fails
matrix:
template:
- basic
- advanced

steps:
-
name: Checkout
uses: actions/checkout@v2
# -
# name: Environment variables
# run: |
# # Export variables for further steps
# echo "GIT_SHA7=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
# echo "BUILD_CONTEXT=${VERSION:-.}" >> ${GITHUB_ENV}
# echo "BUILD_IMAGE_TAG=${IMAGE}:${VERSION_PREFIX}${VERSION}build" >> ${GITHUB_ENV}
# -
# name: Install AWS CLI
# run: |
# curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
# unzip awscliv2.zip
# sudo ./aws/install
-
name: Build and publish template
env:
TEMPLATE_TYPE: ${{ matrix.template }}
run: |
cd aws-cloudformation && ./scripts/bash2yaml startup-${TEMPLATE_TYPE}.sh tpl-${TEMPLATE_TYPE}.yaml
aws cloudformation package --template-file template.yaml --s3-bucket null --output-template-file package.json --use-json
mkdir -p ${LOCAL_DIR} && mv -f package.json ${LOCAL_DIR}/${TEMPLATE_TYPE}.json
tmp=$(basename $(mktemp -u))
aws s3 cp ${LOCAL_DIR}/${TEMPLATE_TYPE}.json s3://${S3_BUCKET}/${tmp} --acl public-read
res=$(aws cloudformation validate-template --region ${AWS_REGION} --template-url https://${S3_BUCKET}.s3.amazonaws.com/${tmp} || echo "error")
aws s3 rm s3://${S3_BUCKET}/${tmp}
if [ "${res}" == "error" ]; then exit 1; fi
${GITHUB_WORKSPACE}/scripts/upload-to-s3.sh
32 changes: 0 additions & 32 deletions .travis.yml

This file was deleted.

32 changes: 16 additions & 16 deletions aws-cloudformation/tpl-advanced.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,37 +250,37 @@ Metadata:
Mappings:
Region2AMI:
eu-north-1:
AMI: ami-0d4e2b57f569e9daa
AMI: ami-0168b2054d2f38cc1
ap-south-1:
AMI: ami-0c5b1a88222ac79cb
AMI: ami-090609133a86b9723
eu-west-3:
AMI: ami-0e60c6afa19d896ee
AMI: ami-07f75642b87ea58ce
eu-west-2:
AMI: ami-0917237b4e71c5759
AMI: ami-05c94e542948a2807
eu-west-1:
AMI: ami-0dad359ff462124ca
AMI: ami-043847b30c32c01cf
ap-northeast-2:
AMI: ami-0de407404c33d1671
AMI: ami-01e7286e8e09d809f
ap-northeast-1:
AMI: ami-0c1ac8728ef7f87a4
AMI: ami-08455f1340543554c
sa-east-1:
AMI: ami-001c16a3a4f5d85f1
AMI: ami-0d6806446a46f9b9c
ca-central-1:
AMI: ami-08a6203f59f9df866
AMI: ami-07fa365b1f79fcbb1
ap-southeast-1:
AMI: ami-0b8cf0f359b1335e1
AMI: ami-0ff297662c4840aa5
ap-southeast-2:
AMI: ami-0a1a4d97d4af3009b
AMI: ami-0009ba887e00637bd
eu-central-1:
AMI: ami-05c26ae4789875080
AMI: ami-05034a7fcbfe5d5af
us-east-1:
AMI: ami-068663a3c619dd892
AMI: ami-022d4249382309a48
us-east-2:
AMI: ami-0e84e211558a022c0
AMI: ami-03f4121463e28151e
us-west-1:
AMI: ami-075fd582acf0c0128
AMI: ami-0fa12818adfd95e6e
us-west-2:
AMI: ami-09dd2e08d601bff67
AMI: ami-0f81e6e71078b75b6

Conditions:
CreateEC2: !Equals [!Ref ResourceType, "ec2"]
Expand Down
44 changes: 20 additions & 24 deletions aws-cloudformation/tpl-basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@ Parameters:
- t3.large
- t3.xlarge
- t3.2xlarge
- c5.large
- c5.xlarge
- c5.2xlarge
- c5.4xlarge
- m5.large
- m5.xlarge
- m5.2xlarge
- m5.4xlarge
- m5d.large
- m5d.xlarge
- m5d.2xlarge
- m5d.4xlarge
- r5.large
- r5.xlarge
- r5.2xlarge
- r5d.large
- r5d.xlarge
- r5d.2xlarge
ConstraintDescription: "Must be a valid EC2 instance type"
KeyName:
Description: "Name of an existing EC2 KeyPair to enable SSH access to the instance"
Type: "AWS::EC2::KeyPair::KeyName"
Expand Down Expand Up @@ -61,37 +57,37 @@ Metadata:
Mappings:
Region2AMI:
eu-north-1:
AMI: ami-0d4e2b57f569e9daa
AMI: ami-0168b2054d2f38cc1
ap-south-1:
AMI: ami-0c5b1a88222ac79cb
AMI: ami-090609133a86b9723
eu-west-3:
AMI: ami-0e60c6afa19d896ee
AMI: ami-07f75642b87ea58ce
eu-west-2:
AMI: ami-0917237b4e71c5759
AMI: ami-05c94e542948a2807
eu-west-1:
AMI: ami-0dad359ff462124ca
AMI: ami-043847b30c32c01cf
ap-northeast-2:
AMI: ami-0de407404c33d1671
AMI: ami-01e7286e8e09d809f
ap-northeast-1:
AMI: ami-0c1ac8728ef7f87a4
AMI: ami-08455f1340543554c
sa-east-1:
AMI: ami-001c16a3a4f5d85f1
AMI: ami-0d6806446a46f9b9c
ca-central-1:
AMI: ami-08a6203f59f9df866
AMI: ami-07fa365b1f79fcbb1
ap-southeast-1:
AMI: ami-0b8cf0f359b1335e1
AMI: ami-0ff297662c4840aa5
ap-southeast-2:
AMI: ami-0a1a4d97d4af3009b
AMI: ami-0009ba887e00637bd
eu-central-1:
AMI: ami-05c26ae4789875080
AMI: ami-05034a7fcbfe5d5af
us-east-1:
AMI: ami-068663a3c619dd892
AMI: ami-022d4249382309a48
us-east-2:
AMI: ami-0e84e211558a022c0
AMI: ami-03f4121463e28151e
us-west-1:
AMI: ami-075fd582acf0c0128
AMI: ami-0fa12818adfd95e6e
us-west-2:
AMI: ami-09dd2e08d601bff67
AMI: ami-0f81e6e71078b75b6

Resources:
InstanceSecurityGroup:
Expand Down
2 changes: 1 addition & 1 deletion gcp-deployment-manager/templates/docksal_template.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ resources:
boot: true
autoDelete: true
initializeParams:
sourceImage: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2004-focal-v20200610
sourceImage: https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/images/ubuntu-minimal-2004-focal-v20211120
- deviceName: docksal-sandbox-disk-data
source: docksal-sandbox-disk
{% if properties["startup"] or properties["docksalDnsDomain"] %}
Expand Down
13 changes: 7 additions & 6 deletions scripts/upload-to-s3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,29 @@

is_edge ()
{
[[ "${TRAVIS_BRANCH}" == "develop" ]]
[[ "${GITHUB_REF}" == "refs/heads/develop" ]]
}

is_stable ()
{
[[ "${TRAVIS_BRANCH}" == "master" ]]
[[ "${GITHUB_REF}" == "refs/heads/master" ]]
}

is_release ()
{
[[ "${TRAVIS_TAG}" != "" ]]
[[ "${GITHUB_REF}" =~ "refs/tags/" ]]
}

# Check whether the current build is for a pull request
is_pr ()
{
[[ "${TRAVIS_PULL_REQUEST}" != "false" ]]
# GITHUB_HEAD_REF is only set for pull requests
[[ "${GITHUB_HEAD_REF}" != "" ]]
}
# ---------------------------- #

# Extract version parts from release tag
IFS='.' read -a ver_arr <<< "$TRAVIS_TAG"
IFS='.' read -a ver_arr <<< ${GITHUB_REF#refs/tags/}
VERSION_MAJOR=${ver_arr[0]#v*} # 2.7.0 => "2"
VERSION_MINOR=${ver_arr[1]} # "2.7.0" => "7"
VERSION_HOTFIX=${ver_arr[2]} # "2.7.0" => "0"
Expand All @@ -35,7 +36,7 @@ STABLE_UPLOAD_DIR=${UPLOAD_DIR}/stable
RELEASE_UPLOAD_DIR_MAJOR=${UPLOAD_DIR}/v${VERSION_MAJOR}
RELEASE_UPLOAD_DIR_MINOR=${UPLOAD_DIR}/v${VERSION_MAJOR}.${VERSION_MINOR}
RELEASE_UPLOAD_DIR_HOTFIX=${UPLOAD_DIR}/v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_HOTFIX}
BRANCH_UPLOAD_DIR=${UPLOAD_DIR}/branch/${TRAVIS_BRANCH}
BRANCH_UPLOAD_DIR=${UPLOAD_DIR}/branch/${GITHUB_REF#refs/heads/}

# Skip pull request
is_pr && exit 0
Expand Down

0 comments on commit d1dcfa7

Please sign in to comment.