diff --git a/.gitignore b/.gitignore index f27c618..4e349b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -www/*.html -www/*_events.json -www/node_modules +js/node_modules diff --git a/README.md b/README.md index 4ecfb96..c83218d 100644 --- a/README.md +++ b/README.md @@ -18,21 +18,31 @@ A lot of great stuff is happening in Sophia: Some people ask about a place that lists them all... here is a simple attempt that tries to answer this need. -## How to run it +## Want to help making this website look better ? :) + +Fell free to modify it and to submit a PR. ### Clone de repository ``` -$ git clone https://github.com/lucj/sophia.events.git +$ git clone https://github.com/lucj/sophia.events.git && cd sophia.events ``` -### Run the wrapper scrip +### Run stack + +This assumes you have [Docker](https://www.docker.com/community-edition#/download) / [Docker Compose](https://docs.docker.com/compose/install/) installed on your machine ``` -$ cd www && ./test.sh +$ docker-compose up -d ``` -A web server is run in a Docker container. The port to use is provided at the end of the output. +A web server is run in a Docker container available on port 8000. + +### Modify the files + +Fell free to modify the css / html. + +Once you'r happy with your changes you can report the modifications of the html in the *template/index.mustache* file. ## Status diff --git a/bin/build.sh b/bin/build.sh new file mode 100755 index 0000000..81a83d9 --- /dev/null +++ b/bin/build.sh @@ -0,0 +1,20 @@ +# Copy resources needed in the image build phase +cp ../template/index.mustache ../data/*.* ../www/ + +# Build image +cd ../www +docker image build -t lucj/sophia.events . + +# Run website +ID=$(docker run -d -p 80 lucj/sophia.events) + +# Copy generated index.html and past.html locally +docker cp $ID:/usr/share/nginx/html/index.html . +docker cp $ID:/usr/share/nginx/html/past.html . + +# Remove files used for image build +rm index.mustache events.json clean_events.js package.json + +# Get port +PORT=$(docker inspect --format '{{ (index (index .NetworkSettings.Ports "80/tcp") 0).HostPort }}' $ID) +echo "=> web site available on http://localhost:$PORT" diff --git a/www/update.sh b/bin/deploy.sh similarity index 71% rename from www/update.sh rename to bin/deploy.sh index b9b040b..2382f94 100755 --- a/www/update.sh +++ b/bin/deploy.sh @@ -5,12 +5,13 @@ if [ "$version" = "" ]; then version="latest" fi -#TODO: update service instead of single container -# docker service update www --image=... - # Pull new image docker pull lucj/sophia.events:$version +# TODO +# Replace the following with a service update +# docker service update www --image=lucj/sophia.events + # Stop previous container docker stop events docker rm events diff --git a/bin/push.sh b/bin/push.sh new file mode 100755 index 0000000..dec98de --- /dev/null +++ b/bin/push.sh @@ -0,0 +1 @@ +docker push lucj/sophia.events diff --git a/www/clean_events.js b/data/clean_events.js similarity index 100% rename from www/clean_events.js rename to data/clean_events.js diff --git a/www/events.json b/data/events.json similarity index 98% rename from www/events.json rename to data/events.json index 24048f9..f1d814f 100644 --- a/www/events.json +++ b/data/events.json @@ -34,12 +34,12 @@ { "id" : 4, "type": "cncf-meetup", - "title": "CNCF Sophia-Antipolis #1", + "title": "", "ts": "20180129T173000", "date": "29/01 à 17h30", "desc": "Cédric Lamorinière et David Benque vous présenterons Prometheus une solution de monitoring pour le système et les applications", "link": "https://www.meetup.com/fr-FR/CNCF-Cloud-Native-Computing-Sophia-Antipolis/events/246424155/", - "pict": "cncf.png" + "pict": "cncf-sophia.png" }, { "id" : 5, diff --git a/www/package.json b/data/package.json similarity index 100% rename from www/package.json rename to data/package.json diff --git a/data/rss.js b/data/rss.js new file mode 100644 index 0000000..0a9960d --- /dev/null +++ b/data/rss.js @@ -0,0 +1,14 @@ + + + + MakeUseOf RSS Feed + //sophia.events/ + Upcoming technical events in Sophia-Antipolis + + Entry Title + Link to the entry + http://example.com/item/123 + Sat, 9 Jan 2010 16:23:41 GMT + [CDATA[ This is the description. ]] + + diff --git a/deploy_stack.sh b/deploy_stack.sh deleted file mode 100755 index ad4ddb3..0000000 --- a/deploy_stack.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -version=$1 -if [ "$version" = "" ]; then - version="latest" -fi - -# Pull new image -docker pull lucj/sophia.events:$version - -# Stop previous container -docker stop events -docker rm events - -# Run Docker stack -docker stack deploy -c docker-stack.yml sophia diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..97d1c25 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,10 @@ +version: '3.4' +services: + www: + image: lucj/sophia.events + build: ./www + ports: + - 8000:80 + restart: on-failure + volumes: + - ./www:/usr/share/nginx/html diff --git a/www/index.mustache b/template/index.mustache similarity index 100% rename from www/index.mustache rename to template/index.mustache diff --git a/www/Dockerfile b/www/Dockerfile index e2b2e36..338b36d 100644 --- a/www/Dockerfile +++ b/www/Dockerfile @@ -1,7 +1,7 @@ FROM mhart/alpine-node:8.9.4 as build -RUN npm install -g mustache COPY . /build WORKDIR /build +RUN npm i -g mustache && npm i RUN node clean_events.js RUN mustache upcoming_events.json index.mustache > index.html RUN mustache past_events.json index.mustache > past.html diff --git a/www/deploy.sh b/www/deploy.sh deleted file mode 100755 index 925b5b9..0000000 --- a/www/deploy.sh +++ /dev/null @@ -1,2 +0,0 @@ -docker build -t lucj/sophia.events . -docker push lucj/sophia.events diff --git a/www/images/cncf-sophia.png b/www/images/cncf-sophia.png new file mode 100644 index 0000000..02d2efc Binary files /dev/null and b/www/images/cncf-sophia.png differ diff --git a/www/index.html b/www/index.html new file mode 100644 index 0000000..9a344c8 --- /dev/null +++ b/www/index.html @@ -0,0 +1,164 @@ + + + + + + + TechEvents@Sophia + + + + + + + + + + + +
+
+

Technical events in #SophiaAntipolis

+

...in one single place

+
+
+ +
+
+ + +
+
+
+ +

+
06/02 à 12h
+

Cloud, virtualisation, microservices, conteneurs… quelles sont les bonnes pratiques de sécurité ? par Serge HARTMANN de ACP Qualife

+ More +
+
+ + +
+
+
+ +

+
06/02 à 18h
+

Présentation de la base de données Hazelcast par Neil Stevenson

+ More +
+
+ + +
+
+
+ +

+
20/02 à 12h
+

Présentation de Open Source Business Diagnostic par Jaime Arredondo (BoldAndOpen.com)

+ A venir... +
+
+ + +
+
+
+

Développement Mobile Côte-d'Azur

+
21/02 à 18h30
+

#21: Reactive programming

+ More +
+
+ + +
+
+
+ +

Google Hash Code 2018

+
01/03 à 18h
+

Comme tous les ans, Google organise le Hash Code, une compétition de programmation en équipe pour résoudre un problème d’ingénierie de la vie réelle de Google

+ More +
+
+ + +
+
+
+ +

+
15/03 à 12h
+

Introduction à la programmation fonctionnelle par Yann Esposito. Attention, Haskell au programme...

+ A venir... +
+
+ + +
+
+
+

Développement Mobile Côte-d'Azur

+
28/03 à 18h30
+

#22

+ A venir... +
+
+ + +
+
+
+ +

+
12/04 à 12h
+

Rémy Coutable de GitLab viendra nous présenter Gitlab-CI

+ A venir... +
+
+ + +
+
+
+ +

+
Du 16 au 18/05
+

Riviera DEV c'est 3 jours de conférences et d'ateliers sur un large panel de sujets : langages de programmation, Front-end & UX, Mobile & IoT, Big Data & Machine Learning, Containers & DevOps, Performance, Agilité ...

+ More +
+
+ + +
+
+
+ +

+
Du 2 au 5/07
+

3 soirées de talks et une journée entièrement dédiée à des workshops techniques. Au programme cette année: AI, DevOps et Cloud, IoT. Les CFPs sont ouverts !

+ More +
+
+ + +
+
+ + + + + + diff --git a/www/past.html b/www/past.html new file mode 100644 index 0000000..2660d5e --- /dev/null +++ b/www/past.html @@ -0,0 +1,94 @@ + + + + + + + TechEvents@Sophia + + + + + + + + + + + +
+
+

Technical events in #SophiaAntipolis

+

...in one single place

+
+
+ +
+
+ + +
+
+
+ +

+
29/01 à 17h30
+

Cédric Lamorinière et David Benque vous présenterons Prometheus une solution de monitoring pour le système et les applications

+ More +
+
+ + +
+
+
+ +

+
25/01 à 12h
+

Retour d'expérience sur l'utilisation de Kafka par Sébastien Alegret de GreenCom Network

+ More +
+
+ + +
+
+
+ +

Hashicorp User Group #2

+
23/01 à 18h
+

Thomas Sarboni fera une introduction à Terraform, David Calvert nous présentera Vault

+ More +
+
+ + +
+
+
+ +

Meetup Docker / RivieraJug

+
18/01 à 18h
+

Anthony Lapenna viendra nous présenter Portainer pour gérez vos environnements Docker en toute simplicité

+ More +
+
+ + +
+
+ + + + + + diff --git a/www/rss.js b/www/rss.js new file mode 100644 index 0000000..0a9960d --- /dev/null +++ b/www/rss.js @@ -0,0 +1,14 @@ + + + + MakeUseOf RSS Feed + //sophia.events/ + Upcoming technical events in Sophia-Antipolis + + Entry Title + Link to the entry + http://example.com/item/123 + Sat, 9 Jan 2010 16:23:41 GMT + [CDATA[ This is the description. ]] + + diff --git a/www/test.sh b/www/test.sh deleted file mode 100755 index e7b410c..0000000 --- a/www/test.sh +++ /dev/null @@ -1,4 +0,0 @@ -docker image build -t test.sophia.events . -ID=$(docker run -d -p 80 test.sophia.events) -PORT=$(docker inspect --format '{{ (index (index .NetworkSettings.Ports "80/tcp") 0).HostPort }}' $ID) -echo "=> web site available on http://localhost:$PORT"