Skip to content

Commit

Permalink
🎁 Add invitation emails
Browse files Browse the repository at this point in the history
☘ fix link to fav icon
☘ fix deletion of reservation for list owner
πŸ› οΈ Major refactoring to implement separation of concerns
  • Loading branch information
edmw committed Jan 5, 2020
1 parent d7279c3 commit 9ebe306
Show file tree
Hide file tree
Showing 446 changed files with 35,453 additions and 17,599 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.env*
Wishlist.xcodeproj
update.rb
update.sh
~nginx
.DS_Store
.dockerignore
.git
.gitignore
18 changes: 17 additions & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
line_length: 100
function_parameter_count: 6
large_tuple:
warning: 3
error: 3
type_name:
min_length:
error: 4
max_length:
warning: 48
error: 60
cyclomatic_complexity:
ignores_case_statements: true
disabled_rules:
- static_operator
- opening_brace
- statement_position
opt_in_rules:
Expand Down Expand Up @@ -67,9 +77,12 @@ type_name:
identifier_name:
min_length:
error: 4
max_length:
error: 48
excluded:
- id
- uid
- lid
- key
- db
- row
Expand All @@ -89,5 +102,8 @@ identifier_name:
- rhs
- cwd
- awd

- map
- min
- max
- nil

17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,26 @@

## [..]
🎁 Add functionality to move items between wishlists

## [1.4.0]
🎁 Add invitation emails
☘ fix link to fav icon
☘ fix deletion of reservation for list owner
πŸ› οΈ Major refactoring to implement separation of concerns

```
CLOC before refactoring:
Language files blank comment code
-------------------------------------------------------------------------------
Swift 226 2684 1523 10227
CLOC after refactoring:
Language files blank comment code
-------------------------------------------------------------------------------
Swift 383 4390 2500 16025
```

## [1.3.3]
☘ fix link to about page
Expand Down
2 changes: 1 addition & 1 deletion Docker/build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version=$1
if [[ ! -d "./Wishlist.xcodeproj" ]] ; then
echo "Script must be run in project directory"; exit 1
fi
if [[ ! $version =~ ^[0-9]+(\.[0-9]+){2,2}$ ]];
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
Expand Down
15 changes: 15 additions & 0 deletions Docker/build.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
version=$1

