-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
62 lines (60 loc) · 1.84 KB
/
.gitlab-ci.yml
File metadata and controls
62 lines (60 loc) · 1.84 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
stages:
- mirror
- build-and-push
mirror_to_github:
stage: mirror
image:
name: alpine/git
before_script:
- cd
- mkdir -p .ssh
- chmod 700 .ssh
- eval $(ssh-agent -s)
- echo "$GIT_DEPLOY_KEY" | base64 -d | tr -d '\r'
> .ssh/id_rsa
- echo "$SSH_CONFIG" | base64 -d | tr -d '\r'
> .ssh/config
- echo "$SSH_KNOWN_HOST" | base64 -d | tr -d '\r'
> .ssh/known_hosts
- chmod 400 .ssh/id_rsa
- echo "$GITHUB_PRIVATE_KEY" | base64 -d | tr -d '\r' | ssh-add -
- git config --global user.email "ziz244@ucsd.edu"
- git config --global user.name "Zihao Zhou"
- git config --global push.default current
- git clone --mirror ssh://git@gitlab-ssh.nrp-nautilus.io:30622/ZihaoZhou/autoint.git
- ssh-keyscan github.com >> ~/.ssh/known_hosts
- cd autoint.git
script:
- git remote add github git@github.com:Rose-STL-Lab/AutoSTPP.git
- git push --force --mirror github
only:
- push
build-and-push-job:
stage: build-and-push
image:
name: gcr.io/kaniko-project/executor:v1.9.0-debug
entrypoint: [""]
script:
- mkdir -p .ssh/
- echo "$GIT_DEPLOY_KEY" | base64 -d | tr -d '\r'
> .ssh/id_rsa
- echo "$SSH_CONFIG" | base64 -d | tr -d '\r'
> .ssh/config
- echo "$SSH_KNOWN_HOST" | base64 -d | tr -d '\r'
> .ssh/known_hosts
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}"
> /kaniko/.docker/config.json
- /kaniko/executor --cache=false
--context $CI_PROJECT_DIR
--dockerfile $CI_PROJECT_DIR/Dockerfile
--destination $CI_REGISTRY_IMAGE:${CI_COMMIT_SHA:0:8}
--destination $CI_REGISTRY_IMAGE:latest
timeout: 10h
only:
refs:
- branches
changes:
- Dockerfile
- poetry.lock
- pyproject.toml
- conda-lock.yml