Add chat scripts and update propagation for amis

This commit is contained in:
Neil Hanlon 2022-05-26 00:24:36 -04:00
parent 38e0af2e34
commit 550526f535
Signed by untrusted user: neil
GPG Key ID: 705BC21EC3C70F34
4 changed files with 31 additions and 3 deletions

2
chat/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.envrc

1
chat/common Normal file
View File

@ -0,0 +1 @@
SERVICE_ID=7mRT77Q5CL2BNpM5zxse2v

View File

@ -0,0 +1,25 @@
#!/bin/bash
version=$1
if [[ -z "$1" ]]; then
printf "usage: $0 mmversion\n"; exit 2
fi
#tmpdir=$(mktemp -d)
tmpdir=/tmp/
outfile="${tmpdir}/mattermost-${version}.tar.gz"
if [[ ! -f "${outfile}" ]]; then
curl -Lo "$outfile" "https://releases.mattermost.com/${version}/mattermost-${version}-linux-amd64.tar.gz" || exit 1
fi
outdir="${tmpdir}mattermost-${version}/"
if [[ ! -d "${outdir}" ]]; then
mkdir "${outdir}"
fi
tar --strip-components 2 -C "${outdir}" -xvf "$outfile" mattermost/client
echo "Wrote to ${outdir}"

View File

@ -1,7 +1,7 @@
#!/bin/bash
source_ami="$1"
source_region="$2"
source_region="${2:-us-east-1}"
if [[ -z $source_ami || -z $source_region ]]; then
echo "usage: $0 source_ami source_region"
@ -69,7 +69,7 @@ function change_privacy(){
aws --profile resf-ami ec2 modify-image-attribute \
--region $region \
--image-id "${ami_ids[$region]}" \
--launch-permission "${launch_permission}"
--launch-permission "${launch_permission}" 2>/dev/null
if [[ $? -eq 0 ]]; then
unset ami_ids[$region]
echo ". Done"
@ -119,4 +119,4 @@ function find_image_by_name(){
declare -A ami_ids
copy
#change_privacy Public # uses ami_ids
change_privacy Public # uses ami_ids