if [[ ! -d "./Wishlist.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

echo " #### Building Docker image for project Wishlist with version $version"

docker build -f Docker/docker.test -t "wishlist:$version-test" .

14 changes: 8 additions & 6 deletions Docker/docker
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
FROM swift:4.2.4 AS builder
FROM swift:5.1.3 AS builder
RUN apt-get -qq update && apt-get -q -y install \
openssl libssl-dev zlib1g-dev tzdata \
&& rm -r /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN mkdir -p /build/lib && cp -R /usr/lib/swift/linux/*.so /build/lib
RUN mkdir -p /build/lib && cp -R /usr/lib/swift/linux/lib* /build/lib
RUN swift build -Xswiftc -suppress-warnings --product "Wishlist" -c release && mv `swift build -c release --show-bin-path` /build/bin

FROM ubuntu:16.04
FROM ubuntu:18.04
RUN apt-get -qq update && apt-get install -y \
libicu55 libxml2 libbsd0 libcurl3 libatomic1 openssl libssl-dev \
libicu60 libxml2 libbsd0 libcurl4 libatomic1 openssl libssl-dev \
tzdata \
&& rm -r /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /build/bin/Wishlist .
COPY --from=builder /build/lib/* /usr/lib/
COPY --from=builder /app/Public ./Public
COPY --from=builder /app/Resources ./Resources
EXPOSE 12345
RUN groupadd -g 999 appuser && useradd -r -u 999 -g appuser appuser
RUN mkdir ./Public-Images && chown -R appuser:appuser ./Public && chown -R appuser:appuser ./Public-Images && chown -R appuser:appuser ./Resources
USER appuser
ENTRYPOINT ["./Wishlist", "serve", "--hostname", "0.0.0.0", "--port", "12345"]

EXPOSE 12345
9 changes: 9 additions & 0 deletions Docker/docker-compose
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,17 @@ services:
DBPASSWORD: "${DBPASSWORD}"
GOOGLE_CLIENT_ID: "${GOOGLE_CLIENT_ID}"
GOOGLE_CLIENT_SECRET: "${GOOGLE_CLIENT_SECRET}"
NETID_CLIENT_ID: "${NETID_CLIENT_ID}"
NETID_CLIENT_SECRET: "${NETID_CLIENT_SECRET}"
CLOUDIMG_TOKEN: "${CLOUDIMG_TOKEN}"
EMAIL_SMTP_HOSTNAME: "${EMAIL_SMTP_HOSTNAME}"
EMAIL_SMTP_USERNAME: "${EMAIL_SMTP_USERNAME}"
EMAIL_SMTP_PASSWORD: "${EMAIL_SMTP_PASSWORD}"
EMAIL_SENDER_ADDRESS: "${EMAIL_SENDER_ADDRESS}"
EMAIL_SENDER_NAME: "${EMAIL_SENDER_NAME}"
PUSHOVER_APPLICATION_TOKEN: "${PUSHOVER_APPLICATION_TOKEN}"
DEVELOPMENT_LOG_LEVEL: "${DEVELOPMENT_LOG_LEVEL}"
RELEASE_LOG_LEVEL: "${RELEASE_LOG_LEVEL}"
volumes:
- public:/app/Public
- public-images:/app/Public-Images
Expand Down
45 changes: 45 additions & 0 deletions Docker/docker-compose.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
version: "3.3"
services:
app-test:
container_name: wishlist-app-test
image: "wishlist:${APPVERSION}-test"
environment:
SITE_URL: "http://localhost:8080"
SITE_RELEASE: "beta"
SITE_ACCESS: "all"
DBHOST: "${DBHOST}"
DBPORT: "${DBPORT}"
DBNAME: "${DBNAME}"
DBUSERNAME: "${DBUSERNAME}"
DBPASSWORD: "${DBPASSWORD}"
GOOGLE_CLIENT_ID: "${GOOGLE_CLIENT_ID}"
GOOGLE_CLIENT_SECRET: "${GOOGLE_CLIENT_SECRET}"
NETID_CLIENT_ID: "${NETID_CLIENT_ID}"
NETID_CLIENT_SECRET: "${NETID_CLIENT_SECRET}"
CLOUDIMG_TOKEN: "${CLOUDIMG_TOKEN}"
EMAIL_SMTP_HOSTNAME: "${EMAIL_SMTP_HOSTNAME}"
EMAIL_SMTP_USERNAME: "${EMAIL_SMTP_USERNAME}"
EMAIL_SMTP_PASSWORD: "${EMAIL_SMTP_PASSWORD}"
EMAIL_SENDER_ADDRESS: "${EMAIL_SENDER_ADDRESS}"
EMAIL_SENDER_NAME: "${EMAIL_SENDER_NAME}"
PUSHOVER_APPLICATION_TOKEN: "${PUSHOVER_APPLICATION_TOKEN}"
DEVELOPMENT_LOG_LEVEL: "${DEVELOPMENT_LOG_LEVEL}"
RELEASE_LOG_LEVEL: "${RELEASE_LOG_LEVEL}"
links:
- db-test
depends_on:
- db-test
networks:
- web-test
db-test:
container_name: wishlist-db-test
image: mysql:5
environment:
MYSQL_ROOT_PASSWORD: wishlist
MYSQL_USER: wishlist
MYSQL_PASSWORD: wishlist
MYSQL_DATABASE: wishlist
networks:
- web-test
networks:
web-test:
10 changes: 10 additions & 0 deletions Docker/docker.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM swift:5.1.3
RUN apt-get -qq update && apt-get -q -y install \
openssl libssl-dev zlib1g-dev tzdata \
&& rm -r /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN mkdir -p /build/lib && cp -R /usr/lib/swift/linux/lib* /build/lib
RUN swift package resolve
RUN swift package clean
CMD ["swift", "test"]
2 changes: 1 addition & 1 deletion Docker/run
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ mode=$2
if [[ ! -d "./Wishlist.xcodeproj" ]] ; then
echo "Script must be run in project directory"; exit 1
fi
if [[ ! $version =~ ^[0-9]+(\.[0-9]+){2,2}$ ]] ; then
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
Expand Down
14 changes: 14 additions & 0 deletions Docker/run.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
version=$1

if [[ ! -d "./Wishlist.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

echo " #### Running Docker Compose for project Wishlist with version $version"

APPVERSION=$version DBHOST=db-test docker-compose -p wishlist -f Docker/docker-compose.test up --abort-on-container-exit
21 changes: 21 additions & 0 deletions LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import XCTest
@testable import AppTests
@testable import DomainTests
@testable import LibraryTests

XCTMain([
// LibraryTests
testCase(UUIDTests.__allTests),
// DomainTests
testCase(AnnouncementsActorTests.__allTests),
testCase(EnrollmentActorTests.__allTests),
testCase(InvitationTests.__allTests),
testCase(TestingUserRepositoryTests.__allTests),
// AppTests
testCase(DomainModelInvitationTests.__allTests),
testCase(DomainModelItemTests.__allTests),
testCase(DomainModelListTests.__allTests),
testCase(DomainModelReservationTests.__allTests),
testCase(DomainModelUserTests.__allTests),
testCase(RequestLanguageServiceTests.__allTests)
])
25 changes: 8 additions & 17 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
"repositoryURL": "https://github.com/IBM-Swift/BlueSocket.git",
"state": {
"branch": null,
"revision": "f82e1401f04f62b2e8ce4670456d104466957810",
"version": "1.0.50"
"revision": "c46a3d41f5b2401d18bcb46d0101cdc5cd13e307",
"version": "1.0.52"
}
},
{
"package": "SSLService",
"repositoryURL": "https://github.com/IBM-Swift/BlueSSLService.git",
"state": {
"branch": null,
"revision": "d6616def31a12088034f0a63ed4646772eff5bce",
"version": "1.0.50"
"revision": "ab2c2aa2fe574969f391c80ee87746be431dee0e",
"version": "1.0.52"
}
},
{
Expand All @@ -51,8 +51,8 @@
"repositoryURL": "https://github.com/vapor/core.git",
"state": {
"branch": null,
"revision": "18f2436bf7a6bc2224372c0885db2e0159af1649",
"version": "3.9.2"
"revision": "10d33362a47fab03a067e78fb0791341d9c634fa",
"version": "3.9.3"
}
},
{
Expand Down Expand Up @@ -113,8 +113,8 @@
"package": "Imperial",
"repositoryURL": "https://github.com/edmw/Imperial.git",
"state": {
"branch": "netid-fix-1",
"revision": "7370f7bd51fdaa9421dc7204dd0c3fc4e3997821",
"branch": "edmw",
"revision": "f8e1647dc750711de9156a98aaae8258325601a7",
"version": null
}
},
Expand Down Expand Up @@ -253,15 +253,6 @@
"version": "5.1.0"
}
},
{
"package": "SwiftDate",
"repositoryURL": "https://github.com/malcommac/SwiftDate.git",
"state": {
"branch": null,
"revision": "ed308a5afb97a3874300b761dad6e9966269e3e7",
"version": "5.1.0"
}
},
{
"package": "TemplateKit",
"repositoryURL": "https://github.com/vapor/template-kit.git",
Expand Down
Loading

0 comments on commit 9ebe306

Please sign in to comment.