-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
70 lines (63 loc) Β· 2.06 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
67
68
69
70
language: python
services:
- docker
env:
global:
- IMAGE_NAME=playground
stages:
- build
- test
- name: deploy
if: branch = master AND type = push AND fork = false
install:
- echo 'Nothing to install right now...'
before_script:
# Confirm presence of docler
- docker info
# Versioning - Local Playground
- VERSION="$(awk '$2 == "PLAYGROUND_VERSION" { print $3; exit }' local/docker/Dockerfile)"
jobs:
include:
- stage: build
name: Build
script:
# Build playground docker-image
- docker build -t $DOCKER_USER/$IMAGE_NAME -f local/docker/Dockerfile .
# List docker images
- docker images
- stage: test
name: Docker Image
script:
# Run playground docker-image
- docker run -d -u $(id -u):$(id -g) -v //var/run/docker.sock://var/run/docker.sock:rw -p 8001-8080:8001-8080 adisakshya/playground
# Sleep for 15 seconds
- sleep 15
# Try reaching code-server
- curl localhost:8080/login
# List all docker containers
- docker ps -a
- stage: test
name: Install Script - Debian
script:
# Run debian install script
- bash $(pwd)/local/shell/debian.sh
- stage: test
name: Install Script - Amazon Linux
script:
# Run amazon-linux install script in docker-container
- docker run --rm -v $(pwd)/local/shell/amazon-linux.sh:/playground/amazon-linux.sh amazonlinux bash /playground/amazon-linux.sh
- stage: deploy
name: Push docker image to Docker Hub
script:
# Build playground docker-image
- docker build -t $DOCKER_USER/$IMAGE_NAME -f local/docker/Dockerfile .
# Version Tag
- docker tag $DOCKER_USER/$IMAGE_NAME:latest $DOCKER_USER/$IMAGE_NAME:$VERSION
# Docker login
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASSWORD"
# Push version taged image
- docker push $DOCKER_USER/$IMAGE_NAME:$VERSION
# Push latest taged image
- docker push $DOCKER_USER/$IMAGE_NAME:latest
notifications:
email: false