From 2914b6905267bbd3c1f9c20eb12ae77efe390cc8 Mon Sep 17 00:00:00 2001 From: David Losada Date: Fri, 15 Nov 2019 21:15:19 +0100 Subject: [PATCH] docker hub publish: master as "latest" release tags as themselves --- .gitignore | 1 + codeship-services.yml | 5 +++++ codeship-steps.yml | 22 ++++++++++++++++++++++ docker.env.encrypted | 2 ++ 4 files changed, 30 insertions(+) create mode 100644 docker.env.encrypted diff --git a/.gitignore b/.gitignore index 8d21a644ea..198ba006e8 100644 --- a/.gitignore +++ b/.gitignore @@ -50,4 +50,5 @@ modules/orm # Docker Deployment Specifics *.aes deployment.env +docker.env vault.txt diff --git a/codeship-services.yml b/codeship-services.yml index 750a8383e1..9902065a67 100644 --- a/codeship-services.yml +++ b/codeship-services.yml @@ -123,3 +123,8 @@ awscli: - .:/vols/src encrypted_env_file: deployment.env.encrypted cached: true + +dockercfggen: + image: codeship/dockercfg-generator + add_docker: true + encrypted_env_file: docker.env.encrypted diff --git a/codeship-steps.yml b/codeship-steps.yml index a095de8dce..b64942601b 100644 --- a/codeship-steps.yml +++ b/codeship-steps.yml @@ -36,3 +36,25 @@ - name: "Deployment director" service: deploy command: ush-deployment-director.sh + + +# Publish images to docker hub +- name: "Docker Hub upload" + type: parallel + steps: + - tag: master + name: "Upload latest tag" + service: dockerimg + type: push + image_name: ushahidi/platform + image_tag: latest + registry: https://index.docker.io/v1/ + dockercfg_service: dockercfggen + - tag: '^v(\d+\.)+\d+' + name: "Upload release tag" + service: dockerimg + type: push + image_name: ushahidi/platform + image_tag: "{{.Branch}}" + registry: https://index.docker.io/v1/ + dockercfg_service: dockercfggen \ No newline at end of file diff --git a/docker.env.encrypted b/docker.env.encrypted new file mode 100644 index 0000000000..2aa36a0f01 --- /dev/null +++ b/docker.env.encrypted @@ -0,0 +1,2 @@ +codeship:v2 +isdejOJdkjObFQnA5/INMN/So76xiguxRAOAyXo3hHXFCBzHOyq6pDNV7yFPLmmiIrDk3ZMajuNU72baxbQOGCEX2XELnmvzKT/NeX4Ssgi5wiy/hJdxLbN0wOAE8lfm4KIIphdu6IYP0Nzad2J1QhGRt8T49HWrATeXvrJawAXg1835EM8xjwxZ/2oD42G6dnHXGwHrra/0hvCCRwkN1fyrfNTUpg== \ No newline at end of file