├── .circleci └── config.yml ├── Dockerfile ├── LICENSE └── hooks └── post_push /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | docker-swift-updater: 4 | docker: 5 | - image: norionomura/docker-swift-updater 6 | steps: 7 | - checkout 8 | - add-ssh-keys: 9 | fingerprints: 10 | - "fe:11:f3:6a:1e:7c:38:67:33:d2:ff:42:1a:16:01:87" 11 | - setup_remote_docker 12 | - run: | 13 | git config --global user.name "Norio Nomura" 14 | git config --global user.email "norio.nomura@gmail.com" 15 | git fetch --tags 16 | - run: docker-swift-updater -Verbose YES 17 | - run: | 18 | git push origin $CIRCLE_BRANCH 19 | git push --tags origin $CIRCLE_BRANCH 20 | 21 | workflows: 22 | version: 2 23 | every_3_hours: 24 | triggers: 25 | - schedule: 26 | cron: "20 0,3,6,9,12,15,18,21 * * *" 27 | filters: 28 | branches: 29 | only: 30 | - master 31 | jobs: 32 | - docker-swift-updater 33 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM norionomura/swift:base9 2 | LABEL maintainer="Norio Nomura " 3 | 4 | # Install Swift keys 5 | RUN curl https://swift.org/keys/all-keys.asc | gpg2 --import - 6 | 7 | ENV SWIFT_BRANCH=swift-5.5-release \ 8 | SWIFT_PLATFORM=ubuntu16.04 \ 9 | SWIFT_VERSION=5.5-RELEASE 10 | 11 | # Install Swift toolchain for ubuntu 12 | RUN SWIFT_ARCHIVE_NAME=swift-$SWIFT_VERSION-$SWIFT_PLATFORM && \ 13 | SWIFT_URL=https://swift.org/builds/$SWIFT_BRANCH/$(echo "$SWIFT_PLATFORM" | tr -d .)/swift-$SWIFT_VERSION/$SWIFT_ARCHIVE_NAME.tar.gz && \ 14 | curl -O $SWIFT_URL && \ 15 | curl -O $SWIFT_URL.sig && \ 16 | gpg2 --verify $SWIFT_ARCHIVE_NAME.tar.gz.sig && \ 17 | tar -xvzf $SWIFT_ARCHIVE_NAME.tar.gz --directory / --strip-components=1 && \ 18 | rm -rf $SWIFT_ARCHIVE_NAME* /tmp/* /var/tmp/* && \ 19 | chmod -R o+r /usr/lib/swift 20 | 21 | # Print Installed Swift Version 22 | RUN swift --version 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Norio Nomura 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /hooks/post_push: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # https://docs.docker.com/docker-cloud/builds/advanced/ 4 | 5 | function add_tag() { 6 | docker tag $IMAGE_NAME $DOCKER_REPO:$1 7 | docker push $DOCKER_REPO:$1 8 | } 9 | 10 | add_tag latest 11 | 12 | exit $? 13 | --------------------------------------------------------------------------------