diff --git a/.drone/drone-home.yml b/.drone/drone-home.yml index 9c52e53..c790ad0 100644 --- a/.drone/drone-home.yml +++ b/.drone/drone-home.yml @@ -33,7 +33,7 @@ steps: commands: - set -e - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - "n=0\nwhile :\ndo\n docker pull postgres:12.4 \\\\\n && docker tag postgres:12.4 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/postgres:12.4 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/postgres:12.4 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" + - "n=0\nwhile :\ndo\n docker pull postgres:12.4 \\\\\n && docker tag postgres:12.4 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/postgres:12.4 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/postgres:12.4 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" volumes: - name: dockersock path: /var/run @@ -43,7 +43,7 @@ steps: commands: - set -e - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - "n=0\nwhile :\ndo\n docker pull guacamole/guacd:1.2.0 \\\\\n && docker tag guacamole/guacd:1.2.0 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacd:1.2.0 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacd:1.2.0 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" + - "n=0\nwhile :\ndo\n docker pull guacamole/guacd:1.2.0 \\\\\n && docker tag guacamole/guacd:1.2.0 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacd:1.2.0 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacd:1.2.0 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" volumes: - name: dockersock path: /var/run @@ -53,7 +53,7 @@ steps: commands: - set -e - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - "n=0\nwhile :\ndo\n docker pull guacamole/guacamole:1.2.0 \\\\\n && docker tag guacamole/guacamole:1.2.0 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacamole:1.2.0 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacamole:1.2.0 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" + - "n=0\nwhile :\ndo\n docker pull guacamole/guacamole:1.2.0 \\\\\n && docker tag guacamole/guacamole:1.2.0 $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole:1.2.0 \\\\\n && docker push $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/guacamole/guacamole:1.2.0 && break\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"initialise failed\"\n exit 1\n fi\n echo \"retrying..$n\"\n sleep 5\ndone\n" volumes: - name: dockersock path: /var/run @@ -89,95 +89,6 @@ trigger: target: - registry ---- -kind: pipeline -type: docker -name: save - -platform: - os: linux - arch: amd64 - -clone: - disable: true - -steps: -- name: mkdir - image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea - settings: - envs: - - drone_tag - - drone_commit - - drone_build_number - - drone_repo_name - - drone_repo_namespace - script: - - mkdir -p /root/images/guacamole - - rm /root/images/guacamole/*.* - -- name: proxy/postgres:12.4 - image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea - settings: - envs: - - drone_tag - - drone_commit - - drone_build_number - - drone_repo_name - - drone_repo_namespace - - registry_domain - - registry_port - - registry_password - script: - - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/postgres:12.4 - - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/postgres:12.4 -o /root/images/guacamole/proxy-postgres:12.4.tar - - echo "docker load proxy_postgres:12.4.tar" >> /root/images/guacamole/load.sh - - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/postgres:12.4 DOLLAR1/proxy/postgres:12.4" >> /root/images/guacamole/load.sh - -- name: proxy/guacamole/guacd:1.2.0 - image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea - settings: - envs: - - drone_tag - - drone_commit - - drone_build_number - - drone_repo_name - - drone_repo_namespace - - registry_domain - - registry_port - - registry_password - script: - - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacd:1.2.0 - - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacd:1.2.0 -o /root/images/guacamole/proxy-guacamole-guacd:1.2.0.tar - - echo "docker load proxy_guacamole_guacd:1.2.0.tar" >> /root/images/guacamole/load.sh - - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacd:1.2.0 DOLLAR1/proxy/guacamole/guacd:1.2.0" >> /root/images/guacamole/load.sh - -- name: proxy/guacamole/guacamole:1.2.0 - image: appleboy/drone-ssh:1.6.2@sha256:b801dc2cd238c192b6e99acfa7bc3f5b9a03f312bd2feb1e10b3a7a28a1b80ea - settings: - envs: - - drone_tag - - drone_commit - - drone_build_number - - drone_repo_name - - drone_repo_namespace - - registry_domain - - registry_port - - registry_password - script: - - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - - docker pull $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacamole:1.2.0 - - docker save $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacamole:1.2.0 -o /root/images/guacamole/proxy-guacamole-guacamole:1.2.0.tar - - echo "docker load proxy_guacamole_guacamole:1.2.0.tar" >> /root/images/guacamole/load.sh - - echo "docker tag $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/proxy/guacamole/guacamole:1.2.0 DOLLAR1/proxy/guacamole/guacamole:1.2.0" >> /root/images/guacamole/load.sh - -trigger: - event: - - promote - target: - - save - --- kind: pipeline type: docker @@ -222,10 +133,10 @@ steps: image: docker:19.03.12-dind@sha256:8dded163e463f4a59bf305b3dca98e312b2cfb89a43da3872e48f95a7554c48f commands: - set -e - - sh .drone/login.sh + - export NAME=guacamole + - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - sh .drone/build.sh - sh .drone/push.sh - - sh .drone/logout.sh volumes: - name: dockersock path: /var/run @@ -249,6 +160,7 @@ steps: - export REGISTRY_PORT=$${REGISTRY_PORT} - export REGISTRY_PASSWORD=$${REGISTRY_PASSWORD} - set -e + - export NAME=guacamole - cd /stack/guacamole - "n=0\nwhile :\ndo\n docker login $${REGISTRY_DOMAIN}:$${REGISTRY_PORT}/ --username client --password \"$${REGISTRY_PASSWORD}\" \\\\\n && break # substitute your command here\n n=$((n+1))\n if [ $n -ge 10 ]; then\n echo \"login failed\"\n exit 1\n fi\n echo \"retrying login..$n\"\n sleep 5\ndone\n" - sh .drone/pull.sh