From ca3530da0531e9194cb77551d9d3133607fc5d82 Mon Sep 17 00:00:00 2001 From: Daniel Huebleitner Date: Wed, 30 Oct 2019 20:56:31 +0100 Subject: [PATCH] added, improved drone file from fb admin and activated repo --- .drone.yml | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..04c90f5 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,83 @@ +--- +kind: pipeline +type: docker +name: default + + +steps: + +- name: build created + image: alpine + commands: + - echo ${DRONE_BUILD_CREATED} + +- name: restore cache + image: drillster/drone-volume-cache + settings: + restore: true + mount: + - ./node_modules + volumes: + - name: cache + path: /cache + +- name: npm install + image: node:12 + commands: + - npm install + +- name: npm run build + image: node:12 + commands: + - npm run build + +- name: rebuild cache + image: drillster/drone-volume-cache + settings: + rebuild: true + mount: + - ./node_modules + volumes: + - name: cache + path: /cache + +- name: deliver dist + image: node:12 + commands: + - echo ${DRONE_BUILD_CREATED} + - git clone https://www.versioncontrol.me/frontwork-distribution/${DRONE_REPO_NAME}.git; cd ${DRONE_REPO_NAME} && rm -rf ./*; cp -r ../dist/* .; cp ../LICENSE.md . + - git add --all; git -c user.email="${DRONE_COMMIT_AUTHOR_EMAIL}" -c user.name="${DRONE_COMMIT_AUTHOR}" commit --all --allow-empty --message "generated from tag ${DRONE_TAG}" + - (git tag ${DRONE_TAG} && git push --force https://$GIT_USER:$GIT_PASSWORD@versioncontrol.me/frontwork-distribution/${DRONE_REPO_NAME}.git master ${DRONE_TAG}) || true + environment: + GIT_USER: + from_secret: git_user + GIT_PASSWORD: + from_secret: git_password + when: + event: + - tag + +- name: deliver container + image: plugins/docker + settings: + registry: registry.conatum.eu + insecure: true + repo: registry.conatum.eu/frontwork/admin + tags: ${DRONE_BUILD_CREATED} + +- name: release container + image: plugins/docker + settings: + repo: frontwork/admin + tags: ${DRONE_TAG} + username: frontwork + password: + from_secret: docker_password + when: + event: + - tag + +volumes: +- name: cache + host: + path: /tmp \ No newline at end of file