Skip to content

Commit

Permalink
Merge pull request #29 from bitholla/develop
Browse files Browse the repository at this point in the history
HollaEx CLI v1.7.0
  • Loading branch information
abeikverdi authored Dec 19, 2019
2 parents 928eddb + 12d2fa0 commit 9711b8b
Show file tree
Hide file tree
Showing 15 changed files with 2,372 additions and 1,094 deletions.
172 changes: 100 additions & 72 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,109 @@
clone:
git:
image: bitholla/devops-tools:drone_git-80f15d1
when:
branch: [ master ]
kind: pipeline
type: docker
name: amd64

pipeline:
### SLACK NOTIFY - Build start ###
notify_job_start:
image: bitholla/devops-tools:drone_slack-8a15f61
channel: deployment
secrets: [ slack_webhook ]
template: "<{{build.link}}|Deployment> - #{{build.number}} started on <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}} / {{build.branch}}> by {{build.author}}"
when:
branch: [ master ]
event: push
platform:
arch: amd64
os: linux

#### Filtering branches to not build it ####
not_building_this_branch:
image: golang:1.10.0-alpine
commands:
- echo "Your latest code is now up on ${DRONE_BRANCH}. but Drone will not build this branch. have fun :)"
when:
branch:
exclude: [ master ]
event: push
steps:

#### Docker image tagging - PRODUCTION RELEASES ####
docker_tagging:
image: alpine
commands:
- export PACKAGE_VERSION="$(cat version)" && echo "$PACKAGE_VERSION" > .tags
- echo -n ",latest" >> .tags
- echo "Current Docker tag is :" && cat .tags
- echo "dockerTag:$(cat .tags)" > .dockerTag.yml
when:
branch: [ master ]
event: push
- name: notify_job_start
image: plugins/slack
settings:
template: "<{{build.link}}|Deployment> - #{{build.number}} for AMD64 Arch started on <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}} / {{build.branch}}> by {{build.author}}"
channel: deployment
environment:
SLACK_WEBHOOK:
from_secret: slack_webhook

- name: docker_tagging
image: alpine
commands:
- export PACKAGE_VERSION="$(cat version)" && echo "$PACKAGE_VERSION" > .tags
- echo -n ",latest" >> .tags
- echo "Current Docker tag is :" && cat .tags
- echo "dockerTag:$(cat .tags)" > .dockerTag.yml


#### Docker image build ####
docker_build:
#image: bitholla/devops-tools:drone_docker-1086846
image: plugins/docker
secrets: [ docker_username, docker_password ]
- name: docker_build
image: plugins/docker
settings:
dockerfile: docker/Dockerfile.arm64
repo: bitholla/hollaex-cli
dockerfile: docker/Dockerfile
when:
branch: [ master ]
event: push
tag: test-arm64
environment:
DOCKER_USERNAME:
from_secret: docker_username
DOCKER_PASSWORD:
from_secret: docker_password

- name: notify_job_done
image: bitholla/devops-tools:drone_slack-8a15f61
channel: deployment
environment:
SLACK_WEBHOOK:
from_secret: slack_webhook
when:
status: [ success, failure ]

- name: partymaker_version_tagging
image: alpine
commands:
- export PACKAGE_VERSION="$(cat version)" && echo "$PACKAGE_VERSION" > .tags

- name: notify_to_releases
image: bitholla/devops-tools:drone_partymaker-0.1.1
channel: deployment
environment:
WEBHOOK_URL:
from_secret: webhook_url
when:
status: [ success, failure ]

#### SLACK NOTIFY - Build status report ####
notify_to_deployment:
image: bitholla/devops-tools:drone_slack-8a15f61
channel: deployment
secrets: [ slack_webhook ]
when:
status: [success, failure]
branch: [ master ]
event: push
trigger:
branch:
- master
event:
- push

# ---

# kind: pipeline
# type: docker
# name: arm64

# steps:
# # - name: notify_job_start
# # image: plugins/slack
# # template: "<{{build.link}}|Deployment> - #{{build.number}} for ARM64 Arch started on <https://github.com/{{repo.owner}}/{{repo.name}}/tree/{{build.branch}}|{{repo.name}} / {{build.branch}}> by {{build.author}}"
# # channel: deployment
# # environment:
# # SLACK_WEBHOOK:
# # from_secret: slack_webhook

# - name: docker_build
# image: plugins/docker
# settings:
# dockerfile: docker/Dockerfile.s390x
# repo: bitholla/hollaex-cli
# tag: arm64-test
# environment:
# USERNAME:
# from_secret: docker_username
# PASSWORD:
# from_secret: docker_password

version_tagging_for_partymaker:
image: alpine
commands:
- export PACKAGE_VERSION="$(cat version)" && echo "$PACKAGE_VERSION" > .tags
when:
branch: [ master ]
event: push
# # - name: notify_job_done
# # image: bitholla/devops-tools:drone_slack-8a15f61
# # channel: deployment
# # environment:
# # SLACK_WEBHOOK:
# # from_secret: slack_webhook
# when:
# status: [ success, failure ]

#### SLACK NOTIFY - to releases channel ####
notify_to_releases:
image: bitholla/devops-tools:drone_partymaker-0.1.1
#pull: true
secrets:
- source: slack_webhook_releases
target: webhook_url
when:
status: [success]
branch: [ master ]
event: push
# trigger:
# branch:
# - develop
# event:
# - push
24 changes: 24 additions & 0 deletions docker/Dockerfile.s390x
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:18.04 as dependencies

RUN apt-get update && apt-get install -y qemu-user

FROM s390x/ubuntu:18.04

COPY --from=dependencies /usr/bin/qemu-s390x /usr/bin

RUN apt-get update && apt-get install -y git curl sudo docker.io docker-compose

RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.13.4/bin/linux/amd64/kubectl && chmod +x ./kubectl && mv ./kubectl /usr/local/bin/kubectl

RUN curl -L https://git.io/get_helm.sh | bash

RUN curl -L https://raw.githubusercontent.com/bitholla/hollaex-cli/master/install.sh | bash

COPY docker/run.sh /run.sh
RUN chmod +x /run.sh

WORKDIR /root

RUN rm /usr/bin/qemu-s390x

ENTRYPOINT ["/run.sh"]
Loading

0 comments on commit 9711b8b

Please sign in to comment.