-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π οΈ Improve docker scripts β Fix recover job β Fix Environment tests
- Loading branch information
Showing
14 changed files
with
144 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
build/ | ||
.build/ | ||
.build_* | ||
|
||
*.pbxuser | ||
!default.pbxuser | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
check_version() { | ||
if [[ ! -d "./$project.xcodeproj" ]] ; then | ||
echo "π€ Script must be run in project directory ..."; exit 1 | ||
fi | ||
if [[ ! $version =~ ^[0-9]+(\.[0-9]+){2,2}(\-RC[0-9]+){0,1}$ ]]; | ||
then | ||
echo "π€ Script must be run with version number as argument ..."; exit 1 | ||
fi | ||
} | ||
|
||
check_version_and_mode() { | ||
if [[ ! -d "./$project.xcodeproj" ]] ; then | ||
echo "π€ Script must be run in project directory ..."; exit 1 | ||
fi | ||
if [[ ! $version =~ ^[0-9]+(\.[0-9]+){2,2}(\-RC[0-9]+){0,1}$ ]]; | ||
then | ||
echo "π€ Script must be run with version number as first argument ..."; exit 1 | ||
fi | ||
if [[ ! $mode =~ ^prod|dev$ ]] ; then | ||
echo "π€ Script must be run with mode (prod, dev) as second argument ..."; exit 1 | ||
fi | ||
} | ||
|
||
docker_build_swift () { | ||
echo "π³ BUILDING IMAGE: Swift for $project" | ||
|
||
docker_in="$(cat <<-EOF | ||
FROM swift:5.1.4 | ||
RUN apt-get -qq update \ | ||
&& apt-get -q -y install \ | ||
libssl-dev \ | ||
openssl \ | ||
tzdata \ | ||
zlib1g-dev \ | ||
&& rm -r /var/lib/apt/lists/* | ||
RUN mkdir -p /build/lib && cp -R /usr/lib/swift/linux/lib* /build/lib | ||
EOF | ||
)" | ||
out=$(echo "$docker_in" | docker build - -t "$label:swift" 2>&1) | ||
[ $? -ne 0 ] \ | ||
&& echo "$out" \ | ||
&& echo "β Docker build command failed!" \ | ||
&& exit 1 | ||
|
||
image=$(docker image ls | grep -E "^$label\s+swift " | tr -s ' ' | cut -d' ' -f 1,2,3) | ||
echo "π BUILD IMAGE: $image" | ||
} | ||
|
||
check_image() { | ||
image=$(docker image ls | grep " $1 " | tr -s ' ' | cut -d' ' -f 3) | ||
[ -z "$image" ] \ | ||
&& echo "β Image not found for version $1!" \ | ||
&& echo "π‘ Run build command first ..." \ | ||
&& exit 1 | ||
} | ||
|
||
check_tagged_image() { | ||
image=$(docker image ls | grep "$1\-$2 " | tr -s ' ' | cut -d' ' -f 1,2,3) | ||
[ -z "$image" ] \ | ||
&& echo "β Image not found for label $1 and version $2!" \ | ||
&& echo "π‘ Run build command first ..." \ | ||
&& echo "π‘ Run tag command next ..." \ | ||
&& exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
#!/bin/bash | ||
project=Wishlist | ||
version=$1 | ||
mode=$2 | ||
label=$(echo "$project" | tr "[:upper:]" "[:lower:]") | ||
|
||
echo | ||
|
||
if [[ ! -d "./$project.xcodeproj" ]] ; then | ||
echo "π€ Script must be run in project directory ..."; exit 1 | ||
fi | ||
if [[ ! $version =~ ^[0-9]+(\.[0-9]+){2,2}(\-RC[0-9]+){0,1}$ ]]; | ||
then | ||
echo "π€ Script must be run with version number as first argument ..."; exit 1 | ||
fi | ||
if [[ ! $mode =~ ^prod|dev$ ]] ; then | ||
echo "π€ Script must be run with mode (prod, dev) as second argument ..."; exit 1 | ||
fi | ||
source "./Docker/functions" | ||
check_version_and_mode | ||
|
||
echo "π³ RUNNING Docker compose for project $project with version $version in $mode" | ||
|
||
APPVERSION=$version APPENV=$mode DBHOST=db docker-compose -p $label -f Docker/docker-compose up -d db | ||
sleep 10s | ||
APPVERSION=$version APPENV=$mode DBHOST=db docker-compose -p $label -f Docker/docker-compose up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.