Skip to content

Commit

Permalink
alpine: add release container
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Jun 22, 2017
1 parent 2517555 commit 32ea721
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 16 deletions.
36 changes: 24 additions & 12 deletions setup/ubuntu16.04_docker_alpine3.4/ansible-playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- include_vars: ansible-vars.yaml
tags: vars

- name: General | APT Update and upgrade
- name: General | APT update and upgrade
apt: update_cache=yes upgrade=full
tags: general

Expand Down Expand Up @@ -60,17 +60,29 @@
gather_facts: True

tasks:
- name: Docker | Generate Dockerfile
template: src=./resources/Dockerfile.j2 dest=/root/Dockerfile
tags: docker
- include: tasks/setup-image.yaml image_type=test ci_host=ci.nodejs.org secret={{ test_secret }}
- include: tasks/setup-image.yaml image_type=release ci_host=ci-release.nodejs.org secret={{ release_secret }}

- name: Docker | Build Alpine image
command: docker build -t node-ci:alpine-build /root/
- name: SSH | Make release ssh config directory
file:
path: "/home/{{ server_user }}/release/.ssh/"
state: directory
mode: 0700
owner: "{{ server_user }}"
tags: docker_build

- name: Init | Generate and copy init script
template: src=./resources/jenkins.service.j2 dest=/lib/systemd/system/jenkins.service
tags: init
- name: SSH | Copy release ssh config
template:
src: ./resources/release_ssh_config
dest: "/home/{{ server_user }}/release/.ssh/config"
mode: 0600
owner: "{{ server_user }}"
tags: docker_init

- name: Init | Start Jenkins
service: name=jenkins state=started enabled=yes
tags: init
- name: SSH | Copy release ssh staging key
template:
src: ./resources/node-www-staging-key
dest: "/home/{{ server_user }}/release/.ssh/node-www-staging"
mode: 0600
owner: "{{ server_user }}"
tags: docker_init
1 change: 1 addition & 0 deletions setup/ubuntu16.04_docker_alpine3.4/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-www-staging-key
5 changes: 3 additions & 2 deletions setup/ubuntu16.04_docker_alpine3.4/resources/Dockerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ENV NODE_TEST_DIR /home/{{ server_user }}/tmp
ENV PATH /usr/lib/ccache/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
ENV NODE_COMMON_PIPE /home/{{ server_user }}/test.pipe
ENV OSTYPE linux-gnu
ENV OSVARIANT docker
ENV DESTCPU x64
ENV ARCH x64

Expand Down Expand Up @@ -44,5 +45,5 @@ CMD cd /home/iojs \
&& curl https://ci.nodejs.org/jnlpJars/slave.jar -O \
&& java \
-jar slave.jar \
-jnlpUrl https://ci.nodejs.org/computer/test-digitalocean-ubuntu1604_docker_alpine34-x64-1/slave-agent.jnlp \
-secret efbfadbf4807af0f1084a1e120ef5467b49432113661e11ce2ecc1ab71b96f38
-jnlpUrl https://{{ ci_host }}/computer/{{ image_type }}-digitalocean-ubuntu1604_docker_alpine34-x64-1/slave-agent.jnlp \
-secret {{ secret }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ WantedBy=multi-user.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/docker run --rm -v /home/{{ server_user }}:/home/{{ server_user }} --name node-ci-alpine node-ci:alpine-build
ExecStop=/usr/bin/docker stop -t 5 node-ci-alpine
ExecStart=/usr/bin/docker run --rm -v /home/{{ server_user }}/{{ image_type }}:/home/{{ server_user }} --name node-ci-alpine-{{ image_type }} node-ci:alpine-{{ image_type }}
ExecStop=/usr/bin/docker stop -t 5 node-ci-alpine-{{ image_type }}
Restart=always
RestartSec=30
StartLimitInterval=0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Host iojs-www node-www
HostName direct.nodejs.org
User staging
IdentityFile ~/.ssh/node-www-staging
41 changes: 41 additions & 0 deletions setup/ubuntu16.04_docker_alpine3.4/tasks/setup-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
# requires: @image_type
# requires: @ci_host
# requires: @secret

- name: Docker | Make build directory
file:
path: /root/{{ image_type }}
state: directory
tags: docker_build

- name: Docker | Generate Dockerfile
template:
src: ./resources/Dockerfile.j2
dest: /root/{{ image_type }}/Dockerfile
tags: docker_build

- name: Docker | Build Alpine image
command: docker build -t node-ci:alpine-{{ image_type }} /root/{{ image_type }}/
tags: docker_build

- name: Docker | Make mountable home directory
file:
path: "/home/{{ server_user }}/{{ image_type }}"
state: directory
mode: 0755
owner: "{{ server_user }}"
tags: docker_build

- name: Init | Generate and copy init script
template:
src: ./resources/jenkins.service.j2
dest: /lib/systemd/system/jenkins-{{ image_type }}.service
tags: docker_init

- name: Init | Start Jenkins
service:
name: jenkins-{{ image_type }}
state: started
enabled: yes
tags: docker_init

0 comments on commit 32ea721

Please sign in to comment.