-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
66 lines (53 loc) · 2.16 KB
/
.travis.yml
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
63
64
65
66
dist: focal
language: minimal
env:
- ARCH="linux/arm/v7,linux/arm64,linux/amd64" IMAGE_NAME="tor-proxy"
services:
- docker
addons:
apt:
packages:
- qemu
- binfmt-support
- qemu-user-static
- jq
before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
stages:
- name: test
- name: dev
if: branch = master
- name: prod
if: tag IS present
- name: dockerhub_readme
jobs:
include:
- stage: test
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t ${IMAGE_NAME}:test_${TRAVIS_COMMIT} .
- docker run -d --restart=always --name tor-proxy -p 9150:9150 ${IMAGE_NAME}:test_${TRAVIS_COMMIT}
- sleep 30
- curl --fail --socks5-hostname localhost:9150 -I -L 'https://www.facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion/' || exit 1
- stage: dev
script:
- docker buildx create --name mybuilder --platform $ARCH
- docker buildx use mybuilder
- docker buildx inspect
- docker buildx inspect --bootstrap
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker buildx build --platform $ARCH -t ${DOCKER_USERNAME}/${IMAGE_NAME}:dev . --push
- stage: prod
script:
- docker buildx create --name mybuilder --platform $ARCH
- docker buildx use mybuilder
- docker buildx inspect
- docker buildx inspect --bootstrap
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker buildx build --platform $ARCH -t ${DOCKER_USERNAME}/${IMAGE_NAME}:${TRAVIS_TAG} -t ${DOCKER_USERNAME}/${IMAGE_NAME}:latest . --push
- stage: dockerhub_readme
script:
- docker run -v $PWD:/workspace -e DOCKERHUB_USERNAME=$DOCKER_USERNAME -e DOCKERHUB_PASSWORD=$DOCKER_PASSWORD -e DOCKERHUB_REPOSITORY=${DOCKER_USERNAME}/${IMAGE_NAME} -e README_FILEPATH=/workspace/README.md peterevans/dockerhub-description:2