Skip to content
Permalink
Browse files

Deleted templates that are no longer needed and move files/folders to…

… the app directory
  • Loading branch information
kylekirkby committed Feb 7, 2020
1 parent 9b31810 commit 96dd26fe7f257a520d8e030e2aa090b758a43e7a
@@ -77,9 +77,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \

# Should map user for this
WORKDIR /app
COPY main.py /app
COPY assets /app/assets

COPY app /app

ENV ENV="/app:${PATH}"

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -14,17 +14,26 @@

SECRETS_FILE_NAME = "client_secret_366864391624-r9itbj1gr1s08st22nknlgvemt056auv.apps.googleusercontent.com.json"


def create_new_resources_json_file(json_data):
for session in json_data.values():
print(session["session_id"])

def create_jekyll_posts(post_tool, json_data, connect_code):

for session in json_data.values():
session_image = {
"path": "/assets/images/featured-images/{}/{}.png".format(connect_code.lower(), session["session_id"]),
"featured": "true"
}
try:
speakers = session["speakers"]
except Exception as e:
speakers = "None"
post_frontmatter = {
"title": session["session_id"] + " - " + session["name"],
"session_id": session["session_id"],
"session_speakers": session["speakers"],
"session_speakers": speakers,
# "description": "{}".format(session["abstract"]).replace("'", ""),
"image": session_image,
"tags": session["event_type"],
@@ -42,14 +51,13 @@ def generate_images(social_image_generator, json_data):

for session in json_data.values():
try:
for speaker in session["speakers"]:
speaker_avatar_url = speaker["avatar"]
if len(speaker_avatar_url) < 3:
speaker_image = "placeholder.jpg"
else:
file_name = social_image_generator.grab_photo(
speaker_avatar_url, slugify(speaker["name"]))
speaker_image = file_name#
speaker_avatar_url = session["speakers"][0]["avatar"]
if len(speaker_avatar_url) < 3:
speaker_image = "placeholder.jpg"
else:
file_name = social_image_generator.grab_photo(
speaker_avatar_url, slugify(session["speakers"][0]["name"]))
speaker_image = file_name
session_speakers = session["speakers"][0]["name"]
except Exception as e:
print("{} has no speakers".format(session["name"]))
@@ -224,13 +232,15 @@ def daily_tasks(self):
print("Daily Connect Automation Tasks starting...")
## Get the Sched Sessions data.
json_data = self.sched_data_interface.getSessionsData()
# print("Creating Jekyll Posts...")
# post_tool = JekyllPostTool(
# self.environment_variables["bamboo_sched_password"], self.environment_variables["bamboo_sched_password"], self.environment_variables["bamboo_connect_uid"] + "/")
# create_jekyll_posts(post_tool, json_data, self.environment_variables["bamboo_connect_uid"])
print("Creating new resources.json file...")
create_new_resources_json_file(json_data)
print("Creating Jekyll Posts...")
post_tool = JekyllPostTool(
{"output": "work_dir/posts/"}, verbose=True)
create_jekyll_posts(post_tool, json_data, self.environment_variables["bamboo_connect_uid"])
print("Generating Social Media Share Images...")
social_image_generator = SocialImageGenerator(
{"output": "output", "template": "assets/templates/bud20-placeholder.jpg"})
{"output": "work_dir/images/", "template": "assets/templates/bud20-placeholder.jpg"})
generate_images(social_image_generator, json_data)
# print("Collecting Presentations from Sched...")
# SchedPresentationTool(self.environment_variables["bamboo_sched_password"], "san19")
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 96dd26f

Please sign in to comment.
You can’t perform that action at this time.