2024-02-04 00:43:32 +00:00
|
|
|
steps:
|
2024-02-04 05:07:19 +00:00
|
|
|
- name: docker
|
2024-02-04 04:40:24 +00:00
|
|
|
image: plugins/docker
|
|
|
|
commands:
|
2024-02-04 04:47:48 +00:00
|
|
|
- docker login docker.io -u $${DOCKERHUB_USERNAME} -p $${DOCKERHUB_PASSWORD}
|
2024-02-04 04:56:59 +00:00
|
|
|
- export TAG=$(openssl rand -hex 8)
|
2024-02-04 04:57:58 +00:00
|
|
|
- docker build --rm=true -f Dockerfile -t $TAG .
|
2024-02-04 05:07:19 +00:00
|
|
|
- docker tag $TAG $${DOCKERHUB_USERNAME}/$${APP}:latest
|
|
|
|
- docker push $${DOCKERHUB_USERNAME}/$${APP}:latest
|
|
|
|
secrets: [ dockerhub_username, dockerhub_password, app ]
|
2024-02-04 04:59:18 +00:00
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
2024-02-04 05:07:19 +00:00
|
|
|
- name: caprover
|
|
|
|
image: plugins/docker
|
|
|
|
commands:
|
|
|
|
- docker login docker.io -u $${DOCKERHUB_USERNAME} -p $${DOCKERHUB_PASSWORD}
|
2024-02-04 05:14:02 +00:00
|
|
|
- docker run --network=host caprover/cli-caprover:2.2.3 caprover deploy --caproverUrl "$${CAPROVER_URL}" --caproverPassword "$${CAPROVER_PASSWORD}" -a "$${APP}" -i docker.io/$${DOCKERHUB_USERNAME}/$${APP}
|
2024-02-04 05:07:19 +00:00
|
|
|
secrets: [ dockerhub_username, dockerhub_password, caprover_url, caprover_password, app]
|
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|