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