-
Notifications
You must be signed in to change notification settings - Fork 1
/
upload-to-s3.sh
executable file
·34 lines (29 loc) · 1.25 KB
/
upload-to-s3.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# AWS user credentials
export AWS_ACCESS_KEY_ID=MyAccessKey
export AWS_SECRET_ACCESS_KEY=MySecretKey
export AWS_DEFAULT_REGION=eu-central-1
export AWS_S3_BUCKET="yourbucket"
# Anope version
ANOPE_VERSION="2.0.2"
# UnrealIRCd version
UNREAL_VERSION="unrealircd-4.0.0-rc3"
# Handle the install scripts
echo "> Uploading install scripts to S3"
aws s3 cp install/install-unrealircd.sh s3://$AWS_S3_BUCKET/install/install-unrealircd.sh
aws s3 cp install/install-anope.sh s3://$AWS_S3_BUCKET/install/install-anope.sh
# Handle the configuration files
echo "> Tar and gzip the config files" \
&& cd config \
&& tar -czf $UNREAL_VERSION-conf.tar.gz unrealircd-conf \
&& tar -czf anope-$ANOPE_VERSION-conf.tar.gz anope-conf \
&& cd .. \
&& mv config/$UNREAL_VERSION-conf.tar.gz . \
&& mv config/anope-$ANOPE_VERSION-conf.tar.gz . \
&& echo "> Uploading configuration files to S3" \
&& aws s3 cp $UNREAL_VERSION-conf.tar.gz s3://$AWS_S3_BUCKET/config/$UNREAL_VERSION-conf.tar.gz \
&& aws s3 cp anope-$ANOPE_VERSION-conf.tar.gz s3://$AWS_S3_BUCKET/config/anope-$ANOPE_VERSION-conf.tar.gz \
&& echo "> Cleaning up tar.gz files" \
&& rm $UNREAL_VERSION-conf.tar.gz \
&& rm anope-$ANOPE_VERSION-conf.tar.gz \
&& echo "> Done!"