mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 07:52:43 +00:00
Move from the mdillon postgis image to postgis/postgis
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
bda7401943
commit
4169db1e73
2 changed files with 19 additions and 16 deletions
|
@ -16,7 +16,7 @@ variables:
|
||||||
# DB Variables for Postgres / Postgis
|
# DB Variables for Postgres / Postgis
|
||||||
POSTGRES_DB: mobilizon_test
|
POSTGRES_DB: mobilizon_test
|
||||||
POSTGRES_USER: postgres
|
POSTGRES_USER: postgres
|
||||||
POSTGRES_PASSWORD: ""
|
POSTGRES_PASSWORD: postgres
|
||||||
POSTGRES_HOST: postgres
|
POSTGRES_HOST: postgres
|
||||||
# DB Variables for Mobilizon
|
# DB Variables for Mobilizon
|
||||||
MOBILIZON_DATABASE_USERNAME: $POSTGRES_USER
|
MOBILIZON_DATABASE_USERNAME: $POSTGRES_USER
|
||||||
|
@ -104,11 +104,12 @@ exunit-1.11:
|
||||||
stage: test
|
stage: test
|
||||||
image: tcitworld/mobilizon-ci:legacy
|
image: tcitworld/mobilizon-ci:legacy
|
||||||
services:
|
services:
|
||||||
- name: mdillon/postgis:11
|
- name: postgis/postgis:11-3.0
|
||||||
alias: postgres
|
alias: postgres
|
||||||
variables:
|
variables:
|
||||||
MIX_ENV: test
|
MIX_ENV: test
|
||||||
before_script:
|
before_script:
|
||||||
|
- mix deps.clean --all
|
||||||
- mix deps.get
|
- mix deps.get
|
||||||
- mix ecto.create
|
- mix ecto.create
|
||||||
- mix ecto.migrate
|
- mix ecto.migrate
|
||||||
|
@ -119,7 +120,7 @@ exunit-1.11:
|
||||||
exunit:
|
exunit:
|
||||||
stage: test
|
stage: test
|
||||||
services:
|
services:
|
||||||
- name: mdillon/postgis:13
|
- name: postgis/postgis:13-3.1
|
||||||
alias: postgres
|
alias: postgres
|
||||||
variables:
|
variables:
|
||||||
MIX_ENV: test
|
MIX_ENV: test
|
||||||
|
@ -156,7 +157,7 @@ jest:
|
||||||
# cypress:
|
# cypress:
|
||||||
# stage: test
|
# stage: test
|
||||||
# services:
|
# services:
|
||||||
# - name: mdillon/postgis:11
|
# - name: postgis/postgis:13.3
|
||||||
# alias: postgres
|
# alias: postgres
|
||||||
# variables:
|
# variables:
|
||||||
# MIX_ENV=e2e
|
# MIX_ENV=e2e
|
||||||
|
|
|
@ -14,16 +14,18 @@ defmodule Mobilizon.Service.MetadataTest do
|
||||||
test "that is a group gives tags" do
|
test "that is a group gives tags" do
|
||||||
%Actor{} = group = insert(:group, name: "My group")
|
%Actor{} = group = insert(:group, name: "My group")
|
||||||
|
|
||||||
# {group.name} (@#{group.preferred_username})" property="og:title"><meta content="#{group.url}" property="og:url"><meta content="The event organizer didn't add any description." property="og:description"><meta content="profile" property="og:type"><meta content="#{group.preferred_username}" property="profile:username"><meta content="summary" property="twitter:card"><meta content="#{group.avatar.url}" property="og:image"><script type="application/ld+json">{"@context":"http://schema.org","@type":"Organization","address":null,"name":"#{group.name}","url":"#{group.url}"}</script><link href="#{Routes.feed_url(Endpoint, :actor, group.preferred_username, "atom")}" rel="alternate" title="#{group.name}'s feed" type="application/atom+xml"><link href="#{Routes.feed_url(Endpoint, :actor, group.preferred_username, "ics")}" rel="alternate" title="#{group.name}'s feed" type="text/calendar">"
|
|
||||||
assert group |> Metadata.build_tags() |> Metadata.Utils.stringify_tags() ==
|
assert group |> Metadata.build_tags() |> Metadata.Utils.stringify_tags() ==
|
||||||
"<meta content="
|
String.trim("""
|
||||||
|
<meta content="#{group.name} (@#{group.preferred_username})" property="og:title"><meta content="#{group.url}" property="og:url"><meta content="The event organizer didn't add any description." property="og:description"><meta content="profile" property="og:type"><meta content="#{group.preferred_username}" property="profile:username"><meta content="summary" property="twitter:card"><meta content="#{group.avatar.url}" property="og:image"><script type="application/ld+json">{"@context":"http://schema.org","@type":"Organization","address":null,"name":"#{group.name}","url":"#{group.url}"}</script><link href="#{Routes.feed_url(Endpoint, :actor, group.preferred_username, "atom")}" rel="alternate" title="#{group.name}'s feed" type="application/atom+xml"><link href="#{Routes.feed_url(Endpoint, :actor, group.preferred_username, "ics")}" rel="alternate" title="#{group.name}'s feed" type="text/calendar">
|
||||||
|
""")
|
||||||
|
|
||||||
# {group.name} (@#{group.preferred_username})" property="og:title"><meta content="#{group.url}" property="og:url"><meta content="The event organizer didn't add any description." property="og:description"><meta content="profile" property="og:type"><meta content="#{group.preferred_username}" property="profile:username"><meta content="summary" property="twitter:card"><script type="application/ld+json">{"@context":"http://schema.org","@type":"Organization","address":null,"name":"#{group.name}","url":"#{group.url}"}</script><link href="#{Routes.feed_url(Endpoint, :actor, group.preferred_username, "atom")}" rel="alternate" title="#{group.name}'s feed" type="application/atom+xml"><link href="#{Routes.feed_url(Endpoint, :actor, group.preferred_username, "ics")}" rel="alternate" title="#{group.name}'s feed" type="text/calendar">"
|
|
||||||
assert group
|
assert group
|
||||||
|> Map.put(:avatar, nil)
|
|> Map.put(:avatar, nil)
|
||||||
|> Metadata.build_tags()
|
|> Metadata.build_tags()
|
||||||
|> Metadata.Utils.stringify_tags() ==
|
|> Metadata.Utils.stringify_tags() ==
|
||||||
"<meta content="
|
String.trim("""
|
||||||
|
<meta content="#{group.name} (@#{group.preferred_username})" property="og:title"><meta content="#{group.url}" property="og:url"><meta content="The event organizer didn't add any description." property="og:description"><meta content="profile" property="og:type"><meta content="#{group.preferred_username}" property="profile:username"><meta content="summary" property="twitter:card"><script type="application/ld+json">{"@context":"http://schema.org","@type":"Organization","address":null,"name":"#{group.name}","url":"#{group.url}"}</script><link href="#{Routes.feed_url(Endpoint, :actor, group.preferred_username, "atom")}" rel="alternate" title="#{group.name}'s feed" type="application/atom+xml"><link href="#{Routes.feed_url(Endpoint, :actor, group.preferred_username, "ics")}" rel="alternate" title="#{group.name}'s feed" type="text/calendar">
|
||||||
|
""")
|
||||||
end
|
end
|
||||||
|
|
||||||
test "that is not a group doesn't give anything" do
|
test "that is not a group doesn't give anything" do
|
||||||
|
@ -47,17 +49,17 @@ defmodule Mobilizon.Service.MetadataTest do
|
||||||
assert event
|
assert event
|
||||||
|> Metadata.build_tags()
|
|> Metadata.build_tags()
|
||||||
|> Metadata.Utils.stringify_tags() ==
|
|> Metadata.Utils.stringify_tags() ==
|
||||||
"""
|
String.trim("""
|
||||||
<title>#{event.title} - Mobilizon</title><meta content="#{event.description}" name="description"><meta content="#{event.title}" property="og:title"><meta content="#{event.url}" property="og:url"><meta content="#{event.description}" property="og:description"><meta content="website" property="og:type"><link href="#{event.url}" rel="canonical"><meta content="#{event.picture.file.url}" property="og:image"><meta content="summary_large_image" property="twitter:card"><script type="application/ld+json">{"@context":"https://schema.org","@type":"Event","description":"#{String.replace(event.description, a, b)}","endDate":"#{DateTime.to_iso8601(event.ends_on)}","eventStatus":"https://schema.org/EventScheduled","image":["#{event.picture.file.url}"],"location":{"@type":"Place","address":{"@type":"PostalAddress","addressCountry":"My Country","addressLocality":"My Locality","addressRegion":"My Region","postalCode":"My Postal Code","streetAddress":"My Street Address"},"name":"#{event.physical_address.description}"},"name":"#{event.title}","organizer":{"@type":"Person","name":"#{event.organizer_actor.preferred_username}"},"performer":{"@type":"Person","name":"#{event.organizer_actor.preferred_username}"},"startDate":"#{DateTime.to_iso8601(event.begins_on)}"}</script>
|
<title>#{event.title} - Mobilizon</title><meta content="#{event.description}" name="description"><meta content="#{event.title}" property="og:title"><meta content="#{event.url}" property="og:url"><meta content="#{event.description}" property="og:description"><meta content="website" property="og:type"><link href="#{event.url}" rel="canonical"><meta content="#{event.picture.file.url}" property="og:image"><meta content="summary_large_image" property="twitter:card"><script type="application/ld+json">{"@context":"https://schema.org","@type":"Event","description":"#{String.replace(event.description, a, b)}","endDate":"#{DateTime.to_iso8601(event.ends_on)}","eventStatus":"https://schema.org/EventScheduled","image":["#{event.picture.file.url}"],"location":{"@type":"Place","address":{"@type":"PostalAddress","addressCountry":"My Country","addressLocality":"My Locality","addressRegion":"My Region","postalCode":"My Postal Code","streetAddress":"My Street Address"},"name":"#{event.physical_address.description}"},"name":"#{event.title}","organizer":{"@type":"Person","name":"#{event.organizer_actor.preferred_username}"},"performer":{"@type":"Person","name":"#{event.organizer_actor.preferred_username}"},"startDate":"#{DateTime.to_iso8601(event.begins_on)}"}</script>
|
||||||
"""
|
""")
|
||||||
|
|
||||||
assert event
|
assert event
|
||||||
|> Map.put(:picture, nil)
|
|> Map.put(:picture, nil)
|
||||||
|> Metadata.build_tags()
|
|> Metadata.build_tags()
|
||||||
|> Metadata.Utils.stringify_tags() ==
|
|> Metadata.Utils.stringify_tags() ==
|
||||||
"""
|
String.trim("""
|
||||||
<title>#{event.title} - Mobilizon</title><meta content="#{event.description}" name="description"><meta content="#{event.title}" property="og:title"><meta content="#{event.url}" property="og:url"><meta content="#{event.description}" property="og:description"><meta content="website" property="og:type"><link href="#{event.url}" rel="canonical"><meta content="summary_large_image" property="twitter:card"><script type="application/ld+json">{"@context":"https://schema.org","@type":"Event","description":"#{String.replace(event.description, a, b)}","endDate":"#{DateTime.to_iso8601(event.ends_on)}","eventStatus":"https://schema.org/EventScheduled","image":["#{"#{Endpoint.url()}/img/mobilizon_default_card.png"}"],"location":{"@type":"Place","address":{"@type":"PostalAddress","addressCountry":"My Country","addressLocality":"My Locality","addressRegion":"My Region","postalCode":"My Postal Code","streetAddress":"My Street Address"},"name":"#{event.physical_address.description}"},"name":"#{event.title}","organizer":{"@type":"Person","name":"#{event.organizer_actor.preferred_username}"},"performer":{"@type":"Person","name":"#{event.organizer_actor.preferred_username}"},"startDate":"#{DateTime.to_iso8601(event.begins_on)}"}</script>
|
<title>#{event.title} - Mobilizon</title><meta content="#{event.description}" name="description"><meta content="#{event.title}" property="og:title"><meta content="#{event.url}" property="og:url"><meta content="#{event.description}" property="og:description"><meta content="website" property="og:type"><link href="#{event.url}" rel="canonical"><meta content="summary_large_image" property="twitter:card"><script type="application/ld+json">{"@context":"https://schema.org","@type":"Event","description":"#{String.replace(event.description, a, b)}","endDate":"#{DateTime.to_iso8601(event.ends_on)}","eventStatus":"https://schema.org/EventScheduled","image":["#{"#{Endpoint.url()}/img/mobilizon_default_card.png"}"],"location":{"@type":"Place","address":{"@type":"PostalAddress","addressCountry":"My Country","addressLocality":"My Locality","addressRegion":"My Region","postalCode":"My Postal Code","streetAddress":"My Street Address"},"name":"#{event.physical_address.description}"},"name":"#{event.title}","organizer":{"@type":"Person","name":"#{event.organizer_actor.preferred_username}"},"performer":{"@type":"Person","name":"#{event.organizer_actor.preferred_username}"},"startDate":"#{DateTime.to_iso8601(event.begins_on)}"}</script>
|
||||||
"""
|
""")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -68,9 +70,9 @@ defmodule Mobilizon.Service.MetadataTest do
|
||||||
assert post
|
assert post
|
||||||
|> Metadata.build_tags()
|
|> Metadata.build_tags()
|
||||||
|> Metadata.Utils.stringify_tags() ==
|
|> Metadata.Utils.stringify_tags() ==
|
||||||
"""
|
String.trim("""
|
||||||
<meta content="#{post.title}" property="og:title"><meta content="#{post.url}" property="og:url"><meta content="#{Metadata.Utils.process_description(post.body)}" property="og:description"><meta content="article" property="og:type"><meta content="summary" property="twitter:card"><link href="#{post.url}" rel="canonical"><meta content="#{post.picture.file.url}" property="og:image"><meta content="summary_large_image" property="twitter:card"><script type="application/ld+json">{"@context":"https://schema.org","@type":"Article","author":{"@type":"Organization","name":"#{post.attributed_to.preferred_username}"},"dateModified":"#{DateTime.to_iso8601(post.updated_at)}","datePublished":"#{DateTime.to_iso8601(post.publish_at)}","name":"My Awesome article"}</script>
|
<meta content="#{post.title}" property="og:title"><meta content="#{post.url}" property="og:url"><meta content="#{Metadata.Utils.process_description(post.body)}" property="og:description"><meta content="article" property="og:type"><meta content="summary" property="twitter:card"><link href="#{post.url}" rel="canonical"><meta content="#{post.picture.file.url}" property="og:image"><meta content="summary_large_image" property="twitter:card"><script type="application/ld+json">{"@context":"https://schema.org","@type":"Article","author":{"@type":"Organization","name":"#{post.attributed_to.preferred_username}"},"dateModified":"#{DateTime.to_iso8601(post.updated_at)}","datePublished":"#{DateTime.to_iso8601(post.publish_at)}","name":"My Awesome article"}</script>
|
||||||
"""
|
""")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -81,9 +83,9 @@ defmodule Mobilizon.Service.MetadataTest do
|
||||||
assert comment
|
assert comment
|
||||||
|> Metadata.build_tags()
|
|> Metadata.build_tags()
|
||||||
|> Metadata.Utils.stringify_tags() ==
|
|> Metadata.Utils.stringify_tags() ==
|
||||||
"""
|
String.trim("""
|
||||||
<meta content="#{comment.actor.preferred_username}" property="og:title"><meta content="#{comment.url}" property="og:url"><meta content="#{comment.text}" property="og:description"><meta content="website" property="og:type"><meta content="summary" property="twitter:card">
|
<meta content="#{comment.actor.preferred_username}" property="og:title"><meta content="#{comment.url}" property="og:url"><meta content="#{comment.text}" property="og:description"><meta content="website" property="og:type"><meta content="summary" property="twitter:card">
|
||||||
"""
|
""")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue