-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitbucket-pipelines.yml
More file actions
45 lines (39 loc) · 1.74 KB
/
bitbucket-pipelines.yml
File metadata and controls
45 lines (39 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# This is an example Starter pipeline configuration
# Use a skeleton to build, test and deploy using manual and parallel steps
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: atlassian/default-image:5
pipelines:
default:
- parallel:
- step:
name: 'Build and Test'
script:
- echo "Your build and test goes here..."
- step:
name: 'Lint'
script:
- echo "Your linting goes here..."
- step:
name: 'Security scan'
script:
- echo "Your security scan goes here..."
# The following deployment steps will be executed for each pipeline run. To configure your steps and conditionally deploy see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
- step:
name: Mirror to GitHub
script:
- apt-get update && apt-get install -y git openssh-client
- git config --global user.name "Luis Imperial (Bitbucket Sync Bot)"
- git config --global user.email "imperialluisanton@outlook.ph"
# Setup SSH for Bitbucket
- mkdir -p ~/.ssh
- echo -e "$BITBUCKET_SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
- chmod 600 ~/.ssh/id_ed25519
- ssh-keyscan -t rsa bitbucket.org >> ~/.ssh/known_hosts
- git config --global core.sshCommand "ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=yes"
# Clone the Bitbucket repo using SSH
- git clone --mirror git@bitbucket.org:luisapi/basa-chatbot.git
- cd basa-chatbot.git
# Push to GitHub using HTTPS token
- git remote add github https://LuisAPI:${GITHUB_TOKEN}@github.com/LuisAPI/BASA-Chatbot.git
- git push --mirror github