2018-10-30 05:36:14 +02:00
|
|
|
version: 2.1
|
2018-10-29 14:48:35 +02:00
|
|
|
|
2018-10-30 05:36:14 +02:00
|
|
|
executors:
|
|
|
|
docker:
|
|
|
|
working_directory: /tmp/workspace
|
2018-10-26 21:46:48 +03:00
|
|
|
docker:
|
2020-12-19 02:53:12 +02:00
|
|
|
- image: docker:12.10.1
|
2018-10-30 05:36:14 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
docker:
|
|
|
|
parameters:
|
|
|
|
with_deploy:
|
2019-02-09 19:17:43 +02:00
|
|
|
type: boolean
|
|
|
|
default: false
|
2018-10-30 05:36:14 +02:00
|
|
|
executor: docker
|
2018-10-26 21:46:48 +03:00
|
|
|
steps:
|
|
|
|
- checkout
|
2020-11-15 09:06:18 +02:00
|
|
|
- setup_remote_docker:
|
2020-11-15 09:04:08 +02:00
|
|
|
version: 19.03.13
|
2018-10-26 21:46:48 +03:00
|
|
|
- run:
|
2018-10-30 05:36:14 +02:00
|
|
|
name: Build
|
2018-10-26 21:46:48 +03:00
|
|
|
command: |
|
2018-11-06 19:06:32 +02:00
|
|
|
docker build -t misskey/misskey .
|
2018-10-30 05:36:14 +02:00
|
|
|
- when:
|
|
|
|
condition: <<parameters.with_deploy>>
|
|
|
|
steps:
|
|
|
|
- run:
|
|
|
|
name: Deploy
|
|
|
|
command: |
|
2018-10-31 15:00:21 +02:00
|
|
|
if [ "$DOCKERHUB_USERNAME$DOCKERHUB_PASSWORD" ]
|
|
|
|
then
|
2018-11-11 14:34:50 +02:00
|
|
|
apk update && apk add jq
|
2018-11-08 11:49:45 +02:00
|
|
|
docker tag misskey/misskey misskey/misskey:$(cat package.json | jq -r .version)
|
2018-10-31 15:00:21 +02:00
|
|
|
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
|
2020-12-19 02:53:12 +02:00
|
|
|
docker push -a misskey/misskey
|
2018-10-31 15:00:21 +02:00
|
|
|
else
|
|
|
|
echo -e '\033[0;33mAborted deploying to Docker Hub\033[0;39m'
|
|
|
|
fi
|
2018-10-26 21:46:48 +03:00
|
|
|
|
|
|
|
workflows:
|
|
|
|
version: 2
|
2019-02-17 19:44:46 +02:00
|
|
|
docker:
|
|
|
|
jobs:
|
2018-10-30 05:36:14 +02:00
|
|
|
- docker:
|
2019-02-17 19:44:46 +02:00
|
|
|
name: auto-build
|
2019-02-09 19:17:43 +02:00
|
|
|
with_deploy: true
|
2018-10-30 05:36:14 +02:00
|
|
|
filters:
|
|
|
|
branches:
|
|
|
|
only: master
|