From ebab360f224183ba7c67fda132f60b637da91389 Mon Sep 17 00:00:00 2001 From: Kamil Klecha Date: Wed, 20 Oct 2021 00:54:19 +0200 Subject: [PATCH] CICD-test --- .drone.yml | 10 ++++++++++ Dockerfile | 17 +++++++++++++++++ src/components/City.vue | 25 ++++++++++++++++++------- src/components/NewCity.vue | 3 ++- src/config.json | 11 +++++++++++ src/main.ts | 16 +++++++++------- start-nginx.sh | 9 +++++++++ 7 files changed, 76 insertions(+), 15 deletions(-) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 src/config.json create mode 100644 start-nginx.sh diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..0b2b7df --- /dev/null +++ b/.drone.yml @@ -0,0 +1,10 @@ +kind: pipeline +type: docker +steps: +- name: dockerize + image: plugins/docker + settings: + repo: docker-registry.kamilklecha.dev/vetro/weather-demo + dockerfile: ./Dockerfile + tags: + - cicd-test \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c080581 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:16 +ENV JQ_VERSION=1.6 +RUN wget --no-check-certificate https://github.com/stedolan/jq/releases/download/jq-${JQ_VERSION}/jq-linux64 -O /tmp/jq-linux64 +RUN cp /tmp/jq-linux64 /usr/bin/jq +RUN chmod +x /usr/bin/jq +WORKDIR /app +COPY . . +RUN jq 'to_entries | map_values({ (.key) : ("$" + .key) }) | reduce .[] as $item ({}; . + $item)' ./src/config.json > ./src/config.tmp.json && mv ./src/config.tmp.json ./src/config.json +RUN npm install && npm run build + +FROM nginx:stable +ENV JSFOLDER=/usr/share/nginx/html/js/*.js +COPY ./start-nginx.sh /usr/bin/start-nginx.sh +RUN chmod +x /usr/bin/start-nginx.sh +WORKDIR /usr/share/nginx/html +COPY --from=0 /app/dist . +ENTRYPOINT [ "start-nginx.sh" ] \ No newline at end of file diff --git a/src/components/City.vue b/src/components/City.vue index bb4a1f7..2168442 100644 --- a/src/components/City.vue +++ b/src/components/City.vue @@ -56,7 +56,9 @@ - Szczegóły + Szczegóły Usuń @@ -65,20 +67,26 @@ -
+