@@ -14,6 +14,8 @@ const {sleep} = require('../src/util');
1414
1515// old traefik and server images
1616const traefikTag = 'traefik:1.3-alpine' ;
17+ const traefikVersion = 'v1.7' ;
18+ const traefikNewTag = `traefik:${ traefikVersion } ` ;
1719const serverTag = 'exoframe/server:1.0.0' ;
1820
1921// options base
@@ -43,7 +45,7 @@ beforeAll(async () => {
4345 // get all images
4446 const oldImages = await docker . listImages ( ) ;
4547 // remove current :latest images
46- const latestTraefik = oldImages . find ( img => img . RepoTags && img . RepoTags . includes ( 'traefik:latest' ) ) ;
48+ const latestTraefik = oldImages . find ( img => img . RepoTags && img . RepoTags . includes ( traefikNewTag ) ) ;
4749 if ( latestTraefik ) {
4850 const limg = docker . getImage ( latestTraefik . Id ) ;
4951 await limg . remove ( { force : true } ) ;
@@ -61,7 +63,7 @@ beforeAll(async () => {
6163 // get old one and tag it as latest
6264 oldTraefik = images . find ( img => img . RepoTags && img . RepoTags . includes ( traefikTag ) ) ;
6365 const timg = docker . getImage ( oldTraefik . Id ) ;
64- await timg . tag ( { repo : 'traefik' , tag : 'latest' } ) ;
66+ await timg . tag ( { repo : 'traefik' , tag : traefikVersion } ) ;
6567 oldServer = images . find ( img => img . RepoTags && img . RepoTags . includes ( serverTag ) ) ;
6668 const simg = docker . getImage ( oldServer . Id ) ;
6769 await simg . tag ( { repo : 'exoframe/server' , tag : 'latest' } ) ;
@@ -139,7 +141,7 @@ test('Should update traefik', async done => {
139141
140142 // check docker services
141143 const allImages = await docker . listImages ( ) ;
142- const newTraefik = allImages . find ( it => it . RepoTags && it . RepoTags . includes ( 'traefik:latest' ) ) ;
144+ const newTraefik = allImages . find ( it => it . RepoTags && it . RepoTags . includes ( traefikNewTag ) ) ;
143145 expect ( newTraefik . Id ) . not . toBe ( oldTraefik . Id ) ;
144146
145147 done ( ) ;
0 commit comments